Weather only works once at install?

Hi all,
Running Version 0.105.2
I am a bit new to this…but
I am trying to run HA under Docker on a QNAP NAS.
It was working fine, I wasn’t really doing much. But as I progressed I was getting some odd errors. So I started again with “latest” Docker image…
Got some issues, so started again, from scratch! :slight_smile:

  • So, basic default (untouched) configuration file.
  • Startup, create a user. No other integrations configured.

The weather card works fine. Not much else to see

Restart the Docker container…
Login and now the Weather card has no data and the looks like it cannot connect to the weather service.!?!
Hop onto the container and I can “wget” the URL in question?!
But now the logs show:

Error handling request
4:23 PM /usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py (ERROR) - message first occurred at 4:16 PM and shows up 117 times
Retrying in 20 minutes
4:16 PM components/met/weather.py (ERROR)
https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/1.9/ returned Cannot connect to host aa015h6buqvih86i1.api.met.no:443 ssl:None [Try again]
4:16 PM __main__.py (ERROR)
Ended unfinished session (id=7 from 2020-04-02 15:13:47.925497)
4:16 PM components/recorder/__init__.py (WARNING)
 **======== Full log ======**
2020-04-02 16:16:17 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=7 from 2020-04-02 15:13:47.925497)
2020-04-02 16:16:25 ERROR (MainThread) [metno] https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/1.9/ returned Cannot connect to host aa015h6buqvih86i1.api.met.no:443 ssl:None [Try again]

Any ideas?
Easy to reproduce, delete config directory and repeat…

Cheers

Edit:

Removed the following from the original logs, as it was a Chrome ache pointing to my previous SSL’ed install! :slight_smile:

2020-04-02 16:33:40 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 275, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 523, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method

Hmm so I thought I would start adding back in small bits at a time
I had some Synology cameras working.

But now they are unreachable?

Basic config +

camera:
  - platform: synology
    url: https://172.xx.0.xx:5001/
    username: camusername
    password: PassWord
    verify_ssl: false
2020-04-02 18:38:35 ERROR (MainThread) [homeassistant.components.synology.camera] Error when initializing SurveillanceStation
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 157, 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 113] Host is 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 672, in urlopen
    chunked=chunked,
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 300, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f41baddbe50>: Failed to establish a new connection: [Errno 113] Host is 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 720, 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 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='172.16.0.46', port=5001): Max retries exceeded with url: //webapi/query.cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.API.Auth%2CSYNO.SurveillanceStation.Camera%2CSYNO.SurveillanceStation.Camera.Event%2CSYNO.SurveillanceStation.VideoStream (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f41baddbe50>: Failed to establish a new connection: [Errno 113] Host is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/synology/camera.py", line 53, in async_setup_platform
    timeout=timeout,
  File "/usr/local/lib/python3.7/site-packages/synology/surveillance_station.py", line 12, in __init__
    self._api = Api(url, username, password, timeout, verify_ssl)
  File "/usr/local/lib/python3.7/site-packages/synology/api.py", line 59, in __init__
    self._initialize_api_info()
  File "/usr/local/lib/python3.7/site-packages/synology/api.py", line 70, in _initialize_api_info
    payload)
  File "/usr/local/lib/python3.7/site-packages/synology/api.py", line 192, in _get_json_with_retry
    return self._get_json(url, payload)
  File "/usr/local/lib/python3.7/site-packages/synology/api.py", line 198, in _get_json
    response = self._get(url, payload)
  File "/usr/local/lib/python3.7/site-packages/synology/api.py", line 185, in _get
    verify=self._verify_ssl)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 516, in send

But…???

# docker exec  -it home-assistant /bin/bash
bash-5.0# wget  https://172.xx.0.xx:5001/ --no-check-certificate -O -
Connecting to 172.xx.0.xx:5001 (172.xx.0.xx:5001)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=11" />
<meta name="msapplication-TileImage" content="resources/images/icon_tile.png?v=4398" />
<meta name="application-name" content="nas1&nbsp;-&nbsp;Synology&nbsp;DiskStation" />
<meta name="msapplication-TileColor" content="#246BB3"/>
<meta name="description" content="DiskStation provides a full-featured network attached storage (NAS) solution to help you manage, backup and share data among Windows, Mac and Linux easily." />
<meta name="keywords" content="Multitasking,Web Application,Personal Cloud" />

Hmmm just wait until the next day…touch nothing and everything works!

so it’s actually not a solution, the issue might come back any time :\

You are correct :frowning: This could be a load of race conditions…
I have restarted several times now and the now no errors relating to the synology or weather!

I’d suggest doing any further troubleshooting in a separate topics named appropriately as it increases your chances to get help.

1 Like