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

DB Manager python error on missing GPKG datasource #31457

Closed
gioman opened this issue Aug 27, 2019 · 8 comments
Closed

DB Manager python error on missing GPKG datasource #31457

gioman opened this issue Aug 27, 2019 · 8 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin Feedback Waiting on the submitter for answers Regression Something which used to work, but doesn't anymore

Comments

@gioman
Copy link
Contributor

gioman commented Aug 27, 2019

In DB Manager if you have GPKG connection and the datasource is missing a python error is returned:

RuntimeError: /home/giovanni/Desktop/sven_outputs/sven_geodata.gpkg: No such file or directory 
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 115, 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 224, 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 53, in __init__
    self._opendb()
  File "/usr/share/qgis/python/plugins/db_manager/db_plugins/gpkg/connector.py", line 60, 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/sven_outputs/sven_geodata.gpkg: No such file or directory

On the other hand if a Spatialite datasource is missing a much nicer message is returned.

QGIS 3.8.2 on Ubuntu.

@gioman gioman added DB Manager Relating to the DB Manager core plugin Bug Either a bug report, or a bug fix. Let's hope for the latter! Regression Something which used to work, but doesn't anymore labels Aug 27, 2019
@gioman
Copy link
Contributor Author

gioman commented Aug 27, 2019

It does not happen on 3.4, so regression.

@elpaso elpaso self-assigned this Sep 9, 2019
@elpaso
Copy link
Contributor

elpaso commented Sep 9, 2019

I cannot reproduce on current master.
I created a GPKG, created the connection in the browser and renamed the file.
When I open DB manager and expand the tree to show the connections content, I get an (expected) error dialog and no stacktrace:

Screenshot_20190909_141741

What is the correct procedure to reproduce?

@elpaso elpaso added the Feedback Waiting on the submitter for answers label Sep 9, 2019
@gioman
Copy link
Contributor Author

gioman commented Sep 9, 2019

I cannot reproduce on current master.

I will check master too.

@gioman
Copy link
Contributor Author

gioman commented Sep 9, 2019

By the way, thanks for looking into this.

@gioman
Copy link
Contributor Author

gioman commented Sep 10, 2019

Still seeing on master:

Peek 2019-09-10 11-01

@elpaso
Copy link
Contributor

elpaso commented Sep 10, 2019

Sorry, tested again on master and I cannot reproduce.

@elpaso elpaso removed their assignment Sep 10, 2019
@gioman
Copy link
Contributor Author

gioman commented Sep 10, 2019

Sorry, tested again on master and I cannot reproduce.

I will try again on a different pc.

@gioman
Copy link
Contributor Author

gioman commented Sep 11, 2019

Sorry, tested again on master and I cannot reproduce.

it does not happen on my Windows testing VM, so it is likely a local issue.

@gioman gioman closed this as completed Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin Feedback Waiting on the submitter for answers Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

No branches or pull requests

2 participants