MerginMaps / MerginMaps/qgis-plugin

Python error when internet connection is unstable

Open
#229 1 comment 0 reactions 1 assignee View on GitHub

@erpas is already working on this.

Since May 7, 2021.

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

Description

Steps:
Disconnect from wifi/ethernet
Try to test connection with mergin plugin and it crashed

Funny thing is, that fetching (in Explore for example) will still fetch some data anyway :D

https://user-images.githubusercontent.com/78033756/116673380-9afd7f80-a9a3-11eb-89c8-519cf5c9b967.mp4

An error has occurred while executing Python code:

Mergin.mergin.common.ClientError: Error trying to log in:
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 -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/shockwave/.local/share/QGIS/QGIS3/profiles/Test1/python/plugins/Mergin/mergin/client.py", line 223, in login
resp = 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/shockwave/.local/share/QGIS/QGIS3/profiles/Test1/python/plugins/Mergin/configuration_dialog.py", line 114, in test_connection
mc = MerginClient(url, None, username, password, get_plugin_version())
File "/home/shockwave/.local/share/QGIS/QGIS3/profiles/Test1/python/plugins/Mergin/mergin/client.py", line 88, in init
self.login(login, password)
File "/home/shockwave/.local/share/QGIS/QGIS3/profiles/Test1/python/plugins/Mergin/mergin/client.py", line 233, in login
raise ClientError("Error trying to log in: " + str(e))
Mergin.mergin.common.ClientError: Error trying to log in:

Python version: 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]
QGIS version: 3.16.6-Hannover Hannover, bfd36fddc9

Python Path:
/usr/share/qgis/python
/home/shockwave/.local/share/QGIS/QGIS3/profiles/Test1/python
/home/shockwave/.local/share/QGIS/QGIS3/profiles/Test1/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/shockwave/.local/share/QGIS/QGIS3/profiles/Test1/python
.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.