MerginMaps / MerginMaps/python-api-client

Client fails to pull on windows (when installed from pip)

Open
#114 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug windows
Dominant language
Python
Stars
23
Forks
12
Avg merge
2d 13h
Merged PRs (30d)
7

Description

When using the client on Windows outside of QGIS (e.g. installed through pip), it does not work correctly when trying to pull a new version that involves geodiff operations:

import mergin
client = mergin.MerginClient (login='john', password='topsecret')
client.download_project('john/project', 'C:/Data/Project')
# now do some modifications to a GeoPackage on the server
client.pull_project('C:/Data/Project')

It fails with the following traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\XYZ\AppData\Roaming\Python\Python38\site-packages\mergin\client.py", line 546, in pull_project
    return pull_project_finalize(job)
  File "C:\Users\XYZ\AppData\Roaming\Python\Python38\site-packages\mergin\client_pull.py", line 553, in pull_project_finalize
    raise ClientError("Cannot patch basefile {}! Please try syncing again.".format(basefile))
mergin.common.ClientError: Cannot patch basefile C:\Data\Project\.mergin\test.gpkg! Please try syncing again.

It looks like the underlying issue is in geodiff as client-log.txt contains this error:

GEODIFF: Unable to enable sqlite3/gpkg extensions

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with client.py:546 and client_pull.py:553, then inspect client-log.txt for the GEODIFF extension error. Reproduce the pip-installed Windows workflow described in the issue and trace the GeoPackage pull step. Done means pull_project completes for a changed GeoPackage without the reported ClientError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlite
Domain
databases, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.