kart-qgis-plugin
kart-qgis-plugin copied to clipboard
Can't import dataset from database (GDAL DLL)
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:
- right-click on the repository in the kart plugin panel
- import dataset from database
- fill the connection informations
- choose a table / a layer
- 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
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
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.
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
Hello any clue to test here on my workstation ?
Nothing immediately, I'm afraid. What did you use to install PostgresQL?
Having the same issue, importing from Postgresql gives the following error
Installed 14.5 using enterprisedb
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
@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.
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.
@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.
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)
Tables are loaded correctly including the corresponding schema but upon selecting one and hitting OK to load the message error pop ups
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?
Adding localhost solves the issue, hopefully existing connections would be detected and that would save some time