Errors in Hassbian (fresh installation from scratch)

Hi all,

I just moved to Hassbian (tried hass.io but it doesn’t work in my opinion).

Frontend is working but automations don’t.

Looking at log I see A LOT of errors:

2017-10-29 08:53:43 ERROR (Thread-9) [homeassistant.components.sensor.command_line] Command failed: python3 -c “import requests; print(requests.get(‘https://pypi.python.org/pypi/homeassistant/json’).json()[‘info’]['version’])”
2017-10-29 08:53:47 ERROR (MainThread) [homeassistant.components.sensor] Error on device update!
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/connector.py”, line 710, in _create_direct_connection
local_addr=self._local_addr)
File “/usr/lib/python3.5/asyncio/base_events.py”, line 801, in create_connection
sock, protocol_factory, ssl, server_hostname)
File “/usr/lib/python3.5/asyncio/base_events.py”, line 827, in _create_connection_transport
yield from waiter
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
ConnectionResetError

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

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/connector.py”, line 378, in connect
proto = yield from self._create_connection(req)
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/connector.py”, line 687, in _create_connection
_, proto = yield from self._create_direct_connection(req)
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/connector.py”, line 737, in _create_direct_connection
(req.host, req.port, exc.strerror)) from exc
aiohttp.client_exceptions.ClientConnectorError: [Errno None] Can not connect to api.waqi.info:443 [None]

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

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py”, line 216, in async_add_entity
yield from entity.async_device_update(warning=False)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py”, line 307, in async_device_update
yield from self.async_update()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/waqi.py”, line 167, in async_update
result = yield from self._client.get_station_by_number(self.uid)
File “/srv/homeassistant/lib/python3.5/site-packages/waqiasync/init.py”, line 42, in get_station_by_number
return (yield from self._get(FEED_NUMBER_URL.format(number)))
File “/srv/homeassistant/lib/python3.5/site-packages/waqiasync/init.py”, line 48, in _get
path, params=dict(self._params, **kwargs))
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py”, line 97, in iter
ret = yield from self._coro
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/client.py”, line 231, in _request
conn = yield from self._connector.connect(req)
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/connector.py”, line 383, in connect
.format(key, exc.strerror)) from exc
aiohttp.client_exceptions.ClientConnectorError: [Errno None] Cannot connect to host api.waqi.info:443 ssl:True [Can not connect to api.waqi.info:443 [None]]
2017-10-29 08:53:49 ERROR (MainThread) [homeassistant.components.media_player] Error on device update!
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py”, line 600, in urlopen
chunked=chunked)
File “/srv/homeassistant/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py”, line 345, in _make_request
self._validate_conn(conn)
File “/srv/homeassistant/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py”, line 844, in validate_conn
conn.connect()
File “/srv/homeassistant/lib/python3.5/site-packages/requests/packages/urllib3/connection.py”, line 326, in connect
ssl_context=context)
File "/srv/homeassistant/lib/python3.5/site-packages/requests/packages/urllib3/util/ssl
.py", line 325, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File “/usr/lib/python3.5/ssl.py”, line 385, in wrap_socket
_context=self)
File “/usr/lib/python3.5/ssl.py”, line 760, in init
self.do_handshake()
File “/usr/lib/python3.5/ssl.py”, line 996, in do_handshake
self._sslobj.do_handshake()
File “/usr/lib/python3.5/ssl.py”, line 641, in do_handshake
self._sslobj.do_handshake()
OSError: [Errno 0] Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/requests/adapters.py”, line 438, in send
timeout=timeout
File “/srv/homeassistant/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py”, line 649, in urlopen
_stacktrace=sys.exc_info()[2])
File “/srv/homeassistant/lib/python3.5/site-packages/requests/packages/urllib3/util/retry.py”, line 357, in increment
raise six.reraise(type(error), error, _stacktrace)
File “/srv/homeassistant/lib/python3.5/site-packages/requests/packages/urllib3/packages/six.py”, line 685, in reraise
raise value.with_traceback(tb)
File “/srv/homeassistant/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py”, line 600, in urlopen
chunked=chunked)
File “/srv/homeassistant/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py”, line 345, in _make_request
self._validate_conn(conn)
File “/srv/homeassistant/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py”, line 844, in validate_conn
conn.connect()
File “/srv/homeassistant/lib/python3.5/site-packages/requests/packages/urllib3/connection.py”, line 326, in connect
ssl_context=context)
File "/srv/homeassistant/lib/python3.5/site-packages/requests/packages/urllib3/util/ssl
.py", line 325, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File “/usr/lib/python3.5/ssl.py”, line 385, in wrap_socket
_context=self)
File “/usr/lib/python3.5/ssl.py”, line 760, in init
self.do_handshake()
File “/usr/lib/python3.5/ssl.py”, line 996, in do_handshake
self._sslobj.do_handshake()
File “/usr/lib/python3.5/ssl.py”, line 641, in do_handshake
self._sslobj.do_handshake()
requests.packages.urllib3.exceptions.ProtocolError: (‘Connection aborted.’, OSError(0, ‘Error’))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py”, line 216, in async_add_entity
yield from entity.async_device_update(warning=False)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py”, line 309, in async_device_update
yield from self.hass.async_add_job(self.update)
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/spotify.py”, line 164, in update
self.refresh_spotify_instance()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/spotify.py”, line 160, in refresh_spotify_instance
self._user = self._player.me()
File “/srv/homeassistant/lib/python3.5/site-packages/spotipy/client.py”, line 568, in me
return self._get(‘me/’)
File “/srv/homeassistant/lib/python3.5/site-packages/spotipy/client.py”, line 148, in _get
return self._internal_call(‘GET’, url, payload, kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/spotipy/client.py”, line 110, in _internal_call
r = self._session.request(method, url, headers=headers, proxies=self.proxies, **args)
File “/srv/homeassistant/lib/python3.5/site-packages/requests/sessions.py”, line 518, in request
resp = self.send(prep, **send_kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/requests/sessions.py”, line 639, in send
r = adapter.send(request, **kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/requests/adapters.py”, line 488, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: (‘Connection aborted.’, OSError(0, ‘Error’))
2017-10-29 08:54:33 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.5/asyncio/tasks.py”, line 241, in _step
result = coro.throw(exc)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py”, line 1026, in _event_to_service_call
yield from service_handler.func(service_call)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/init.py”, line 282, in async_handle_light_service
yield from light.async_turn_off(**params)
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/xiaomi_aqara.py”, line 103, in turn_off
if self._write_to_hub(self._sid, **{self._data_key: 0}):
File “/srv/homeassistant/lib/python3.5/site-packages/PyXiaomiGateway/init.py”, line 290, in write_to_hub
data[‘key’] = self._get_key()
File “/srv/homeassistant/lib/python3.5/site-packages/PyXiaomiGateway/init.py”, line 320, in _get_key
encryptor = AES.new(self.key.encode(), AES.MODE_CBC, IV=init_vector)
File “/srv/homeassistant/lib/python3.5/site-packages/Crypto/Cipher/AES.py”, line 95, in new
return AESCipher(key, *args, **kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/Crypto/Cipher/AES.py”, line 59, in init
blockalgo.BlockAlgo.init(self, _AES, key, *args, **kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/Crypto/Cipher/blockalgo.py”, line 141, in init
self._cipher = factory.new(key, *args, **kwargs)
ValueError: Key cannot be the null string
2017-10-29 08:54:43 ERROR (Thread-7) [homeassistant.components.sensor.command_line] Command failed: ./home/homeassistant/.homeassistant/check_db_size.sh
2017-10-29 08:55:44 ERROR (Thread-12) [homeassistant.components.sensor.command_line] Command failed: ./home/homeassistant/.homeassistant/check_db_size.sh
2017-10-29 08:56:27 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.5/asyncio/tasks.py”, line 241, in _step
result = coro.throw(exc)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py”, line 1026, in _event_to_service_call
yield from service_handler.func(service_call)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/init.py”, line 280, in async_handle_light_service
yield from light.async_turn_on(**params)
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/xiaomi_aqara.py”, line 98, in turn_on
if self._write_to_hub(self._sid, **{self._data_key: rgbhex}):
File “/srv/homeassistant/lib/python3.5/site-packages/PyXiaomiGateway/init.py”, line 290, in write_to_hub
data[‘key’] = self._get_key()
File “/srv/homeassistant/lib/python3.5/site-packages/PyXiaomiGateway/init.py”, line 320, in _get_key
encryptor = AES.new(self.key.encode(), AES.MODE_CBC, IV=init_vector)
File “/srv/homeassistant/lib/python3.5/site-packages/Crypto/Cipher/AES.py”, line 95, in new
return AESCipher(key, *args, **kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/Crypto/Cipher/AES.py”, line 59, in init
blockalgo.BlockAlgo.init(self, _AES, key, *args, **kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/Crypto/Cipher/blockalgo.py”, line 141, in init
self._cipher = factory.new(key, *args, **kwargs)
ValueError: Key cannot be the null string
2017-10-29 08:56:45 ERROR (Thread-18) [homeassistant.components.sensor.command_line] Command failed: ./home/homeassistant/.homeassistant/check_db_size.sh
2017-10-29 08:56:47 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_protocol.py”, line 435, in start
yield from resp.write_eof()
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_response.py”, line 583, in write_eof
yield from super().write_eof(body)
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_response.py”, line 420, in write_eof
yield from self._payload_writer.write_eof(data)
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/http_writer.py”, line 282, in write_eof
yield from self.drain(True)
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/http_writer.py”, line 295, in drain
yield from self._stream.drain()
File “/srv/homeassistant/lib/python3.5/site-packages/aiohttp/http_writer.py”, line 128, in drain
yield from self._protocol._drain_helper()
File “/usr/lib/python3.5/asyncio/streams.py”, line 211, in _drain_helper
yield from waiter
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
concurrent.futures._base.CancelledError

Can someone please help me with this?

Thank you in advance

Tried to update-upgrade using this steps:

https://home-assistant.io/docs/installation/hassbian/upgrading/

I receive error when trying to:

(homeassistant) homeassistant@hassbian:/home/pi $ pip3 install --upgrade homeassistant

Exception:
Traceback (most recent call last):
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py”, line 594, in urlopen
chunked=chunked)
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py”, line 350, in _make_request
self._validate_conn(conn)
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py”, line 837, in validate_conn
conn.connect()
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py”, line 323, in connect
ssl_context=context)
File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/ssl
.py", line 324, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File “/usr/lib/python3.5/ssl.py”, line 385, in wrap_socket
_context=self)
File “/usr/lib/python3.5/ssl.py”, line 760, in init
self.do_handshake()
File “/usr/lib/python3.5/ssl.py”, line 996, in do_handshake
self._sslobj.do_handshake()
File “/usr/lib/python3.5/ssl.py”, line 641, in do_handshake
self._sslobj.do_handshake()
OSError: [Errno 0] Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/commands/install.py”, line 353, in run
wb.build(autobuilding=True)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/wheel.py”, line 749, in build
self.requirement_set.prepare_files(self.finder)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py”, line 487, in _prepare_file
req_to_install, finder)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py”, line 428, in _check_skip_installed
req_to_install, upgrade_allowed)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 568, in _get_pages
page = self._get_page(location)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/index.py”, line 792, in get_page
“Cache-Control”: “max-age=600”,
File “/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py”, line 501, in get
return self.request(‘GET’, url, **kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/pip/download.py”, line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File “/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py”, line 488, in request
resp = self.send(prep, **send_kwargs)
File “/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py”, line 609, in send
r = adapter.send(request, **kwargs)
File “/srv/homeassistant/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py”, line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File “/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py”, line 423, in send
timeout=timeout
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py”, line 643, in urlopen
_stacktrace=sys.exc_info()[2])
File “/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py”, line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: ‘Retry’ and ‘int’