mobile icon indicating copy to clipboard operation
mobile copied to clipboard

SQL Query Layer causing? "Saving Failed"

Open morathus-karr opened this issue 8 months ago • 2 comments

android version: 14 kernal version: 4.19.191+ app version: 2025.2.0

It appears that the presence of a SQL Query Layer querying data on a geopackage within the project leads to a saving failure within the mergin app on android.

The query layer is made through QGIS DB Manager --> SQL window --> query --> "Load as new layer", and queries a geopackage present in the current project.

The SQL query, combines the geometry of one layer, and the attributes of another non-spatial layer - both of which are located within the same geopackage.

When attempting to input new data, first by creating geometry via the geometry layer, then inputing data into the many-to-one related non-spatial form/layer, the app presents the following error. "Saving Failed Failed to save changes. This should not happen normally. Please restart the app and..."

This error occurs when trying to save the non-spatial layer, and once the form/data deleted and the user us returned the the spatial layer form, is also presented with the same error.

The error persists even if the SQL Query Layer is turned off within the app, and disappears when the SQL Query Layer is removed from the project without any other changes.

morathus-karr avatar Apr 30 '25 09:04 morathus-karr

Hi @morathus-karr, thank you for reporting this. I will forward that to our support

tomasMizera avatar May 09 '25 10:05 tomasMizera

I could reproduce this. SQL layer is visible on project, but when adding new features saving fails.

At log level:

OGR error committing transaction: sqlite3_exec(COMMIT) failed: database is locked

fernandinand avatar May 12 '25 14:05 fernandinand