firebase-admin-python icon indicating copy to clipboard operation
firebase-admin-python copied to clipboard

Throws an error after 1 hour on linux (Connection reset by peer)

Open Seinro opened this issue 2 years ago • 1 comments

The program worked for a long time on windows. Ported to linux (raspberry pi 4). After 1 hour of work, it gives an error. I assume that this is related to the id token. Please help me solve this problem

Python 3.9.2 (default, Mar 12 2021, 04:06:34) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license()" for more information.

=============== RESTART: /home/sabri/Desktop/StatusControllers.py ============== Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 445, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 440, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.9/http/client.py", line 1347, in getresponse response.begin() File "/usr/lib/python3.9/http/client.py", line 307, in begin version, status, reason = self._read_status() File "/usr/lib/python3.9/http/client.py", line 268, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "/usr/lib/python3.9/socket.py", line 704, in readinto return self._sock.recv_into(b) File "/usr/lib/python3.9/ssl.py", line 1241, in recv_into return self.read(nbytes, buffer) File "/usr/lib/python3.9/ssl.py", line 1099, in read return self._sslobj.read(len, buffer) ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 755, in urlopen retries = retries.increment( File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 532, in increment raise six.reraise(type(error), error, _stacktrace) File "/usr/lib/python3/dist-packages/six.py", line 718, in reraise raise value.with_traceback(tb) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 445, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 440, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.9/http/client.py", line 1347, in getresponse response.begin() File "/usr/lib/python3.9/http/client.py", line 307, in begin version, status, reason = self._read_status() File "/usr/lib/python3.9/http/client.py", line 268, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "/usr/lib/python3.9/socket.py", line 704, in readinto return self._sock.recv_into(b) File "/usr/lib/python3.9/ssl.py", line 1241, in recv_into return self.read(nbytes, buffer) File "/usr/lib/python3.9/ssl.py", line 1099, in read return self._sslobj.read(len, buffer) urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/sabri/.local/lib/python3.9/site-packages/google/auth/transport/requests.py", line 193, in call response = self.session.request( File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 498, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/sabri/Desktop/StatusControllers.py", line 110, in jsonStr = db.reference('roomsDevices').get() #получаем данные File "/home/sabri/.local/lib/python3.9/site-packages/firebase_admin/db.py", line 221, in get return self._client.body('get', self._add_suffix(), params=params) File "/home/sabri/.local/lib/python3.9/site-packages/firebase_admin/_http_client.py", line 131, in body resp = self.request(method, url, **kwargs) File "/home/sabri/.local/lib/python3.9/site-packages/firebase_admin/db.py", line 929, in request return super(_Client, self).request(method, url, **kwargs) File "/home/sabri/.local/lib/python3.9/site-packages/firebase_admin/_http_client.py", line 118, in request resp = self._session.request(method, self.base_url + url, **kwargs) File "/home/sabri/.local/lib/python3.9/site-packages/google/auth/transport/requests.py", line 545, in request self.credentials.before_request(auth_request, method, url, request_headers) File "/home/sabri/.local/lib/python3.9/site-packages/google/auth/credentials.py", line 135, in before_request self.refresh(request) File "/home/sabri/.local/lib/python3.9/site-packages/google/oauth2/service_account.py", line 429, in refresh access_token, expiry, _ = _client.jwt_grant( File "/home/sabri/.local/lib/python3.9/site-packages/google/oauth2/_client.py", line 299, in jwt_grant response_data = _token_endpoint_request( File "/home/sabri/.local/lib/python3.9/site-packages/google/oauth2/_client.py", line 260, in _token_endpoint_request response_status_ok, response_data, retryable_error = _token_endpoint_request_no_throw( File "/home/sabri/.local/lib/python3.9/site-packages/google/oauth2/_client.py", line 209, in _token_endpoint_request_no_throw request_succeeded, response_data, retryable_error = _perform_request() File "/home/sabri/.local/lib/python3.9/site-packages/google/oauth2/_client.py", line 185, in _perform_request response = request( File "/home/sabri/.local/lib/python3.9/site-packages/google/auth/transport/requests.py", line 199, in call six.raise_from(new_exc, caught_exc) File "", line 3, in raise_from google.auth.exceptions.TransportError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

Seinro avatar Mar 25 '23 08:03 Seinro

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Mar 25 '23 08:03 google-oss-bot