Bug report #16296

Windows: Cannot use anymore d&d in DB Manager to import a layer from Spatialite in PostGIS

Added by Giovanni Manghi over 7 years ago. Updated almost 7 years ago.

Status:Closed
Priority:High
Assignee:Luigi Pirelli
Category:DB Manager
Affected QGIS version:2.18.13 Regression?:Yes
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:24206

Description

This seems to happen only on Windows (both Standalone and osgeo4w) as on other platforms (Linux, macOS) seems ok.

The error is always like

"unable to load the layer LAYERNAME"

Unless I'm wrong this used to work as expected in the past.

The same layer once loaded in the canvas can be imported using the "import layer/file" tool in DB Manager.

Recording #1.mp4 (1 MB) Giovanni Manghi, 2017-09-29 03:14 PM

record16286.mp4 (2.03 MB) Francisco Raga, 2017-10-02 04:43 PM

qgislog.txt Magnifier (101 KB) Luigi Pirelli, 2017-10-02 08:22 PM

Associated revisions

Revision 378ab23f
Added by Luigi Pirelli almost 7 years ago

fixed mimeUri x Spatialite and Geopackage. fixes #16296

Revision 5231ef64
Added by Alessandro Pasotti almost 7 years ago

Merge pull request #5290 from boundlessgeo/issue_16296_ddErrorInDbManager_2.18

[db_manager] d&d fix from spatialite and geopackage: fixes #16296

History

#1 Updated by Giovanni Manghi over 7 years ago

The same error shows when trying to import from GPKG to SL or PostGIS (and again only on Windows).

#2 Updated by Giovanni Manghi about 7 years ago

  • Regression? set to Yes

#3 Updated by Giovanni Manghi about 7 years ago

  • Priority changed from Severe/Regression to High

#4 Updated by Giovanni Manghi about 7 years ago

  • Easy fix? set to No

#5 Updated by Giovanni Manghi about 7 years ago

  • Affected QGIS version changed from 2.18.4 to 2.18.7
  • Description updated (diff)

#6 Updated by Giovanni Manghi almost 7 years ago

  • Subject changed from Cannot use anymore d&d to import a layer from Spatialite in PostGIS to Windows: Cannot use anymore d&d in DB Manager to import a layer from Spatialite in PostGIS
  • Affected QGIS version changed from 2.18.7 to 2.18.13

#7 Updated by Luigi Pirelli almost 7 years ago

  • Assignee set to Luigi Pirelli

#8 Updated by Luigi Pirelli almost 7 years ago

setting up a win 2.18 build to debug... in the meantime verifying on linux env

#9 Updated by Luigi Pirelli almost 7 years ago

please @giovanni add an exact procedure to replicate.

e.g. from what panel do you do d&d? from the same db manager? from layer panel? from a file? more datail and procedural steps are necessary

#10 Updated by Giovanni Manghi almost 7 years ago

screencast attached. The same operation works on Linux.

#11 Updated by Luigi Pirelli almost 7 years ago

Giovanni Manghi wrote:

screencast attached. The same operation works on Linux.

not confirmed on OSGeo4W qgis-rel-dev (2.18.13) dragging a spatialite layer... on what disk the layer is available? a network disk?

#12 Updated by Francisco Raga almost 7 years ago

Confirmed using qgis-rel-dev (2.18.13-8) on windows 10.

video attached.

the .sqlite used : https://www.gaia-gis.it/spatialite-2.3.1/test-2.3.zip
and gpkg : http://www.geopackage.org/data/sample1_2.gpkg

the source for the exmaple gpkg is:
u'G:/16296/sample1_2.gpkg'

if load it from dbmanager:
u'D:/test/16296/sample1_2.gpkg|layername=counties'

#13 Updated by Luigi Pirelli almost 7 years ago

From a log done by Giovanni Manghi the error is the QgsMimeDataUtils::decodeUriList method
..\..\..\..\..\src\core\qgsmimedatautils.cpp(111) : (QgsMimeDataUtils::decodeUriList) [15234ms] vector:ogr:counties:C:/Users/gio/Desktop/sample1_2.gpkg|layername=counties
..\..\..\..\..\src\core\qgsmimedatautils.cpp(47) : (QgsMimeDataUtils::Uri::Uri) [16ms] encData: vector:ogr:counties:C:/Users/gio/Desktop/sample1_2.gpkg|layername=counties
..\..\..\..\..\src\core\qgsmimedatautils.cpp(71) : (QgsMimeDataUtils::Uri::Uri) [15ms] type:vector key:ogr name:counties uri:C supportedCRS: supportedFormats:

