srcfl / srcful-gateway

Sourceful Energy Gateway: Connect your solar inverter or Utility meters to earn tokens.
https://sourceful.energy/
MIT License
5 stars 2 forks source link

Failed APICallTask exception dump #258

Open h0bb3 opened 5 days ago

h0bb3 commented 5 days ago

If the task fails to connect to the API there is a rather large dump. Seems excessive...

ERROR:server.tasks.srcfulAPICallTask:Error in SrcfulAPICallTask HTTPSConnectionPool(host='api.srcful.dev', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x74f6581b9c90>: Failed to resolve 'api.srcful.dev' ([Errno -3] Temporary failure in name resolution)"))'Traceback (most recent call last):\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/urllib3/connection.py", line 198, in _new_conn\n    sock = connection.create_connection(\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/urllib3/util/connection.py", line 60, in create_connection\n    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/usr/lib/python3.11/socket.py", line 962, in getaddrinfo\n    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsocket.gaierror: [Errno -3] Temporary failure in name resolution\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 793, in urlopen\n    response = self._make_request(\n               ^^^^^^^^^^^^^^^^^^^\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 491, in _make_request\n    raise new_e\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 467, in _make_request\n    self._validate_conn(conn)\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1099, in _validate_conn\n    conn.connect()\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/urllib3/connection.py", line 616, in connect\n    self.sock = sock = self._new_conn()\n                       ^^^^^^^^^^^^^^^^\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/urllib3/connection.py", line 205, in _new_conn\n    raise NameResolutionError(self.host, self, e) from e\nurllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x74f6581b9c90>: Failed to resolve \'api.srcful.dev\' ([Errno -3] Temporary failure in name resolution)\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/requests/adapters.py", line 564, in send\n    resp = conn.urlopen(\n           ^^^^^^^^^^^^^\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 847, in urlopen\n    retries = retries.increment(\n              ^^^^^^^^^^^^^^^^^^\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/urllib3/util/retry.py", line 515, in increment\n    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]\n    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nurllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=\'api.srcful.dev\', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x74f6581b9c90>: Failed to resolve \'api.srcful.dev\' ([Errno -3] Temporary failure in name resolution)"))\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File "/home/h0bb3/projects/github/srcful-gateway/server/tasks/srcfulAPICallTask.py", line 63, in execute\n    response = post()\n               ^^^^^^\n  File "/home/h0bb3/projects/github/srcful-gateway/server/tasks/srcfulAPICallTask.py", line 57, in post\n    return requests.post(self.post_url, json=json, timeout=5)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/requests/api.py", line 115, in post\n    return request("post", url, data=data, json=json, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/requests/api.py", line 59, in request\n    return session.request(method=method, url=url, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/requests/sessions.py", line 589, in request\n    resp = self.send(prep, **send_kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/requests/sessions.py", line 703, in send\n    r = adapter.send(request, **kwargs)\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/home/h0bb3/projects/github/srcful-gateway/.venv/lib/python3.11/site-packages/requests/adapters.py", line 597, in send\n    raise ConnectionError(e, request=request)\nrequests.exceptions.ConnectionError: HTTPSConnectionPool(host=\'api.srcful.dev\', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x74f6581b9c90>: Failed to resolve \'api.srcful.dev\' ([Errno -3] Temporary failure in name resolution)"))'
ERROR:server.tasks.saveStateTask:Failed to save state <Response [None]>
ERROR:server.tasks.saveStateTask:State: {'status': {'version': '0.15.2', 'uptime': 5709636, 'messages': [{'message': ('Failed to find %s, rescan and retry in 5 minutes', 'LGF5E360'), 'type': 'error', 'timestamp': 1729929054, 'id': 152}, {'message': "Device opened: {'connection': 'P1Telnet', 'ip': '192.168.0.30', 'port': 23, 'meter_serial_number': 'LGF5E360'}", 'type': 'info', 'timestamp': 1729929357, 'id': 189}]}, 'timestamp': 1729934695712, 'crypto': {'deviceName': 'UNKNOWN', 'serialNumber': 'f42ea576ac87184445', 'publicKey': '2f5d41eacf701c18eb1bdae549ee0232ed2b9f3dd2b983ff7b68240bbba84f7b4903d0a52a1ab3d47e7155c5f3455fdbe7997bf85b2258fee6644e16b7e8e9be', 'compactKey': '11MrriRzME34r8axBU6SbfM1gRayYtomYSAWmRStVCxbPp8akAd', 'chipDeathCount': 0}, 'network': {'wifi': {'ssids': []}, 'address': {'ip': 'no network', 'port': 5000, 'eth0_mac': dbus.String('00:E0:4C:A6:DF:EE', variant_level=1), 'wlan0_mac': dbus.String('A0:D3:65:D2:AC:76', variant_level=1), 'interfaces': {dbus.String('ztosigpjwy', variant_level=1): dbus.String('10.147.18.127', variant_level=1), dbus.String('zt6ovw2sud', variant_level=1): dbus.String('10.243.116.129', variant_level=1), dbus.String('br-0c556921173d', variant_level=1): dbus.String('172.18.0.1', variant_level=1), dbus.String('docker0', variant_level=1): dbus.String('172.17.0.1', variant_level=1), dbus.String('br-98754f0e6c88', variant_level=1): dbus.String('172.19.0.1', variant_level=1), dbus.String('br-eae421df77e4', variant_level=1): dbus.String('172.20.0.1', variant_level=1), dbus.String('br-8c91cdce1961', variant_level=1): dbus.String('172.21.0.1', variant_level=1)}}}, 'devices': {'configured': [{'connection': {'connection': 'P1Telnet', 'ip': '192.168.0.30', 'port': 23, 'meter_serial_number': 'LGF5E360'}, 'is_open': True}], 'supported': {'inverters': [{'name': 'huawei', 'dname': 'Huawei', 'proto': 'mb'}, {'name': 'solaredge', 'dname': 'SolarEdge', 'proto': 'mb'}, {'name': 'sungrow', 'dname': 'Sungrow', 'proto': 'mb'}, {'name': 'sungrow_hybrid', 'dname': 'Sungrow Hybrid', 'proto': 'mb'}, {'name': 'sma', 'dname': 'SMA', 'proto': 'mb'}, {'name': 'fronius', 'dname': 'Fronius', 'proto': 'mb'}, {'name': 'fronius_sunspec', 'dname': 'Fronius (SunSpec)', 'proto': 'mb'}, {'name': 'deye', 'dname': 'Deye', 'proto': 'sol'}, {'name': 'deye_hybrid', 'dname': 'Deye Hybrid', 'proto': 'sol'}, {'name': 'growatt', 'dname': 'Growatt', 'proto': 'mb'}, {'name': 'goodwe', 'dname': 'GoodWe', 'proto': 'mb'}, {'name': 'lqt40s', 'dname': 'LQT40S', 'proto': 'mb'}, {'name': 'ferroamp', 'dname': 'ferroamp', 'proto': 'mb'}]}}, 'available_devices': []}
WARNING:server.tasks.configurationMutationTask:Failed to mutate configuration state
ERROR:server.tasks.saveStateTask:Failed to save state <Response [None]>
ERROR:server.tasks.saveStateTask:State: {'status': {'version': '0.15.2', 'uptime': 5710208, 'messages': [{'message': ('Failed to find %s, rescan and retry in 5 minutes', 'LGF5E360'), 'type': 'error', 'timest ...
WARNING:server.tasks.saveStateTask:Failed to save state <Response [None]>
h0bb3 commented 5 days ago

One way to trigger this could be to run the server locally and let the computer hibernate. When it comes back up it seems the server application is continuing to run before the network stack has woken up.