KoljaWindeler / ics

Integration that displays the next event of an ics link (support reoccuring events)
51 stars 12 forks source link

Fehler beim Einlesen einer ICS-Datei / Abfallkalender #12

Closed gkerkewitz closed 3 years ago

gkerkewitz commented 4 years ago

Hallo,

beim Einlesen einer ics-Datei mit dem Abfallkalender erscheint folgender Fehler. Daten können jedoch auf einer Sensor-Card angezeigt werden.

2020-06-06 13:30:40 ERROR (MainThread) [custom_components.ics.sensor] Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 160, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection raise err File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection sock.connect(sa) OSError: [Errno 101] Network unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 677, in urlopen chunked=chunked, File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 392, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/local/lib/python3.7/http/client.py", line 1252, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/lib/python3.7/http/client.py", line 1298, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.7/http/client.py", line 1247, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.7/http/client.py", line 1026, in _send_output self.send(msg) File "/usr/local/lib/python3.7/http/client.py", line 966, in send self.connect() File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 187, in connect conn = self._new_conn() File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 172, in _new_conn self, "Failed to establish a new connection: %s" % e urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f0ea9f7c710>: Failed to establish a new connection: [Errno 101] Network unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 725, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 439, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='diskstation.local', port=8123): Max retries exceeded with url: /local/abfallkalender/abfallkalender-2020.ics (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0ea9f7c710>: Failed to establish a new connection: [Errno 101] Network unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/ics/sensor.py", line 167, in get_data cal_string = await async_load_data(self.hass, self._url) File "/config/custom_components/ics/const.py", line 237, in async_load_data ret = await hass.async_add_executor_job(partial(requests.get, url, headers={'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36'}, allow_redirects=True)) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, self.kwargs) File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 76, in get return request('get', url, params=params, kwargs) File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 530, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 643, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='diskstation.local', port=8123): Max retries exceeded with url: /local/abfallkalender/abfallkalender-2020.ics (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0ea9f7c710>: Failed to establish a new connection: [Errno 101] Network unreachable'))

KoljaWindeler commented 3 years ago

Hi, fuer lokale dateien bietet sich an die url zu aendern in file:///config/www/abfallkalender/.. ich habe mal versucht bei mir eine lokale datei uber den HA webserver zu bekommen .. scheitere aber gerade auch .. wobei ich keine Fehlermeldung bekomme .. ich gucks mir bei Zeiten im Detail an, aber Lokale dateien -> file:// hilft! Kolja

KoljaWindeler commented 3 years ago

No further comment