#14 Updated by Luigi Pirelli almost 7 years ago

the log is different in my case:
..\..\..\..\..\src\core\qgsmimedatautils.cpp(111) : (QgsMimeDataUtils::decodeUriList) [36333ms] vector:spatialite:prova_giovanni:dbname='//vmware-host/Shared Folders/Desktop/data/issue_16296/prova_giovanni.sqlite' table="prova_giovanni" (geometry) sql=
..\..\..\..\..\src\core\qgsmimedatautils.cpp(47) : (QgsMimeDataUtils::Uri::Uri) [15ms] encData: vector:spatialite:prova_giovanni:dbname='//vmware-host/Shared Folders/Desktop/data/issue_16296/prova_giovanni.sqlite' table="prova_giovanni" (geometry) sql=
..\..\..\..\..\src\core\qgsmimedatautils.cpp(71) : (QgsMimeDataUtils::Uri::Uri) [0ms] type:vector key:spatialite name:prova_giovanni uri:dbname='//vmware-host/Shared Folders/Desktop/data/issue_16296/prova_giovanni.sqlite' table="prova_giovanni" (geometry) sql= supportedCRS: supportedFormats:

due the fact that Desktop points to the host desktop in my VM

#15 Updated by Richard Duivenvoorde almost 7 years ago

@luigi: not sure if it is related, but in current master the Drag&Drop in the browser (also) segfaults my QGIS.

Test:
- load 2 shapefiles
- save one of them as gpkg in /tmp (all fine untill now)
- now in browser (or actually in the 'datamanager/onebutton') drag another shape into the gpkg
- with me it segfaults then

(not sure if it is related though)

Warning 6: creation option '' is not formatted with the key=value format
Warning 6: layer creation option '' is not formatted with the key=value format
ERROR 6: The PNG driver does not support update access to existing datasets.

ERROR 6: The PNG driver does not support update access to existing datasets.

ERROR 6: The PNG driver does not support update access to existing datasets.

ERROR 1: Random access not supported for /vsizip
ERROR 1: posix_spawnp() failed
QGIS died on signal 11[New LWP 18384]
[New LWP 18385]
[New LWP 18386]
[New LWP 18387]
[New LWP 18388]
[New LWP 18389]
[New LWP 18392]
[New LWP 18393]
[New LWP 18394]
[New LWP 18395]
[New LWP 18396]
[New LWP 18397]
[New LWP 18407]
[New LWP 18420]
[New LWP 18421]
[New LWP 18438]

warning: td_ta_new failed: generic error

warning: File "/usr/lib/x86_64-linux-gnu/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
    add-auto-load-safe-path /usr/lib/x86_64-linux-gnu/libthread_db-1.0.so
line to your configuration file "/home/richard/.gdbinit".
To completely disable this security protection add
    set auto-load safe-path /
line to your configuration file "/home/richard/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
    info "(gdb)Auto-loading safe path" 

warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Cannot access memory at address 0x7f26d5724148

warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.

warning: td_ta_new failed: generic error

warning: File "/usr/lib/x86_64-linux-gnu/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".

warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Failed to read a valid object file image from memory.
Couldn't get registers: No such process.
[Current thread is 1 (LWP 18383)]
Couldn't get registers: No such process.
Couldn't get registers: No such process.
Python Exception <class 'gdb.error'> Couldn't get registers: No such process.: 
Couldn't get registers: No such process.
/home/richard/bin/qgis: line 5: 18383 Killed                  /home/richard/bin/qgis_all/master/debug/bin/qgis "$@" 

#16 Updated by Luigi Pirelli almost 7 years ago

Richard, I can't say, btw Browser is completely different code respect Db Manager. Try to notify this issue to Alessando Pasotti or Even Rouault

Richard Duivenvoorde wrote:

@luigi: not sure if it is related, but in current master the Drag&Drop in the browser (also) segfaults my QGIS.

Test:
- load 2 shapefiles
- save one of them as gpkg in /tmp (all fine untill now)
- now in browser (or actually in the 'datamanager/onebutton') drag another shape into the gpkg
- with me it segfaults then

(not sure if it is related though)

[...]

#17 Updated by Luigi Pirelli almost 7 years ago

preparing PR

#18 Updated by Luigi Pirelli almost 7 years ago

  • Pull Request or Patch supplied changed from No to Yes

#19 Updated by Luigi Pirelli almost 7 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF