Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't import dataset from database (GDAL DLL) #78

Open
MaelREBOUX opened this issue Sep 16, 2022 · 11 comments
Open

Can't import dataset from database (GDAL DLL) #78

MaelREBOUX opened this issue Sep 16, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@MaelREBOUX
Copy link

Describe the bug

Really happy to test this famous plugin !
But with a fresh install of QGIS 3.16 and the kart plugin I can initialize a repo but cannot import a layer from a PostGIS database.

Reading the logs I don't know what is wrong. Help wanted...

Voluntary duplicate to #55

To Reproduce

Steps to reproduce the behavior:

  1. right-click on the repository in the kart plugin panel
  2. import dataset from database
  3. fill the connection informations
  4. choose a table / a layer
  5. Import

Then a modal dialog with errors appears :

127: La procédure spécifiée est introuvable.
127: La procédure spécifiée est introuvable.
127: La procédure spécifiée est introuvable.
127: La procédure spécifiée est introuvable.
127: La procédure spécifiée est introuvable.
127: La procédure spécifiée est introuvable.
127: La procédure spécifiée est introuvable.
127: La procédure spécifiée est introuvable.
127: La procédure spécifiée est introuvable.
127: La procédure spécifiée est introuvable.
127: La procédure spécifiée est introuvable.
127: La procédure spécifiée est introuvable.
127: La procédure spécifiée est introuvable.
127: La procédure spécifiée est introuvable.
[22448] Failed to execute script 'kart_cli' due to unhandled exception!
Traceback (most recent call last):
File "kart_cli.py", line 4, in 
File "kart\cli.py", line 392, in entrypoint
File "click\core.py", line 1130, in __call__
File "click\core.py", line 1055, in main
File "kart\cli_util.py", line 68, in invoke
File "click\core.py", line 1657, in invoke
File "click\core.py", line 1404, in invoke
File "click\core.py", line 760, in invoke
File "click\decorators.py", line 26, in new_func
File "kart\tabular\import_.py", line 343, in import_
File "kart\fast_import.py", line 268, in fast_import_tables
File "kart\tabular\pk_generation.py", line 85, in wrap_sources_if_needed
File "kart\tabular\pk_generation.py", line 85, in 
File "kart\tabular\pk_generation.py", line 78, in wrap_source_if_needed
File "kart\tabular\import_source.py", line 156, in schema
File "kart\schema.py", line 274, in from_column_dicts
TypeError: 'NoneType' object is not iterable 

And in the kart panel :

2022-09-16T16:11:39     CRITICAL    ERROR 1: Can't load requested DLL: C:\PROGRA~1\QGIS\3.16\bin\gdalplugins\gdal_ECW_JP2ECW.dll
             127: La procédure spécifiée est introuvable.
             
             ERROR 1: Can't load requested DLL: C:\PROGRA~1\QGIS\3.16\bin\gdalplugins\gdal_ECW_JP2ECW.dll
             127: La procédure spécifiée est introuvable.
             
             ERROR 1: Can't load requested DLL: C:\PROGRA~1\QGIS\3.16\bin\gdalplugins\gdal_GEOR.dll
             127: La procédure spécifiée est introuvable.
             
             ERROR 1: Can't load requested DLL: C:\PROGRA~1\QGIS\3.16\bin\gdalplugins\gdal_GEOR.dll
             127: La procédure spécifiée est introuvable.
             
             ERROR 1: Can't load requested DLL: C:\PROGRA~1\QGIS\3.16\bin\gdalplugins\gdal_HDF5.dll
             127: La procédure spécifiée est introuvable.
             
             ERROR 1: Can't load requested DLL: C:\PROGRA~1\QGIS\3.16\bin\gdalplugins\gdal_HDF5.dll
             127: La procédure spécifiée est introuvable.
             
             ERROR 1: Can't load requested DLL: C:\PROGRA~1\QGIS\3.16\bin\gdalplugins\gdal_MG4Lidar.dll
             127: La procédure spécifiée est introuvable.
             [Showing only the first 20 lines]

But these plugins are present in the directory

image

Expected behavior
To work

Version info (this is important!):

  • Windows 10 10.0.19041
  • QGIS 3.16.8
  • kart plugin 1.0.3
  • kart
Kart v0.11.5, Copyright (c) Kart Contributors
» GDAL v3.3.2; PROJ v8.1.1
» PyGit2 v1.9.0; Libgit2 v1.4.2; Git v2.34.0.windows.1.13.g93318cbc8d
» SQLAlchemy v1.4.40; pysqlite3 v2.6.0/v3.31.1; SpatiaLite v5.0.0; Libpq v11.0.9
» SpatialIndex v1.9.3
@MaelREBOUX MaelREBOUX added the bug Something isn't working label Sep 16, 2022
@pfw
Copy link
Contributor

pfw commented Sep 18, 2022

Thanks for reporting this.

This looks to be a similar issue to how the GDAL import paths are being set incorrect, I'll confirm if this is the same cause and if a similar fix can sort it out.

@MaelREBOUX
Copy link
Author

MaelREBOUX commented Sep 19, 2022

On my Windows system variables I get :

  • GDAL_DATA = "C:\applications\postgresql\13.8\gdal-data"

And because I have 2 PostgreSQL servers and 2 QGIS installed I get ogr2ogr in 4 places :

  • C:\applications\postgresql\11.9\bin\ogr2ogr.exe -> v2.2.4
  • C:\applications\postgresql\13.8\bin\ogr2ogr.exe -> v3.4.3
  • C:\Program Files\QGIS\3.16\bin\ogr2ogr.exe -> v3.1.4
  • C:\Program Files\QGIS\3.26\bin\ogr2ogr.exe -> v3.5.1

And by the game of the path variable, my current ogr2ogr.exe is the PG 13.8 one.

Hope this will help

@MaelREBOUX
Copy link
Author

MaelREBOUX commented Sep 30, 2022

Hello any clue to test here on my workstation ?

@pfw
Copy link
Contributor

pfw commented Oct 9, 2022

Nothing immediately, I'm afraid. What did you use to install PostgresQL?

@antoniolocandro
Copy link

Having the same issue, importing from Postgresql gives the following error

image

Installed 14.5 using enterprisedb

https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

@pfw
Copy link
Contributor

pfw commented Nov 7, 2022

@antoniolocandro Could you double check the 'Import from Database' dialog for me to see that both 'host' and 'port' have values? I am able to recreate this issue when I specify a port, database, table, username and password but not hostname.

@MaelREBOUX
Copy link
Author

Hello a colleague succeed to make kart work. There is an issue in the PG connection string that is raised. The int / str errot is linked to that.
I have to double check this and I come back here.

@pfw
Copy link
Contributor

pfw commented Nov 7, 2022

@MaelREBOUX Thanks for the update - if it is something similar to my example above where there some parts of the connection info aren't present then that makes sense and I know what we need to sort out there.

@antoniolocandro
Copy link

This is what I input, very similar to what I have in DB manager in QGIS (probably would be better if plugin detected existing connections by default also)

image

Tables are loaded correctly including the corresponding schema but upon selecting one and hitting OK to load the message error pop ups

image

@pfw
Copy link
Contributor

pfw commented Nov 7, 2022

Thanksk @antoniolocandro that is what I expected, I'll work up a fix for that ASAP but in the meantime if you add localhost as the host in that dialog does it go through correctly?

@antoniolocandro
Copy link

Adding localhost solves the issue, hopefully existing connections would be detected and that would save some time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants