QGIS plugin fails to download project due to malformed SQLite database
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start in mergin/client_pull.py at download_project_finalize and apply, then inspect the pygeodiff make_copy_sqlite path in mergin/deps/pygeodiff/main.py and geodifflib.py. Reproduce the production failure with the available project and full logs from @xkello. Done means the project downloads successfully, or malformed database files produce a clear actionable error.
Written by the indexing model from the issue text.
Description
Description
In the QGIS plugin, a project cannot be downloaded in the production environment.
The issue happens during the project download finalization step. Based on the available log, the failure occurs while the plugin is trying to create a SQLite copy as part of the download process. The operation fails with a GeoDiff error indicating that the database disk image is malformed.
Environment
PROD
Current behavior
The project download fails in the QGIS plugin.
The available log contains a Python traceback from the download finalization flow, ending with a GeoDiff make_copy_sqlite failure caused by a malformed SQLite database.
Expected behavior
The QGIS plugin should download the project successfully, or provide a clear and actionable error message if the project contains a malformed or unreadable database file.
Additional information
- Full logs can be provided by me: @xkello.
- The related Odoo ticket can also be provided if needed.
Stacktrace
Traceback (most recent call last):
File "/Users/<user>/Library/Application Support/QGIS/QGIS3/profiles/keychainone/python/plugins/Mergin/sync_dialog.py", line 151, in download_timer_tick
download_project_finalize(self.job)
File "/Users/<user>/Library/Application Support/QGIS/QGIS3/profiles/keychainone/python/plugins/Mergin/mergin/client_pull.py", line 247, in download_project_finalize
task.apply(job.mp.dir, job.mp)
File "/Users/<user>/Library/Application Support/QGIS/QGIS3/profiles/keychainone/python/plugins/Mergin/mergin/client_pull.py", line 302, in apply
mp.geodiff.make_copy_sqlite(mp.fpath(self.file_path), mp.fpath_meta(self.file_path))
File "/Users/<user>/Library/Application Support/QGIS/QGIS3/profiles/keychainone/python/plugins/Mergin/mergin/deps/pygeodiff/main.py", line 318, in make_copy_sqlite
return self.clib.make_copy_sqlite(self.context, src, dst)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/<user>/Library/Application Support/QGIS/QGIS3/profiles/keychainone/python/plugins/Mergin/mergin/deps/pygeodiff/geodifflib.py", line 476, in make_copy_sqlite
self._parse_return_code(context, res, "make_copy_sqlite")
File "/Users/<user>/Library/Application Support/QGIS/QGIS3/profiles/keychainone/python/plugins/Mergin/mergin/deps/pygeodiff/geodifflib.py", line 176, in _parse_return_code
raise GeoDiffLibError(msg)
Mergin.mergin.deps.pygeodiff.geodifflib.GeoDiffLibError: Error in make_copy_sqlite:
MakeCopySqlite: backup failed: database disk image is malformed
- Dominant language
- Python
- Stars
- 185
- Forks
- 22
- Avg merge
- 1h 31m
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MerginMaps/geodiff
-
GEODIFF_changesCount aborts the process on a truncated changeset (uncaught GeoDiffException)Possibly taken @mohanedmoh claimed this 21 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MerginMaps/geodiff#272 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
MerginMaps/geodiff#275 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 46/100
MerginMaps/geodiff#274 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 40/100
MerginMaps/geodiff#267 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
MerginMaps/geodiff#262 ·
All issues in MerginMaps/geodiff
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Deltares/numba_celltree#100 · 1 comment ·
-
auto-reported bug
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
soup airgap-bundle --bundle-size-cap nan, inf or a cap above ~1.67e299 GiB stops with an internal ValueError/OverflowError (exit 1) instead of a usage errorPossibly taken @Keshemir claimed this today. Openbug claimed difficulty:2
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
MakazhanAlpamys/Soup#3045 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
dagster-io/skills#80 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day