MerginMaps / MerginMaps/qgis-plugin

Problem synchronising QGis project with Mergin after changing *.Mbtiles offline maps

Open
#188 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
44
Forks
20
Avg merge
3d 12h
Merged PRs (30d)
5

Description

Hi,

I am using almost every day a QGis project and sync happens almost every two days.
Today I changed some *.mbtiles offline maps and I got this mismatch:

Mergin.mergin.common.ClientError: Error requesting https://public.cloudmergin.com/v1/project/Boswachter_Marc/MiradalCloudSurvey_201122?since=v69:
Traceback (most recent call last):
File "/usr/lib/python3.8/urllib/request.py", line 1350, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/usr/lib/python3.8/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/lib/python3.8/http/client.py", line 950, in send
self.connect()
File "/usr/lib/python3.8/http/client.py", line 1417, in connect
super().connect()
File "/usr/lib/python3.8/http/client.py", line 921, in connect
self.sock = self._create_connection(
File "/usr/lib/python3.8/socket.py", line 787, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Naam of dienst is niet bekend

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/boswachter/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Mergin/mergin/client.py", line 131, in _do_request
return self.opener.open(request)
File "/usr/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 1393, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/usr/lib/python3.8/urllib/request.py", line 1353, in do_open
raise URLError(err)
urllib.error.URLError:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/boswachter/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Mergin/plugin.py", line 319, in sync_project
pull_changes, push_changes, push_changes_summary = self.mc.project_status(self.path)
File "/home/boswachter/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Mergin/mergin/client.py", line 449, in project_status
server_info = self.project_info(project_path, since=local_version)
File "/home/boswachter/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Mergin/mergin/client.py", line 332, in project_info
resp = self.get("/v1/project/{}".format(project_path), params)
File "/home/boswachter/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Mergin/mergin/client.py", line 146, in get
return self._do_request(request)
File "/home/boswachter/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Mergin/mergin/client.py", line 114, in wrapper
return f(self, *args)
File "/home/boswachter/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Mergin/mergin/client.py", line 139, in _do_request
raise ClientError("Error requesting " + request.full_url + ": " + str(e))
Mergin.mergin.common.ClientError: Error requesting https://public.cloudmergin.com/v1/project/Boswachter_Marc/MiradalCloudSurvey_201122?since=v69:

Python versie: 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
QGIS versie: 3.16.0-Hannover Hannover, 43b64b13f3

Python pad:
/usr/share/qgis/python
/home/boswachter/.local/share/QGIS/QGIS3/profiles/default/python
/home/boswachter/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python38.zip
/usr/lib/python3.8
/usr/lib/python3.8/lib-dynload
/usr/local/lib/python3.8/dist-packages
/usr/lib/python3/dist-packages
/home/boswachter/.local/share/QGIS/QGIS3/profiles/default/python
/home/boswachter/Geodata/Geopackages/MiradalCloudSurvey_201122

Could you have a look at the problem?
Thank you.
.

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 at plugin.py in sync_project, then follow mergin/client.py through project_status, project_info, get, and _do_request. Reproduce the reported sync after changing an offline MBTiles map and determine whether the request failure is handled correctly; done means the cause is identified and the resulting behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.