Bug report #20238

DB Manager: Python error when trying to open a GPKG connection and the datasource is missing

Added by Giovanni Manghi almost 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:High
Assignee:Alessandro Pasotti
Category:DB Manager
Affected QGIS version:3.4.0 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:28059

Description

The same scenario but with Spatialite it returns a much better message in a dialog window.

Traceback (most recent call last):
File "/usr/share/qgis/python/plugins/db_manager/db_model.py", line 444, in rowCount
self._refreshIndex(parent, True)
File "/usr/share/qgis/python/plugins/db_manager/db_model.py", line 493, in refreshIndex
if item.populate():
File "/usr/share/qgis/python/plugins/db_manager/db_model.py", line 170, in populate
if not connection.connect():
File "/usr/share/qgis/python/plugins/db_manager/db_plugins/gpkg/plugin.py", line 78, in connect
return self.connectToUri(uri)
File "/usr/share/qgis/python/plugins/db_manager/db_plugins/plugin.py", line 109, in connectToUri
self.db = self.databasesFactory(self, uri)
File "/usr/share/qgis/python/plugins/db_manager/db_plugins/gpkg/plugin.py", line 64, in databasesFactory
return GPKGDatabase(connection, uri)
File "/usr/share/qgis/python/plugins/db_manager/db_plugins/gpkg/plugin.py", line 108, in init
Database.
_init__(self, connection, uri)
File "/usr/share/qgis/python/plugins/db_manager/db_plugins/plugin.py", line 218, in init
self.connector = self.connectorsFactory(uri)
File "/usr/share/qgis/python/plugins/db_manager/db_plugins/gpkg/plugin.py", line 111, in connectorsFactory
return GPKGDBConnector(uri)
File "/usr/share/qgis/python/plugins/db_manager/db_plugins/gpkg/connector.py", line 50, in init
self._opendb()
File "/usr/share/qgis/python/plugins/db_manager/db_plugins/gpkg/connector.py", line 57, in _opendb
self.gdal_ds = gdal.OpenEx(self.dbname, gdal.OF_UPDATE)
File "/usr/lib/python3/dist-packages/osgeo/gdal.py", line 3014, in OpenEx
return _gdal.OpenEx(*args, **kwargs)
RuntimeError: /home/giovanni/Desktop/lixo1.gpkg: No such file or directory

qgis-dbmnager-invalid-gpkg.png (253 KB) Alessandro Pasotti, 2018-10-28 02:36 PM

History

#1 Updated by Alessandro Pasotti almost 6 years ago

  • Assignee set to Alessandro Pasotti

#2 Updated by Alessandro Pasotti almost 6 years ago

I cannot reproduce (but you don't say "how" you "trying to open a GPKG connection", so I'm probably doing that different than you did).

In my test, a yellow warning message bar appears (see attachment)

Can you make a short video?

#3 Updated by Giovanni Manghi almost 6 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

Also available in: Atom PDF