Somehow my installation is broken. Even if I restore from latest backup and restart it works once but on the subsequent restart this happens. Any clues?
Home Assistant release (hass --version
):
0.40.1
Python release (python3 --version
):
3.5.2+
Component/platform:
Expected:
it works
I don't understand this. Aiohttp is there?
(homeassistant_venv) homeassistant@tower:/srv/homeassistant/homeassistant_venv$ pip3 install aiohttp
Requirement already satisfied: aiohttp in ./lib/python3.5/site-packages
Requirement already satisfied: yarl<0.10,>=0.9.8 in ./lib/python3.5/site-packages (from aiohttp)
Requirement already satisfied: async-timeout>=1.1.0 in ./lib/python3.5/site-packages (from aiohttp)
Requirement already satisfied: chardet in ./lib/python3.5/site-packages (from aiohttp)
Requirement already satisfied: multidict>=2.1.4 in ./lib/python3.5/site-packages (from aiohttp)
**Traceback (if applicable):**
Mar 20 22:51:24 tower systemd[1]: Started Home Assistant. Mar 20 22:51:25 tower hass[4438]: INFO:homeassistant.core:Bus:HandlingMar 20 22:51:25 tower hass[4438]: INFO:homeassistant.core:Bus:Handling Mar 20 22:51:25 tower hass[4438]: INFO:homeassistant.core:Bus:Handling Mar 20 22:51:25 tower hass[4438]: INFO:homeassistant.core:Bus:Handling Mar 20 22:51:25 tower hass[4438]: INFO:homeassistant.core:Bus:Handling Mar 20 22:51:25 tower hass[4438]: INFO:homeassistant.core:Bus:Handling Mar 20 22:51:25 tower hass[4438]: INFO:homeassistant.core:Bus:Handling Mar 20 22:51:25 tower hass[4438]: INFO:homeassistant.core:Bus:Handling Mar 20 22:51:25 tower hass[4438]: INFO:homeassistant.bootstrap:Home Assistant core initialized Mar 20 22:51:25 tower hass[4438]: INFO:homeassistant.loader:Loaded mqtt from homeassistant.components.mqtt Mar 20 22:51:26 tower hass[4438]: INFO:homeassistant.loader:Loaded logger from homeassistant.components.logger Mar 20 22:51:26 tower hass[4438]: INFO:homeassistant.setup:Setting up logger Mar 20 22:51:26 tower hass[4438]: WARNING:homeassistant.components.recorder:Ended unfinished session (id=122 from 2017-03-20 21:46:50) Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.loader:Error loading homeassistant.components.automation. Make sure all dependencies are installed Mar 20 22:51:26 tower hass[4438]: Traceback (most recent call last): Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/loader.py", line 141, in get_component Mar 20 22:51:26 tower hass[4438]: module = importlib.import_module(path) Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/importlib/__init__.py", line 126, in import_module Mar 20 22:51:26 tower hass[4438]: return _bootstrap._gcd_import(name[level:], package, level) Mar 20 22:51:26 tower hass[4438]: File " ", line 986, in _gcd_import Mar 20 22:51:26 tower hass[4438]: File " ", line 969, in _find_and_load Mar 20 22:51:26 tower hass[4438]: File " ", line 958, in _find_and_load_unlocked Mar 20 22:51:26 tower hass[4438]: File " ", line 673, in _load_unlocked Mar 20 22:51:26 tower hass[4438]: File " ", line 673, in exec_module Mar 20 22:51:26 tower hass[4438]: File " ", line 222, in _call_with_frames_removed Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 19, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components import logbook Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/logbook.py", line 18, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components.frontend import register_built_in_panel Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/frontend/__init__.py", line 12, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components import api, group Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/api.py", line 26, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.helpers.state import AsyncTrackStates Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/helpers/state.py", line 8, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components.media_player import ( Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/media_player/__init__.py", line 24, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components.http import HomeAssistantView, KEY_AUTHENTICATED Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/http/__init__.py", line 34, in Mar 20 22:51:26 tower hass[4438]: from .static import FILE_SENDER, CACHING_FILE_SENDER, staticresource_middleware Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/http/static.py", line 6, in Mar 20 22:51:26 tower hass[4438]: from aiohttp.file_sender import FileSender Mar 20 22:51:26 tower hass[4438]: ImportError: No module named 'aiohttp.file_sender' Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.loader:Unable to find component automation Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.setup:Setup failed for automation: Component not found. Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.loader:Error loading homeassistant.components.history. Make sure all dependencies are installed Mar 20 22:51:26 tower hass[4438]: Traceback (most recent call last): Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/loader.py", line 141, in get_component Mar 20 22:51:26 tower hass[4438]: module = importlib.import_module(path) Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/importlib/__init__.py", line 126, in import_module Mar 20 22:51:26 tower hass[4438]: return _bootstrap._gcd_import(name[level:], package, level) Mar 20 22:51:26 tower hass[4438]: File " ", line 986, in _gcd_import Mar 20 22:51:26 tower hass[4438]: File " ", line 969, in _find_and_load Mar 20 22:51:26 tower hass[4438]: File " ", line 958, in _find_and_load_unlocked Mar 20 22:51:26 tower hass[4438]: File " ", line 673, in _load_unlocked Mar 20 22:51:26 tower hass[4438]: File " ", line 673, in exec_module Mar 20 22:51:26 tower hass[4438]: File " ", line 222, in _call_with_frames_removed Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/history.py", line 20, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components.frontend import register_built_in_panel Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/frontend/__init__.py", line 12, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components import api, group Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/api.py", line 26, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.helpers.state import AsyncTrackStates Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/helpers/state.py", line 8, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components.media_player import ( Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/media_player/__init__.py", line 24, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components.http import HomeAssistantView, KEY_AUTHENTICATED Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/http/__init__.py", line 34, in Mar 20 22:51:26 tower hass[4438]: from .static import FILE_SENDER, CACHING_FILE_SENDER, staticresource_middleware Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/http/static.py", line 6, in Mar 20 22:51:26 tower hass[4438]: from aiohttp.file_sender import FileSender Mar 20 22:51:26 tower hass[4438]: ImportError: No module named 'aiohttp.file_sender' Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.loader:Unable to find component history Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.setup:Setup failed for history: Component not found. Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.loader:Error loading homeassistant.components.input_slider. Make sure all dependencies are installed Mar 20 22:51:26 tower hass[4438]: Traceback (most recent call last): Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/loader.py", line 141, in get_component Mar 20 22:51:26 tower hass[4438]: module = importlib.import_module(path) Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/importlib/__init__.py", line 126, in import_module Mar 20 22:51:26 tower hass[4438]: return _bootstrap._gcd_import(name[level:], package, level) Mar 20 22:51:26 tower hass[4438]: File " ", line 986, in _gcd_import Mar 20 22:51:26 tower hass[4438]: File " ", line 969, in _find_and_load Mar 20 22:51:26 tower hass[4438]: File " ", line 958, in _find_and_load_unlocked Mar 20 22:51:26 tower hass[4438]: File " ", line 673, in _load_unlocked Mar 20 22:51:26 tower hass[4438]: File " ", line 673, in exec_module Mar 20 22:51:26 tower hass[4438]: File " ", line 222, in _call_with_frames_removed Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/input_slider.py", line 17, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.helpers.restore_state import async_get_last_state Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 10, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components.history import get_states, last_recorder_run Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/history.py", line 20, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components.frontend import register_built_in_panel Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/frontend/__init__.py", line 12, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components import api, group Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/api.py", line 26, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.helpers.state import AsyncTrackStates Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/helpers/state.py", line 8, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components.media_player import ( Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/media_player/__init__.py", line 24, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components.http import HomeAssistantView, KEY_AUTHENTICATED Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/http/__init__.py", line 34, in Mar 20 22:51:26 tower hass[4438]: from .static import FILE_SENDER, CACHING_FILE_SENDER, staticresource_middleware Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/http/static.py", line 6, in Mar 20 22:51:26 tower hass[4438]: from aiohttp.file_sender import FileSender Mar 20 22:51:26 tower hass[4438]: ImportError: No module named 'aiohttp.file_sender' Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.loader:Unable to find component input_slider Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.setup:Setup failed for input_slider: Component not found. Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.loader:Error loading homeassistant.components.input_boolean. Make sure all dependencies are installed Mar 20 22:51:26 tower hass[4438]: Traceback (most recent call last): Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/loader.py", line 141, in get_component Mar 20 22:51:26 tower hass[4438]: module = importlib.import_module(path) Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/importlib/__init__.py", line 126, in import_module Mar 20 22:51:26 tower hass[4438]: return _bootstrap._gcd_import(name[level:], package, level) Mar 20 22:51:26 tower hass[4438]: File " ", line 986, in _gcd_import Mar 20 22:51:26 tower hass[4438]: File " ", line 969, in _find_and_load Mar 20 22:51:26 tower hass[4438]: File " ", line 958, in _find_and_load_unlocked Mar 20 22:51:26 tower hass[4438]: File " ", line 673, in _load_unlocked Mar 20 22:51:26 tower hass[4438]: File " ", line 673, in exec_module Mar 20 22:51:26 tower hass[4438]: File " ", line 222, in _call_with_frames_removed Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/input_boolean.py", line 18, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.helpers.restore_state import async_get_last_state Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 10, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components.history import get_states, last_recorder_run Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/history.py", line 20, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components.frontend import register_built_in_panel Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/frontend/__init__.py", line 12, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components import api, group Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/api.py", line 26, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.helpers.state import AsyncTrackStates Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/helpers/state.py", line 8, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components.media_player import ( Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/media_player/__init__.py", line 24, in Mar 20 22:51:26 tower hass[4438]: from homeassistant.components.http import HomeAssistantView, KEY_AUTHENTICATED Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/http/__init__.py", line 34, in Mar 20 22:51:26 tower hass[4438]: from .static import FILE_SENDER, CACHING_FILE_SENDER, staticresource_middleware Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/http/static.py", line 6, in Mar 20 22:51:26 tower hass[4438]: from aiohttp.file_sender import FileSender Mar 20 22:51:26 tower hass[4438]: ImportError: No module named 'aiohttp.file_sender' Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.loader:Unable to find component input_boolean Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.setup:Setup failed for input_boolean: Component not found. Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.loader:Error loading homeassistant.components.http. Make sure all dependencies are installed Mar 20 22:51:26 tower hass[4438]: Traceback (most recent call last): Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/loader.py", line 141, in get_component Mar 20 22:51:26 tower hass[4438]: module = importlib.import_module(path) Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/importlib/__init__.py", line 126, in import_module Mar 20 22:51:26 tower hass[4438]: return _bootstrap._gcd_import(name[level:], package, level) Mar 20 22:51:26 tower hass[4438]: File " ", line 986, in _gcd_import Mar 20 22:51:26 tower hass[4438]: File " ", line 969, in _find_and_load Mar 20 22:51:26 tower hass[4438]: File " ", line 958, in _find_and_load_unlocked Mar 20 22:51:26 tower hass[4438]: File " ", line 673, in _load_unlocked Mar 20 22:51:26 tower hass[4438]: File " ", line 673, in exec_module Mar 20 22:51:26 tower hass[4438]: File " ", line 222, in _call_with_frames_removed Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/http/__init__.py", line 34, in Mar 20 22:51:26 tower hass[4438]: from .static import FILE_SENDER, CACHING_FILE_SENDER, staticresource_middleware Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/http/static.py", line 6, in Mar 20 22:51:26 tower hass[4438]: from aiohttp.file_sender import FileSender Mar 20 22:51:26 tower hass[4438]: ImportError: No module named 'aiohttp.file_sender' Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.loader:Unable to find component http Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.setup:Setup failed for http: Component not found. Mar 20 22:51:26 tower hass[4438]: ERROR:homeassistant.loader:Error loading homeassistant.components.sensor.template. Make sure all dependencies are installed Mar 20 22:51:26 tower hass[4438]: Traceback (most recent call last): Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/loader.py", line 141, in get_component Mar 20 22:51:26 tower hass[4438]: module = importlib.import_module(path) Mar 20 22:51:26 tower hass[4438]: File "/srv/homeassistant/homeassistant_venv/lib/python3.5/importlib/__init__.py", line 126, in import_module Mar 20 22:51:26 tower hass[4438]: return _bootstrap._gcd_import(name[level:], package, level) Mar 20 22:51:26 tower hass[4438]: File " ", line 986, in _gcd_import Mar 20 22:51:26
Additional info:
I have the issue and I use hassbian
Same issue here on a native install on Raspian Jessie Lite. First boot is clean, then get the above mentioned errors upon a restart / config-check.
Doing an import from the python console works fine:
(homeassistant_venv) homeassistant@raspberrypi:/home/pi$ python
Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from aiohttp.file_sender import FileSender
>>>
Same with a fresh install from on full Rasbian with the AiO installer. Config with a few configuration options commented out.
17-03-21 01:42:43 WARNING (Thread-4) [netdisco.ssdp] Error fetching description at http://[fe80::21b:21ff:fec4:df3d]:6544/getDeviceDesc
17-03-21 01:42:43 WARNING (Thread-4) [netdisco.ssdp] Error fetching description at http://[fe80::4ecc:6aff:fe08:b63d]:6544/getDeviceDesc
17-03-21 01:42:47 ERROR (MainThread) [homeassistant.loader] Error loading homeassistant.components.media_player. Make sure all dependencies are installed
Traceback (most recent call last):
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/loader.py", line 141, in get_component
module = importlib.import_module(path)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/media_player/__init__.py", line 24, in <module>
from homeassistant.components.http import HomeAssistantView, KEY_AUTHENTICATED
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/http/__init__.py", line 34, in <module>
from .static import FILE_SENDER, CACHING_FILE_SENDER, staticresource_middleware
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/http/static.py", line 6, in <module>
from aiohttp.file_sender import FileSender
ImportError: No module named 'aiohttp.file_sender'
17-03-21 01:42:47 ERROR (MainThread) [homeassistant.loader] Unable to find component media_player
17-03-21 01:42:47 ERROR (MainThread) [homeassistant.setup] Setup failed for media_player: Component not found.
Cheers @jheizer, you just saved me the effort of wiping my install and starting afresh!
I did an uninstall and reinstall of aiohttp (1.3.3) and still the same errors as others have mentioned above.
A little bit more - pip freeze
shows aiohttp==1.3.3
- just for the heck of it I installed aiohttp==2.0.0
which produced the same import error.
They removed file_sender in aiohttp 2.0.0.
https://media.readthedocs.org/pdf/aiohttp/2.0.0/aiohttp.pdf page 26
FileSender api is dropped, it is replaced with more general FileResponse class:
@SR02 oops. That's me being less than helpful, then...
It's all good. Didn't want the other folks falling down that rabbit hole.
anyone found a workaround? Having the same issue, AIO installer updated to .41 via fabric
I'm also experiencing this issue on a raspbian install and found a temporary workaround by downgrading to 0.40.0:
pip3 install homeassistant==0.40.0
However, the issue returns after rebooting. So if you reinstall and then start homeassistant without rebooting, the frontend will load correctly. Rebooting causes the error to return on both 0.40.0 and 0.40.1.
Can confirm same issue with .40.1, tried downgrading to .40.0 issue resolved, but after a reboot issue returns. AIO install. updated via Pip
Adding more info:
Upgraded from .35.2 to .40.1 couple of hours ago. Check config shows this as well.
17-03-20 21:40:39 INFO (Thread-3) [homeassistant.config] Upgrading config directory from 0.40.0 to 0.35.2
Not sure if related or not.
seems like its a python install issue?
From the log:
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/http/static.py", line 6, in <module>
from aiohttp.file_sender import FileSender
So it's using python3.4
executable, not python3
So:
(homeassistant) homeassistant@hassbian:~ $ python3
Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import aiohttp.file_sender
>>> exit()
(homeassistant) homeassistant@hassbian:~ $ python3.4
Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import aiohttp.file_sender
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'aiohttp'
>>>
Edit: I'm not so convinced about this issue anymore, but I don't know enough about setting up virtualenv. I can keep looking into it though.
I'm getting this issue even if I downgrade to 0.39.3. It works the first time then the next startup I get "No module named 'aiohttp.file_sender'" errors.
Good to see I am not the only one. I had some doubts about my sanity last night 😅
How can I get my HA running again?
Output of pip pip freeze
(homeassistant_venv) homeassistant@tower:/srv/homeassistant/homeassistant_venv$ pip freeze
aiohttp==1.3.3
appdirs==1.4.3
async-timeout==1.1.0
attrs==16.3.0
Automat==0.5.0
Babel==2.3.4
chardet==2.3.0
constantly==15.1.0
Cython==0.24.1
Flask==0.10.1
Flask-Babel==0.9
Flask-SocketIO==2.8.5
Flask-Themes==0.1.3
Flask-WTF==0.9.5
gevent==1.1.1
gevent-socketio==0.3.6
gevent-websocket==0.9.5
greenlet==0.4.12
homeassistant==0.40.1
incremental==16.10.1
itsdangerous==0.24
Jinja2==2.9.5
libopenzwave==0.3.2
MarkupSafe==1.0
multidict==2.1.4
mysqlclient==1.3.10
openzwave==0.3.2
packaging==16.8
PyDispatcher==2.0.5
pymodbus3==1.0.0
pyozwman==0.3.2
pyozwweb==0.3.2
pyparsing==2.2.0
pyserial==3.3
python-engineio==1.3.0
python-socketio==1.7.2
pytz==2016.10
PyYAML==3.12
requests==2.13.0
six==1.10.0
speaklater==1.3
Twisted==17.1.0
typing==3.5.3.0
urwid==1.3.1
voluptuous==0.9.3
WebOb==1.7.1
Werkzeug==0.12
WTForms==1.0.5
yarl==0.9.8
zope.interface==4.3.3
And it works from the console
(homeassistant_venv) homeassistant@tower:/srv/homeassistant/homeassistant_venv$ python
Python 3.5.2+ (default, Sep 22 2016, 12:18:14)
[GCC 6.2.0 20160927] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from aiohttp.file_sender import FileSender
>>>
This is weird 🤔
I believe I have a similar but not identical problem. Started troubleshooting mosquitto problems and decided to reboot and run update from 0.40.0 to 0.40.1 - AIO installer been running with constant upgrades since 0.24.
Only changes I'm aware of is those made to config files of Home-assistant.
I rebooted and did not check if Hass started, but mosquitto failed.
Upgrade failed like this:
```(hass_venv) hass@raspberrypi:~/.homeassistant$ pip3 install --upgrade homeassistant
Fatal Python error: Py_Initialize: Unable to get the locale encoding
Traceback (most recent call last):
File "
File "
File "
File "
File "
File "
File "
OSError: [Errno 5] Input/output error: '/srv/hass/hass_venv/lib/python3.4/'
Aborted
The same error happens from console:
```root@raspberrypi:/home/pi# python3.4
Fatal Python error: Py_Initialize: Unable to get the locale encoding
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2222, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 2164, in _find_spec
File "<frozen importlib._bootstrap>", line 1940, in find_spec
File "<frozen importlib._bootstrap>", line 1914, in _get_spec
File "<frozen importlib._bootstrap>", line 2026, in find_spec
File "<frozen importlib._bootstrap>", line 2065, in _fill_cache
OSError: [Errno 5] Input/output error: '/usr/lib/python3.4/'
Aborted
The only thing that alerted me to having som sort of problem was mosquitto misbehavin' and after a reboot, I think more broke.
Mar 21 07:54:07 raspberrypi systemd[1]: PID 1768 read from file /var/run/mosquitto.pid does not exist or is a zombie.
Mar 21 07:54:07 raspberrypi systemd[1]: Unit mosquitto.service entered failed state.
Mar 21 07:54:09 raspberrypi systemd[1]: mosquitto.service holdoff time over, scheduling restart.
Mar 21 07:54:09 raspberrypi systemd[1]: mosquitto.service: main process exited, code=exited, status=1/FAILURE
So. I seem to be stuck with a 0.40.0 that isn't working and cannot be upgraded, nor started :/
Anyone find any temporary solution? I'm frantically trying to get HA back up and running lol. Going back down to 40.0 doesnt seem to work for me yet.
UPDATE: booted my prior config on 40.0.. will avoid restarting as suggested
Duh.. Seems mosquitto filled my log and disk and Hass broke because of that. Back in business, with failing mosquitto. Something else is filling my disk fast, though, strange things going on.
Same issue for me but reinstalling 0.40.0 seems to have fixed it so far. I am just not trying to restart my Pi as some people commented that a restart makes it fail again.
So just curious, it seems that the update to aiohttp is what's causing everyones startups to crash?
Yes. I tried a restart of homeassistant following a config change and now my 0.40.0 fails to load as well with many components failing with the following error:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/homeassistant/loader.py", line 141, in get_component
module = importlib.import_module(path)
File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/tts/__init__.py", line 24, in <module>
from homeassistant.components.http import HomeAssistantView
File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/http/__init__.py", line 34, in <module>
from .static import FILE_SENDER, CACHING_FILE_SENDER, staticresource_middleware
File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/http/static.py", line 6, in <module>
from aiohttp.file_sender import FileSender
ImportError: No module named 'aiohttp.file_sender'
yup, exactly that. "ImportError: No module named 'aiohttp.file_sender' i wonder how many peoples systems are down because of this
Same issue here. Signed up just to reply to this
ok I'm up and running on version 38. nothing above that worked for me. staying on this until further notice
Hassbian install on Pi 2.
Same issue. I can pip3 install homeassistant==0.XX.X
0.40 or 0.40.1 and the first startup will work but a subsequent restart will fail.
Components fail to load, and in the traceback for each of them: ImportError: No module named 'aiohttp.file_sender'
Same issue here.
Cleaning the .homeassistant/deps folder makes it work again, once.
Hi,
Just replying to say I have the same issue. Did a fresh Hassbian 1.1 install and the issue is still occurring.
Cleaning the .homeassistnat/deps
directory and restarting the service will successfully boot. Any further reboots or check_config's wont however and throw the error:
17-03-21 10:43:19 ERROR (MainThread) [homeassistant.loader] Error loading homeassistant.components.frontend. Make sure all dependencies are installed
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/loader.py", line 141, in get_component
module = importlib.import_module(path)
File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/frontend/__init__.py", line 12, in <module>
from homeassistant.components import api, group
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/api.py", line 26, in <module>
from homeassistant.helpers.state import AsyncTrackStates
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/state.py", line 8, in <module>
from homeassistant.components.media_player import (
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/media_player/__init__.py", line 24, in <module>
from homeassistant.components.http import HomeAssistantView, KEY_AUTHENTICATED
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/http/__init__.py", line 34, in <module>
from .static import FILE_SENDER, CACHING_FILE_SENDER, staticresource_middleware
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/http/static.py", line 6, in <module>
from aiohttp.file_sender import FileSender
ImportError: No module named 'aiohttp.file_sender'
17-03-21 10:43:19 ERROR (MainThread) [homeassistant.loader] Unable to find component frontend
17-03-21 10:43:19 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: Component not found.
I'd guess this is related to @SR02 's comment regarding file_sender
being removed in aiohttp 2.0.0? This is the latest version that gets pulled down into the /deps
direcory
Temporary workaround:
Hi,
this is what I found so far. For some reason in the deps directory aiohttp==2.0 is installed (this could be because some other package has changed its own requirement?).
The temporary fix that is working for me is to do:
pip install --upgrade aiohttp==1.3.3 -t homeassistant/deps/
Please notice that I am not using the default configuration dir .homeassistant, but homeassistant.
Francesco
hello, im facing the same issue. Home assistant developers are Aware of this? is someone working to fix it?
@ashfaaaa this is open source software. Feel free to contribute 😎
I can imagine that they have their day job and someone will take care of it tonight. Workaround already has been posted above.
@francescocam Thanks for the workaround!
Is this easy to revert when a fix comes down the line? I'd like to avoid having to do another reinstall if possible 🙈
This can be reverted by cleaning the deps folder and restarting HA.
Thanks @nodomain
I'm assuming this command is run with the homeassistant user?
@ragebflame
yes
If you're using the Raspberry Pi All-In-One Installer, here's the command set:
_Note: This will survive restarts! Woohoo!_
$ sudo su -s /bin/bash homeassistant
$ cd /home/homeassistant/.homeassistant/deps/
$ pip3 install --upgrade aiohttp==1.3.3 -t .
Then restart the service, however you do. For me:
$ sudo systemctl restart home-assistant.service
My thanks to @francescocam and @mgejke for getting me running again :)
Hi,
Just tried the above workarounds and they have not worked.
Pip freeze:
(homeassistant) homeassistant@hassbian:~/.homeassistant $ pip freeze
aiohttp==1.3.3
appdirs==1.4.3
async-timeout==1.1.0
chardet==2.3.0
hassbian==0.1
homeassistant==0.40.1
Jinja2==2.9.5
MarkupSafe==1.0
multidict==2.1.4
packaging==16.8
pyparsing==2.2.0
pytz==2016.10
PyYAML==3.12
requests==2.13.0
six==1.10.0
typing==3.5.3.0
voluptuous==0.9.3
yarl==0.9.8
Getting the same error when trying to launch or check config:
ImportError: No module named 'aiohttp.file_sender'
Did you do it in HA's virtualenv? I need to test, but if you're on latest Hassbian, perhaps this will work:
sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
pip3 install --upgrade aiohttp==1.3.3
edit
Tried doing this myself (clear deps, downgrade to 0.40, upgrade to 0.40.1, aiohttp==1.3.3) and it only works first restart. In order to keep Hass working I have to do rm -r aiohttp*
in the deps folder.
I'm running the Hassbian 1.1 image.
Commands run:
sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
pip install --upgrade aiohttp==1.3.3 -t homeassistant/deps/
I also tried with @themartorana workaround:
sudo su -s /bin/bash homeassistant
cd /home/homeassistant/.homeassistant/deps/
pip3 install --upgrade aiohttp==1.3.3 -t .
im seeing the same issue as ragebflame
any ideas?
thanks
I noticed that even pip3 freeze shows aiohttp==1.3.3 there is folder called aiohttp-2.0.0.dist-info in the .homeassistant/deps/ folder. After manually running pip3 install --upgrade aiohttp==1.3.3 -t . in the .homeassistant/deps/ folder homeassistant==0.40.1 is working fully again.
Ah yes, @tinppaviiva 's command has worked for me now:
sudo su -s /bin/bash homeassistant
cd /home/homeassistant/.homeassistant/deps/
pip3 install --upgrade aiohttp==1.3.3 -t .
hass --check_config
Not sure why this didn't complete the first time around.
can confirm workaround works with a fresh 0.40.0 install
if only I had known this yesterday.
This solution works for me too. I also used source
before the pip command.
Unfortunately problem returns after restart, aiohttp-2.0 returns. I'm not a coder, anyway to stop the forced upgrade during start?
@ForSquirel are you just clearing out the deps folder, or running the pip3 --upgrade
command? For me, pushing the update into the deps folder (and not just deleting the contents of the deps folder) survives restarts.
@ForSquirel, you need to apply the commands above.
A fresh install will work on first startup. Now stop the service.
sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
cd /home/homeassistant/.homeassistant/deps/
rm -r aiohttp-2*
(just in case)
pip3 install --upgrade aiohttp==1.3.3 -t .
Now it should start up correctly. In the deps folder you should see the aiohttp-1.3.3 folder. Not version 2.
no matter what I do, version 2 returns on restart
edit: It's working now without adding version 2 back
Doesn't seem to matter what I do at this point, it always starts and throws up with.
ModuleNotFoundError: No module named 'aiohttp.file_sender'
This is on 2 separate Hassbian installs.
@chimpy, your commands worked perfectly for me as well. I did clear out the old version 2 aiohttp first and then installed it with Pip. restart and back in business.
Thanks!
Edited to include rm'ing version 2 if it exists.
Hi,
i'm having same issues as desribed with aiohttp. HA stopped boot . I´ve downloaded a fresh image HASS1.1 and not getting the myip:8123.
Any image with the aiohttp issue sorted out ?
'm getting always errors like this :
(homeassistant) homeassistant@hassbian:/home/pi $ pip install --upgrade aiohttp==1.3.3 -t homeassistant/deps/
Downloading/unpacking aiohttp==1.3.3
Cannot fetch index base URL https://pypi.python.org/simple/
the outcome of @themartorana suggestion
`pi@RP2:~ $ curl -v -I https://pypi.python.org/simple/
- Hostname was NOT found in DNS cache
- Trying 2a04:4e42:4::223...
- Connected to pypi.python.org (2a04:4e42:4::223) port 443 (#0)
- successfully set certificate verify locations:
- CAfile: none
CApath: /etc/ssl/certs- SSLv3, TLS handshake, Client hello (1):
- SSLv3, TLS handshake, Server hello (2):
- SSLv3, TLS handshake, CERT (11):
- SSLv3, TLS handshake, Server key exchange (12):
- SSLv3, TLS handshake, Server finished (14):
- SSLv3, TLS handshake, Client key exchange (16):
- SSLv3, TLS change cipher, Client hello (1):
- SSLv3, TLS handshake, Finished (20):
- Unknown SSL protocol error in connection to pypi.python.org:443
- Closing connection 0
curl: (35) Unknown SSL protocol error in connection to pypi.python.org:443
`
@migromao try doing a
curl -v -I https://pypi.python.org/simple/
It sounds like your PI is unable to reach the Python package index at all. This will show you if you can successfully connect to the site or not.
I have the same problem. I tried the workaround but even after downgrading successfully I'm getting the same error.
Hi.
I can reach it . I ping even google and im connectec via ssl console on my home lan
Same problem here. Cleaning the deps folder works once.
hi ,
my packages installed on the homeassistant env
homeassistant@RP2:~/.homeassistant/deps $ pip3 list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
aiohttp (1.3.3)
aiohttp-cors (0.5.0)
appdirs (1.4.2)
astral (1.3.4)
async-timeout (1.1.0)
chardet (2.3.0)
colorama (0.3.2)
colorlog (2.10.0)
enum-compat (0.0.2)
gTTS (1.1.8)
gTTS-token (1.1.1)
homeassistant (0.39.3)
html5lib (0.999)
Jinja2 (2.9.5)
jsonrpc-async (0.4)
jsonrpc-base (1.0)
MarkupSafe (0.23)
multidict (2.1.4)
netdisco (0.9.2)
netifaces (0.10.5)
packaging (16.8)
paho-mqtt (1.2)
pip (9.0.1)
pyowm (2.6.1)
pyparsing (2.1.10)
python-apt (0.9.3.12)
python-vlc (1.1.2)
pytz (2016.10)
PyYAML (3.12)
requests (2.13.0)
rpi-rf (0.9.6)
RPi.GPIO (0.6.3)
setuptools (34.3.1)
six (1.10.0)
typing (3.5.3.0)
unattended-upgrades (0.1)
update (0.4.4)
urllib3 (1.9.1)
voluptuous (0.9.3)
wheel (0.24.0)
wiringpi (2.32.1)
yarl (0.9.8)
zeroconf (0.17.6)
for the HASS version is
homeassistant@RP2:~/.homeassistant/deps $ hass --version
0.39.3
still getting same errors despite suggestions ,
`pi@RP2:~ $ sudo service home-assistant@homeassistant status
● [email protected] - Home Assistant for homeassistant
Loaded: loaded (/etc/systemd/system/[email protected]; enabled)
Active: active (running) since Tue 2017-03-21 01:27:42 UTC; 19h ago
Main PID: 875 (hass)
CGroup: /system.slice/system-home\x2dassistant.slice/[email protected]
└─875 /srv/homeassistant/bin/python3 /srv/homeassistant/bin/hass
Mar 21 21:01:12 RP2 hass[875]: 17-03-21 21:01:12 INFO (MainThread) [homeassis...
Mar 21 21:01:12 RP2 hass[875]: 17-03-21 21:01:12 INFO (MainThread) [homeassis...
Mar 21 21:01:30 RP2 hass[875]: 17-03-21 21:01:30 INFO (MainThread) [homeass...0.
Mar 21 21:01:41 RP2 hass[875]: ping: unknown host None
Mar 21 21:01:43 RP2 hass[875]: 17-03-21 21:01:43 INFO (MainThread) [homeassis...
Mar 21 21:02:12 RP2 hass[875]: ping: unknown host None
Mar 21 21:02:14 RP2 hass[875]: 17-03-21 21:02:14 INFO (MainThread) [homeassis...
Mar 21 21:02:30 RP2 hass[875]: 17-03-21 21:02:30 INFO (MainThread) [homeass...0.
Mar 21 21:02:43 RP2 hass[875]: ping: unknown host None
Mar 21 21:02:45 RP2 hass[875]: 17-03-21 21:02:45 INFO (MainThread) [homeassis...
Hint: Some lines were ellipsized, use -l to show in full.
`
:(
Hi, i've experienced the same issue on ubuntu 16.04. Rolling back to 0.40.0 seems to fix the check config script
Same here on a fresh install of hassbian on PI3. version 0.40.1
The problem is that Home Assistant currently does not handle the case where a dependency depends on a core dependency of Home Assistant.
In this case it's caused by the AppleTV dependency pyatv depending on aiohttp. Aiohttp just released a new version with breaking changes for Home Assistant, causing Home Assistant to fail to start after the first time it installs AppleTV.
I just had a fresh install of hassbian image and i got all the errors withoult any components.
Thanks for all the grate work you are doing.
Are you sure it is due to pyatv? I don't use that at all so I suspect another component. How can I find out?
I'm also having this error since upgrade to 0.40.1 on standard debian
I use:
Vera
Hue
emulated hue
mqtt
bluetooth tracker
I also have hue and mqtt. Perhaps it is one of these?
I don't think so, just commented out my config except frontend and http - still same problem. Now before any restart I'm switching between 0.40.1 and 0.40.0 or back:)
sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
cd /home/homeassistant/.homeassistant/deps/
rm -r aiohttp-2* (just in case)
pip3 install --upgrade aiohttp==1.3.3 -t .
Worked for me on latest Hassbian. Thanks @chimpy !
--Edit
Seems this does not survive a reboot. Will try not to do that until a fix is released!
Same issue here :-( upgraded this morning to 40.1 and can't get it started anymore.
The workarounds above have only temporarily effect until the next restart.... rolling back to 0.39.3
edit:
well disappointment as under 0.39 after the first start it also installs aiohttp-2.0.1.dist-info and subsequent starts fail....
finally uninstalling and installing HASS 0.39.2 got it working again
Hi,
i've got the same issue tonight after i've done some system updates and backup.
After reboot, the ImportError: No module named 'aiohttp.file_sender' message in log.
I checked my /home/homeassistant/.homeassistant/ permissions with
ImportError: No module named 'aiohttp.file_sender'
ls -l
Here was my deps directory permissions
drw-r--r-- 60 homeassistant homeassistant 4096 mai 10 18:51 deps
I run
sudo chmod -R 755 deps
After reboot(s), homeassistant worked again.
My aiohttp version is 2.0.7
Most helpful comment
If you're using the Raspberry Pi All-In-One Installer, here's the command set:
_Note: This will survive restarts! Woohoo!_
Then restart the service, however you do. For me:
$ sudo systemctl restart home-assistant.service
My thanks to @francescocam and @mgejke for getting me running again :)