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

Cannot save project in Geopackage when using QueryLayer in QGIS for Windows #60568

Open
2 tasks done
immoblecher opened this issue Feb 12, 2025 · 4 comments
Open
2 tasks done
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers Project

Comments

@immoblecher
Copy link

What is the bug or the crash?

When creating a QueryLayer by right-clicking on a Geopackage layer in QGIS browser and "Execute SQL..." or when creating a QueryLayer with DB Manager, QGIS refuses to save the project in the same Geopackage, no matter if the project was saved before or new. The error message is:

_Unable to save project to storage geopackage:F:/Projekte/QGIS/test.gpkg?projectName=testing

Unable to insert or update project (project=geopackage:F:/Projekte/QGIS/test.gpkg?projectName=testing) in the destination table on the database: database is locked_

Tried latest LTR and 3.40.3 on Windows.

IMPORTANT: Works as expected on Ubuntu...no error (not sure why that would be; different locking mechanisms???)

Steps to reproduce the issue

  1. Load or create any layer in Geopackage
  2. Use 'Execute SQL...' from QGIS Browser to create a query layer from the same layer, or use DB manager to create QueryLayer
  3. Save project in same Geopackage
  4. Should produce error message

Versions

QGIS version3.40.3-Bratislava
QGIS code revision2a274ab7
 
Libraries
Qt version5.15.13
Python version3.12.8
GDAL/OGR version3.10.1
PROJ version9.5.1
EPSG Registry database versionv11.022 (2024-11-05)
GEOS version3.13.0-CAPI-1.19.0
SQLite version3.46.1
PDAL version2.8.3
PostgreSQL client versionunknown
SpatiaLite version5.1.0
QWT version6.3.0
QScintilla2 version2.14.1
OS versionWindows Server 2022 Version 2009
 
Active Python plugins
AppendFeaturesToLayer2.0.0
changeDataSource3.1
DataPlotly4.2.0
db-style-manager0.8
latlontools3.7.3
nominatim1.4.5
pg_raster_import3.2.0
pluginbuilder33.2.1
processing_saga_nextgen1.0.0
qgis_resource_sharing1.2.0
quick_map_services0.20.0
reloader0.1
searchlayers3.1.1
SelectByRelationship0.3.3
SpreadsheetLayers2.1.2
StyleLoadSave1.0
db_manager0.1.20
grassprovider2.12.99
processing2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@immoblecher immoblecher added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Feb 12, 2025
@immoblecher
Copy link
Author

After some testing it seems this only happens with network drives. On local drives there is no problem. Why would that be? Locking network policy? Drive should not matter?

@agiudiceandrea
Copy link
Member

agiudiceandrea commented Feb 13, 2025

@immoblecher, thanks for reporting. Just for clarity: it works as expected on Ubuntu even if the the geopackage file in which the project is stored is on a network drive? Have you actually tried if the issue occurs also using a new QGIS user profile? Do you know if the issue occurred in previous versions of QGIS?

@agiudiceandrea
Copy link
Member

It looks similar to a previously reported issue #36832. What do you think @elpaso?

@agiudiceandrea agiudiceandrea added Data Provider Related to specific vector, raster or mesh data providers Project labels Feb 13, 2025
@immoblecher
Copy link
Author

@agiudiceandrea , I have tried with a completely new user profile...same issue. On Ubuntu I presently do not connect to a network, but if I would, then probably through NFS or Samba, which is different to Windows network drives. So we wouldn't be able to compare, would we? But I can try with my home server over the weekend an see what happens.

I think this is a bit different to #36832 because "normal" vector layers in the project actually allow saving without problems. Its only when creating SQL QueryLayers where the problem starts.

Regarding previous QGIS versions I wouldn't know, sorry. I still have a 3.22 Flatpak QGIS version on my Ubuntu box, but that would probably not help in this case.

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! Data Provider Related to specific vector, raster or mesh data providers Project
Projects
None yet
Development

No branches or pull requests

2 participants