Home Assistant broken after last upgrade

I upgrade HA as usual. In /home/Homeassistant/homeassistant-upgrade.sh
This time after upgrade everything looks OK but after reboot I have 404 error.
Dietpi-services shows service is OK.
For long time I have info to upgrade pip but I cannot do this and ignore that notification. Meybe that is reason?

I have log here:
https://www.toptal.com/developers/hastebin/ayewelisoc.yaml

Regards.

Which hardware do you use?

Did /home/Homeassistant/homeassistant-upgrade.sh produce any output?

And can you show the output of:

journalctl -u home-assistant

HI, thanks for answer.

I use Dietpi on miniPC x64 intel.

dietpi@DietPi:/home/homeassistant$ ./homeassistant-update.sh 
WARNING: Ignoring invalid distribution -ip (/home/homeassistant/.pyenv/versions/3.9.7/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -ip (/home/homeassistant/.pyenv/versions/3.9.7/lib/python3.9/site-packages)
Requirement already satisfied: homeassistant in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (2022.4.0)
Requirement already satisfied: python-slugify==4.0.1 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (4.0.1)
Requirement already satisfied: async-timeout==4.0.2 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (4.0.2)
Requirement already satisfied: voluptuous-serialize==2.5.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (2.5.0)
Requirement already satisfied: voluptuous==0.12.2 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (0.12.2)
Requirement already satisfied: cryptography==35.0.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (35.0.0)
Requirement already satisfied: bcrypt==3.1.7 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (3.1.7)
Requirement already satisfied: astral==2.2 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (2.2)
Requirement already satisfied: yarl==1.7.2 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (1.7.2)
Requirement already satisfied: pip<22.1,>=21.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (22.0.4)
Requirement already satisfied: PyJWT==2.3.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (2.3.0)
Requirement already satisfied: jinja2==3.1.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (3.1.0)
Requirement already satisfied: certifi>=2021.5.30 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (2021.10.8)
Requirement already satisfied: httpx==0.22.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (0.22.0)
Requirement already satisfied: pyyaml==6.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (6.0)
Requirement already satisfied: ifaddr==0.1.7 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (0.1.7)
Requirement already satisfied: aiohttp==3.8.1 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (3.8.1)
Requirement already satisfied: atomicwrites==1.4.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (1.4.0)
Requirement already satisfied: awesomeversion==22.2.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (22.2.0)
Requirement already satisfied: ciso8601==2.2.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (2.2.0)
Requirement already satisfied: requests==2.27.1 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (2.27.1)
Requirement already satisfied: typing-extensions<5.0,>=3.10.0.2 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (3.10.0.2)
Requirement already satisfied: attrs==21.2.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from homeassistant) (21.2.0)
Requirement already satisfied: multidict<7.0,>=4.5 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from aiohttp==3.8.1->homeassistant) (5.2.0)
Requirement already satisfied: frozenlist>=1.1.1 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from aiohttp==3.8.1->homeassistant) (1.2.0)
Requirement already satisfied: charset-normalizer<3.0,>=2.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from aiohttp==3.8.1->homeassistant) (2.0.7)
Requirement already satisfied: aiosignal>=1.1.2 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from aiohttp==3.8.1->homeassistant) (1.2.0)
Requirement already satisfied: pytz in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from astral==2.2->homeassistant) (2021.3)
Requirement already satisfied: cffi>=1.1 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from bcrypt==3.1.7->homeassistant) (1.15.0)
Requirement already satisfied: six>=1.4.1 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from bcrypt==3.1.7->homeassistant) (1.16.0)
Requirement already satisfied: httpcore<0.15.0,>=0.14.5 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from httpx==0.22.0->homeassistant) (0.14.7)
Requirement already satisfied: rfc3986[idna2008]<2,>=1.3 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from httpx==0.22.0->homeassistant) (1.5.0)
Requirement already satisfied: sniffio in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from httpx==0.22.0->homeassistant) (1.2.0)
Requirement already satisfied: MarkupSafe>=2.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from jinja2==3.1.0->homeassistant) (2.0.1)
Requirement already satisfied: text-unidecode>=1.3 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from python-slugify==4.0.1->homeassistant) (1.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from requests==2.27.1->homeassistant) (1.26.7)
Requirement already satisfied: idna<4,>=2.5 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from requests==2.27.1->homeassistant) (3.3)
Requirement already satisfied: pycparser in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from cffi>=1.1->bcrypt==3.1.7->homeassistant) (2.20)
Requirement already satisfied: h11<0.13,>=0.11 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from httpcore<0.15.0,>=0.14.5->httpx==0.22.0->homeassistant) (0.12.0)
Requirement already satisfied: anyio==3.* in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from httpcore<0.15.0,>=0.14.5->httpx==0.22.0->homeassistant) (3.3.4)
WARNING: Ignoring invalid distribution -ip (/home/homeassistant/.pyenv/versions/3.9.7/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -ip (/home/homeassistant/.pyenv/versions/3.9.7/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -ip (/home/homeassistant/.pyenv/versions/3.9.7/lib/python3.9/site-packages)

journalctl is very long and I most is the same I put link in first post.

t.on': {'siid': 6, 'piid': 6}, 'alarm': {'siid': 5, 'piid': 1}, 'filter.filter_life_level': {'siid': 4, 'piid': 3}, 'filter.filter_used_time': {'siid': 4, 'piid': 5}, 'environment.pm2_5_density': {'siid': 3, 'piid': 6}, 'environment.relative_humidity': {'siid': 3, 'piid': 7}, 'environment.temperature': {'siid': 3, 'piid': 8}}, max_properties: 8/23
kwi 07 20:56:12 DietPi homeassistant[21483]: 2022-04-07 20:56:12 ERROR (MainThread) [meross_iot.controller.device] Error occurred while firing push notification event Namespace.HUB_MTS100_TEMPERATURE with data: {'room': 225, 'id': '0100A738'}
kwi 07 20:56:12 DietPi homeassistant[21483]: Traceback (most recent call last):
kwi 07 20:56:12 DietPi homeassistant[21483]:   File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.9/site-packages/meross_iot/controller/device.py", line 126, in _fire_push_notification_event
kwi 07 20:56:12 DietPi homeassistant[21483]:     await c(namespace=namespace, data=data, device_internal_id=device_internal_id)
kwi 07 20:56:12 DietPi homeassistant[21483]:   File "/mnt/dietpi_userdata/homeassistant/custom_components/meross_cloud/__init__.py", line 305, in _async_push_notification_received
kwi 07 20:56:12 DietPi homeassistant[21483]:     self.async_schedule_update_ha_state(force_refresh=full_update)
kwi 07 20:56:12 DietPi homeassistant[21483]:   File "/home/homeassistant/.pyenv/versions/3.9.7/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 710, in async_schedule_update_ha_state
kwi 07 20:56:12 DietPi homeassistant[21483]:     self.async_write_ha_state()
kwi 07 20:56:12 DietPi homeassistant[21483]:   File "/home/homeassistant/.pyenv/versions/3.9.7/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
kwi 07 20:56:12 DietPi homeassistant[21483]:     self._async_write_ha_state()
kwi 07 20:56:12 DietPi homeassistant[21483]:   File "/home/homeassistant/.pyenv/versions/3.9.7/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 570, in _async_write_ha_state
kwi 07 20:56:12 DietPi homeassistant[21483]:     state = self._stringify_state(available)
kwi 07 20:56:12 DietPi homeassistant[21483]:   File "/home/homeassistant/.pyenv/versions/3.9.7/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 538, in _stringify_state
kwi 07 20:56:12 DietPi homeassistant[21483]:     if (state := self.state) is None:
kwi 07 20:56:12 DietPi homeassistant[21483]:   File "/home/homeassistant/.pyenv/versions/3.9.7/lib/python3.9/site-packages/homeassistant/components/sensor/__init__.py", line 454, in state
kwi 07 20:56:12 DietPi homeassistant[21483]:     assert native_unit_of_measurement
kwi 07 20:56:12 DietPi homeassistant[21483]: AssertionError
kwi 07 20:56:22 DietPi homeassistant[21483]: 2022-04-07 20:56:22 ERROR (MainThread) [custom_components.xiaomi_miot.fan] Mi Air Purifier 3/3H(zhimi.airpurifier.mb3): Got MiioException while fetching the state: Unable to discover the device 192.168.0.16, mapping: {'air_purifier.fault': {'siid': 2, 'piid': 1}, 'air_purifier.on': {'siid': 2, 'piid': 2}, 'air_purifier.fan_level': {'siid': 2, 'piid': 4}, 'air_purifier.mode': {'siid': 2, 'piid': 5}, 'aqi.purify_volume': {'siid': 13, 'piid': 1}, 'aqi.average_aqi': {'siid': 13, 'piid': 2}, 'aqi.average_aqi_cnt': {'siid': 13, 'piid': 3}, 'aqi.aqi_zone': {'siid': 13, 'piid': 4}, 'aqi.sensor_state': {'siid': 13, 'piid': 5}, 'aqi.aqi_goodh': {'siid': 13, 'piid': 6}, 'aqi.aqi_runstate': {'siid': 13, 'piid': 7}, 'aqi.aqi_state': {'siid': 13, 'piid': 8}, 'aqi.aqi_updata_heartbeat': {'siid': 13, 'piid': 9}, 'filter_time.filter_max_time': {'siid': 9, 'piid': 1}, 'physical_controls_locked': {'siid': 7, 'piid': 1}, 'indicator_light.brightness': {'siid': 6, 'piid': 1}, 'indicator_light.on': {'siid': 6, 'piid': 6}, 'alarm': {'siid': 5, 'piid': 1}, 'filter.filter_life_level': {'siid': 4, 'piid': 3}, 'filter.filter_used_time': {'siid': 4, 'piid': 5}, 'environment.pm2_5_density': {'siid': 3, 'piid': 6}, 'environment.relative_humidity': {'siid': 3, 'piid': 7}, 'environment.temperature': {'siid': 3, 'piid': 8}}, max_properties: 8/23

I enter pyenv and upgrade pip but that not help.
Regards.

Just if it helps, for me on Odroid HC4, HA is working fine, updated correctly yesterday.

I restore backup and it’s OK now, but ask also on HA discord channel and many users have problem with that last upgrade.
Regards

was there any solution provided by HA guys? Maybe we will have more users running into same issue.

It seems the Mi Air Purifier integration is buggy, not providing the correct temperature unit through the sensor or so. But I don’t know how to properly disable this integration without the HA GUI.

The “Ignoring invalid distribution -ip” warnings do not break HA, but they are interesting as well, and I do not understand them.

Just to rule it out, could you try to reinstall HA to have the pyenv environment re-created from scratch with recent version? As always, this takes a while due to Python compiling:

dietpi-software reinstall 157

Hi Joulinar unfortunately no one help there. I will try on Facebook ha page.
Regards.

yeah the people at HA forum are more ready to troll you then help… I was even trolled by one of their idiotic mods that was almost able to read.

I hope you do not thing same on use supporting you on this forum :sunglasses:

Not that it really matters what I think cuz I’m a random dumb person but I think you guys are cool and very helpful. :slight_smile:

Hi Joulinar do You know how to upgrade that pip?

dietpi@DietPi:/home/homeassistant$ /home/homeassistant/.pyenv/versions/3.9.7/bin/python3.9 -m pip install --upgrade pip
Defaulting to user installation because normal site-packages is not writeable
WARNING: Ignoring invalid distribution -ip (/home/homeassistant/.pyenv/versions/3.9.7/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -ip (/home/homeassistant/.pyenv/versions/3.9.7/lib/python3.9/site-packages)
Requirement already satisfied: pip in /home/dietpi/.local/lib/python3.9/site-packages (22.0.4)
WARNING: Ignoring invalid distribution -ip (/home/homeassistant/.pyenv/versions/3.9.7/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -ip (/home/homeassistant/.pyenv/versions/3.9.7/lib/python3.9/site-packages)
dietpi@DietPi:/home/homeassistant$

did you tried to activate the pip environment for HA user as described on our online docs

sudo -u homeassistant bash
. /home/homeassistant/pyenv-activate.sh

https://dietpi.com/docs/software/home_automation/#home-assistant

Yes, I try and have successfully installed pip 22.0.4 but that don’t help.

Everything looks OK now but I think it’s missing some deps. I don’t know how to install them.

dietpi@DietPi:/$ sudo systemctl status home-assistant.service
● home-assistant.service - Home Assistant (DietPi)
     Loaded: loaded (/etc/systemd/system/home-assistant.service; disabled; vendor preset: enabled)
     Active: active (running) since Thu 2022-04-14 18:06:25 CEST; 41s ago
   Main PID: 11572 (hass)
      Tasks: 21 (limit: 9354)
     Memory: 124.3M
        CPU: 10.185s
     CGroup: /system.slice/home-assistant.service
             └─11572 /home/homeassistant/.pyenv/versions/3.9.7/bin/python3.9 /home/homeassistant/.pyenv/versions/3.9.7/bin/hass -c /mnt/dietpi_userdata/homeassistant

kwi 14 18:06:41 DietPi homeassistant[11572]: 2022-04-14 18:06:41 WARNING (MainThread) [custom_components.xiaomi_miot.climate] climate.zhimi_mb3_906e_air_purifier has been deprecated and will be removed in a future version. Please use fan.zhimi_mb3_906e_air_purifier.
kwi 14 18:06:41 DietPi homeassistant[11572]: 2022-04-14 18:06:41 ERROR (MainThread) [custom_components.xiaomi_miot.fan] Mi Air Purifier 3/3H(zhimi.airpurifier.mb3): Got MiioException while fetching the state: Unable to discover the device 192.168.0.16, mapping: {'air_purifier.fault': {'siid': 2, 'piid': 1}, 'air_purifier.on': {'siid': 2, 'piid': 2}, 'air_purifier.fan_level': {'siid': 2, 'piid': 4}, 'air_purifier.mode': {'siid': 2, 'piid': 5}, 'aqi.purify_volume': {'siid': 13, 'piid': 1}, 'aqi.average_aqi': {'siid': 13, 'piid': 2}, 'aqi.average_aqi_cnt': {'siid': 13, 'piid': 3}, 'aqi.aqi_zone': {'siid': 13, 'piid': 4}, 'aqi.sensor_state': {'siid': 13, 'piid': 5}, 'aqi.aqi_goodh': {'siid': 13, 'piid': 6}, 'aqi.aqi_runstate': {'siid': 13, 'piid': 7}, 'aqi.aqi_state': {'siid': 13, 'piid': 8}, 'aqi.aqi_updata_heartbeat': {'siid': 13, 'piid': 9}, 'filter_time.filter_max_time': {'siid': 9, 'piid': 1}, 'physical_controls_locked': {'siid': 7, 'piid': 1}, 'indicator_light.brightness': {'siid': 6, 'piid': 1}, 'indicator_light.on': {'siid': 6, 'piid': 6}, 'alarm': {'siid': 5, 'piid': 1}, 'filter.filter_life_level': {'siid': 4, 'piid': 3}, 'filter.filter_used_time': {'siid': 4, 'piid': 5}, 'environment.pm2_5_density': {'siid': 3, 'piid': 6}, 'environment.relative_humidity': {'siid': 3, 'piid': 7}, 'environment.temperature': {'siid': 3, 'piid': 8}}, max_properties: 8/23
kwi 14 18:06:41 DietPi homeassistant[11572]: 2022-04-14 18:06:41 WARNING (MainThread) [homeassistant.bootstrap] Detected that frontend did not load. Activating safe mode
kwi 14 18:06:41 DietPi homeassistant[11572]: 2022-04-14 18:06:41 ERROR (MainThread) [homeassistant.setup] Setup failed for analytics: Unable to import component: No module named 'lru'
kwi 14 18:06:41 DietPi homeassistant[11572]: 2022-04-14 18:06:41 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: analytics
kwi 14 18:06:41 DietPi homeassistant[11572]: 2022-04-14 18:06:41 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: (DependencyError(...), 'Could not setup dependencies: analytics')
kwi 14 18:06:41 DietPi homeassistant[11572]: 2022-04-14 18:06:41 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: onboarding
kwi 14 18:06:41 DietPi homeassistant[11572]: 2022-04-14 18:06:41 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: (DependencyError(...), 'Could not setup dependencies: onboarding')
kwi 14 18:06:41 DietPi homeassistant[11572]: 2022-04-14 18:06:41 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of safe_mode. Setup failed for dependencies: frontend
kwi 14 18:06:41 DietPi homeassistant[11572]: 2022-04-14 18:06:41 ERROR (MainThread) [homeassistant.setup] Setup failed for safe_mode: (DependencyError(...), 'Could not setup dependencies: frontend')
dietpi@DietPi:/$

can you try to reboot and share the log

journalctl -u home-assistant.service

looks like a python modules is missing

Setup failed for analytics: Unable to import component: No module named 'lru'

Hello, I move my installation to docker and now works OK.
Thanks for help.

Since the lru module was missing, probably:

sudo -u homeassistant bash
. /home/homeassistant/pyenv-activate.sh
pip3 install lru