FS#78824 - [home-assistant] is already installed with the same version as the provided wheel.

Attached to Project: Arch Linux
Opened by InFerYes (InFerYes) - Sunday, 18 June 2023, 18:40 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:18 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Maxime Gauduin (Alucryd)
Alexander Epaneshnikov (alex19EP)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
The home-assistant service is in a loop that keeps going round to the same error.
The journalctl output for this specific service can be found here https://pastebin.com/raw/CvBdPqVK

The most relevant part appears to be

homeassistant is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
Jun 18 10:43:38 sarge python[72712]: [notice] A new release of pip available: 22.3.1 -> 23.1.2
Jun 18 10:43:38 sarge python[72712]: [notice] To update, run: python -m pip install --upgrade pip
Jun 18 10:43:38 sarge systemd[1]: Started Home assistant.
Jun 18 10:43:38 sarge (hass)[72734]: home-assistant.service: Failed to locate executable /var/lib/hass/.venv/bin/hass: No such file or directory
Jun 18 10:43:38 sarge (hass)[72734]: home-assistant.service: Failed at step EXEC spawning /var/lib/hass/.venv/bin/hass: No such file or directory


Additional info:
* package version(s): home-assistant-1:2023.6.2-1
* config and/or log files etc.: https://pastebin.com/raw/CvBdPqVK
* link to upstream bug report, if any

Steps to reproduce:
Start or restart the home-assistant service via systemctl

sudo systemctl restart home-assistant
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:18 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/home-assistant/issues/ 2
Comment by Toolybird (Toolybird) - Sunday, 18 June 2023, 21:52 GMT
Did you manually delete "/var/lib/hass/deps' as per  FS#78774 ?
Comment by Mathias Rohnstock (mrohnstock) - Monday, 19 June 2023, 04:50 GMT
same here, removed the complete "/var/lib/hass/deps" and reinstalled home-assistant package, but doesn't help.

// EDIT: ok, after removing "/var/lib/hass/.venv", too and a double restart, everything works again!
Comment by InFerYes (InFerYes) - Monday, 19 June 2023, 19:04 GMT
I have removed /var/lib/hass/deps/lib as described on the wiki, but I will try 1 level higher and report back
Comment by InFerYes (InFerYes) - Monday, 19 June 2023, 19:23 GMT
home-assistant finally managed to start, but still spews out errors:

Home Assistant Core
Fetch snapshot image failed from Camera1, falling back to FFmpeg
9:21:24 PM – (ERROR) ONVIF - message first occurred at 9:20:26 PM and shows up 9 times
Error handling WebRTC offer: RTSPtoWebRTC server failure: Not Found
9:21:21 PM – (ERROR) Camera - message first occurred at 9:20:41 PM and shows up 6 times
Error doing job: Task exception was never retrieved
9:16:35 PM – (ERROR) .venv/lib/python3.11/site-packages/pydaikin/discovery.py
Setup failed for history: (DependencyError(...), 'Could not setup dependencies: recorder')
9:16:30 PM – (ERROR) setup.py - message first occurred at 9:16:24 PM and shows up 4 times
Unable to set up dependencies of history. Setup failed for dependencies: recorder
9:16:30 PM – (ERROR) setup.py - message first occurred at 9:16:24 PM and shows up 4 times
Setup failed for mycroft: Dependency is disabled - Dependencies not compatible with the new pip resolver
9:16:24 PM – (ERROR) setup.py
Error doing job: Future exception was never retrieved
9:16:23 PM – (ERROR) .venv/lib/python3.11/site-packages/dbus_fast/_private/unmarshaller.py
Error during setup of component bluetooth
9:16:23 PM – (ERROR) .venv/lib/python3.11/site-packages/dbus_fast/_private/unmarshaller.py
Setup failed for recorder: Integration failed to initialize.
9:16:22 PM – (ERROR) setup.py
Error during connection setup: No module named 'mysql' (retrying in 3 seconds)
9:16:19 PM – (ERROR) recorder - message first occurred at 9:15:51 PM and shows up 10 times
Setup of recorder is taking over 10 seconds.
9:16:01 PM – (WARNING) runner.py
Comment by Toolybird (Toolybird) - Tuesday, 20 June 2023, 06:05 GMT
See also dupe  FS#78839 
Comment by Maxime Gauduin (Alucryd) - Tuesday, 20 June 2023, 06:51 GMT
Unless I'm mistaken, hass is supposed to install any missing deps itself, so that's unfortunate. Can you guys try modifying the systemd unit to pass --system-site-packages to both venv commands and daemon-reload/restart? That way you should be able to use missing packages from the repo. You might need to delete the .venv directory first, not sure if --upgrade can convert a standalone venv to one that can tap into the system.
Comment by InFerYes (InFerYes) - Wednesday, 28 June 2023, 18:16 GMT
I followed these steps, first time it failed to start, I restarted the process but I'm back at a similar list of errors as above, most importantly recorder isn't working:

Error fetching reolink.Camera1.firmware data: Error checking Reolink firmware update from Camera1, if the camera is blocked from accessing the internet, disable the update entity
June 26, 2023 at 9:21:13 PM – (ERROR) Reolink IP NVR/camera
Error doing job: Task exception was never retrieved
June 26, 2023 at 9:20:56 AM – (ERROR) .venv/lib/python3.11/site-packages/pydaikin/discovery.py
Setup failed for logbook: (DependencyError(...), 'Could not setup dependencies: recorder')
June 26, 2023 at 9:20:36 AM – (ERROR) setup.py - message first occurred at June 26, 2023 at 9:20:30 AM and shows up 4 times
Unable to set up dependencies of logbook. Setup failed for dependencies: recorder
June 26, 2023 at 9:20:36 AM – (ERROR) setup.py - message first occurred at June 26, 2023 at 9:20:30 AM and shows up 4 times
Setup failed for mycroft: Dependency is disabled - Dependencies not compatible with the new pip resolver
June 26, 2023 at 9:20:29 AM – (ERROR) setup.py
Error during setup of component bluetooth
June 26, 2023 at 9:20:29 AM – (ERROR) .venv/lib/python3.11/site-packages/dbus_fast/_private/unmarshaller.py
Setup failed for recorder: Integration failed to initialize.
June 26, 2023 at 9:20:26 AM – (ERROR) setup.py
Error during connection setup: No module named 'mysql' (retrying in 3 seconds)
June 26, 2023 at 9:20:23 AM – (ERROR) recorder - message first occurred at June 26, 2023 at 9:19:55 AM and shows up 10 times
Setup of recorder is taking over 10 seconds.
June 26, 2023 at 9:20:05 AM – (WARNING) runner.py
Comment by Maxime Gauduin (Alucryd) - Thursday, 29 June 2023, 10:56 GMT
Please try installing python-mysql-connector.
Comment by InFerYes (InFerYes) - Thursday, 29 June 2023, 21:20 GMT
After instelling python-mysql-connector I was back at the reported bug, the service was looping.
I again removed the deps and .venv folders and restarted the service, I'm now back at

console output:
Jun 29 23:15:12 sarge hass[494976]: 2023-06-29 23:15:12.591 ERROR (Recorder) [homeassistant.components.recorder.core] Error during connection setup: No module named 'mysql' (retrying in 3 seconds)
Jun 29 23:15:12 sarge hass[494976]: Traceback (most recent call last):
Jun 29 23:15:12 sarge hass[494976]: File "/var/lib/hass/.venv/lib/python3.11/site-packages/homeassistant/components/recorder/core.py", line 924, in _setup_recorder
Jun 29 23:15:12 sarge hass[494976]: self._setup_connection()
Jun 29 23:15:12 sarge hass[494976]: File "/var/lib/hass/.venv/lib/python3.11/site-packages/homeassistant/components/recorder/core.py", line 1393, in _setup_connection
Jun 29 23:15:12 sarge hass[494976]: self.engine = create_engine(self.db_url, **kwargs, future=True)
Jun 29 23:15:12 sarge hass[494976]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jun 29 23:15:12 sarge hass[494976]: File "<string>", line 2, in create_engine
Jun 29 23:15:12 sarge hass[494976]: File "/var/lib/hass/.venv/lib/python3.11/site-packages/sqlalchemy/util/deprecations.py", line 283, in warned
Jun 29 23:15:12 sarge hass[494976]: return fn(*args, **kwargs) # type: ignore[no-any-return]
Jun 29 23:15:12 sarge hass[494976]: ^^^^^^^^^^^^^^^^^^^
Jun 29 23:15:12 sarge hass[494976]: File "/var/lib/hass/.venv/lib/python3.11/site-packages/sqlalchemy/engine/create.py", line 601, in create_engine
Jun 29 23:15:12 sarge hass[494976]: dbapi = dbapi_meth(**dbapi_args)
Jun 29 23:15:12 sarge hass[494976]: ^^^^^^^^^^^^^^^^^^^^^^^^
Jun 29 23:15:12 sarge hass[494976]: File "/var/lib/hass/.venv/lib/python3.11/site-packages/sqlalchemy/dialects/mysql/mysqlconnector.py", line 83, in import_dbapi
Jun 29 23:15:12 sarge hass[494976]: from mysql import connector
Jun 29 23:15:12 sarge hass[494976]: ModuleNotFoundError: No module named 'mysql'

HASS "logs" page:
Home Assistant Core
Error doing job: Task exception was never retrieved
11:19:00 PM – (ERROR) .venv/lib/python3.11/site-packages/pydaikin/discovery.py
Error setting up entry Camera1 - ec:71:db:85:8e:69 for onvif
11:18:54 PM – (ERROR) .venv/lib/python3.11/site-packages/httpcore/backends/auto.py
Waiting on integrations to complete setup: recorder
11:18:37 PM – (WARNING) bootstrap.py - message first occurred at 11:15:01 PM and shows up 4 times
Setup failed for logbook: (DependencyError(...), 'Could not setup dependencies: recorder')
11:18:35 PM – (ERROR) setup.py - message first occurred at 11:17:19 PM and shows up 4 times
Unable to set up dependencies of logbook. Setup failed for dependencies: recorder
11:18:35 PM – (ERROR) setup.py - message first occurred at 11:17:19 PM and shows up 4 times
Setup failed for cloud: Unable to import component: Exception importing homeassistant.components.cloud
11:18:35 PM – (ERROR) setup.py - message first occurred at 11:17:18 PM and shows up 2 times
Unexpected exception importing component homeassistant.components.cloud
11:18:35 PM – (ERROR) .venv/lib/python3.11/site-packages/urllib3/contrib/pyopenssl.py - message first occurred at 11:17:18 PM and shows up 2 times
Setup failed for mycroft: Dependency is disabled - Dependencies not compatible with the new pip resolver
11:17:18 PM – (ERROR) setup.py
Error doing job: Future exception was never retrieved
11:16:38 PM – (ERROR) .venv/lib/python3.11/site-packages/dbus_fast/_private/unmarshaller.py
Error during setup of component bluetooth
11:16:32 PM – (ERROR) .venv/lib/python3.11/site-packages/dbus_fast/_private/unmarshaller.py
Setup failed for recorder: Integration failed to initialize.
11:15:15 PM – (ERROR) setup.py
Error during connection setup: No module named 'mysql' (retrying in 3 seconds)
11:15:12 PM – (ERROR) recorder - message first occurred at 11:14:45 PM and shows up 10 times
Setup of recorder is taking over 10 seconds.
11:14:55 PM – (WARNING) runner.py
Comment by Max Pray (synthead) - Wednesday, 05 July 2023, 19:12 GMT
Is this still broken?
Comment by InFerYes (InFerYes) - Thursday, 06 July 2023, 07:43 GMT
Yes, the above is as far as I got.
Comment by Max Pray (synthead) - Friday, 28 July 2023, 18:00 GMT
Any updates? Hoping to upgrade Home Assistant soon :)
Comment by InFerYes (InFerYes) - Friday, 28 July 2023, 20:12 GMT
I haven't gotten any further as I don't know enough about these things and no one made any more suggestions on things to try.

Home-assistant works, but there is no recorder. I now have a large gap in my history.
Comment by Max Pray (synthead) - Thursday, 03 August 2023, 18:37 GMT
As of this writing, home-assistant still works when downgraded to 1:2023.5.4-1, along with python downgraded to 3.11.3-1.
Comment by InFerYes (InFerYes) - Thursday, 03 August 2023, 20:18 GMT
Installed the latest version of 2023.7 today

still the problem of mysql

warning: python-mysqlclient-2.1.1-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) python-mysqlclient-2.1.1-2

Total Installed Size: 0.32 MiB
Net Upgrade Size: 0.00 MiB

:: Proceed with installation? [Y/n] n


Logger: homeassistant.components.recorder.core
Source: .venv/lib/python3.11/site-packages/sqlalchemy/dialects/mysql/mysqlconnector.py:83
Integration: recorder (documentation, issues)
First occurred: 9:48:36 PM (10 occurrences)
Last logged: 9:49:03 PM
Error during connection setup: No module named 'mysql' (retrying in 3 seconds)

Traceback (most recent call last):
File "/var/lib/hass/.venv/lib/python3.11/site-packages/homeassistant/components/recorder/core.py", line 924, in _setup_recorder
self._setup_connection()
File "/var/lib/hass/.venv/lib/python3.11/site-packages/homeassistant/components/recorder/core.py", line 1393, in _setup_connection
self.engine = create_engine(self.db_url, **kwargs, future=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 2, in create_engine
File "/var/lib/hass/.venv/lib/python3.11/site-packages/sqlalchemy/util/deprecations.py", line 283, in warned
return fn(*args, **kwargs) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^
File "/var/lib/hass/.venv/lib/python3.11/site-packages/sqlalchemy/engine/create.py", line 601, in create_engine
dbapi = dbapi_meth(**dbapi_args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/lib/hass/.venv/lib/python3.11/site-packages/sqlalchemy/dialects/mysql/mysqlconnector.py", line 83, in import_dbapi
from mysql import connector
ModuleNotFoundError: No module named 'mysql'

--------------------------------------
edit:

also checked this, but is already up to date

warning: python-mysql-connector-8.0.33-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) python-mysql-connector-8.0.33-2

Total Installed Size: 4.54 MiB
Net Upgrade Size: 0.00 MiB

:: Proceed with installation? [Y/n] n
Comment by InFerYes (InFerYes) - Thursday, 03 August 2023, 20:50 GMT
Ok, so what seemed to have fixed this issue is manually installed the python packages.

I first tried to remove the python packages python-mysqlclient and python-mysql-connector from the system with pacman, because they were not listed as dependencies on the home-assistant package. After restarting home-assistant I hoped that it would install the missing dependencies itself, but after a few restarts of the service it did not install the dependencies. I then installed the dependencies manually:

sudo /var/lib/hass/.venv/bin/python -m pip install mysql-connector-python
Collecting mysql-connector-python
Downloading mysql_connector_python-8.1.0-cp311-cp311-manylinux_2_17_x86_64.whl (27.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 27.5/27.5 MB 8.7 MB/s eta 0:00:00
Collecting protobuf<=4.21.12,>=4.21.1
Downloading protobuf-4.21.12-cp37-abi3-manylinux2014_x86_64.whl (409 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 409.8/409.8 kB 5.1 MB/s eta 0:00:00
Installing collected packages: protobuf, mysql-connector-python
Successfully installed mysql-connector-python-8.1.0 protobuf-4.21.12

[notice] A new release of pip available: 22.3.1 -> 23.2.1
[notice] To update, run: python -m pip install --upgrade pip
[user@hostname ~]$ sudo /var/lib/hass/.venv/bin/python -m pip install mysqlclient
Collecting mysqlclient
Downloading mysqlclient-2.2.0.tar.gz (89 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 89.5/89.5 kB 956.4 kB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (pyproject.toml) ... done
Created wheel for mysqlclient: filename=mysqlclient-2.2.0-cp311-cp311-linux_x86_64.whl size=135528 sha256=ea1c70fd4e71b4ebf1f5dfdd3b9882a8f08c3cd5631296bcd342b8093ca13009
Stored in directory: /root/.cache/pip/wheels/06/2d/91/05c415fb414ea08c63eb163e0e1ac6f05169d2f6c87efc6121
Successfully built mysqlclient
Installing collected packages: mysqlclient
Successfully installed mysqlclient-2.2.0

[notice] A new release of pip available: 22.3.1 -> 23.2.1
[notice] To update, run: python -m pip install --upgrade pip


After restarting the service it started the recorder and the history works again. I'm not sure if mysql-connector-python was necessary.
Comment by Hans (jack_ew) - Saturday, 05 August 2023, 13:36 GMT
For me was the solution to add `TimeoutStartSec=infinity` (at [Service] Block) in the `home-assistant.service` file.
Comment by Maxime Gauduin (Alucryd) - Tuesday, 15 August 2023, 09:30 GMT
@InFerYes This should be the same as using --system-site-packages for the venv and having them installed via pacman though :/ I won't have time to try it out for the foreseeable future, but I'm quite positive what I proposed should work.
Comment by Max Pray (synthead) - Tuesday, 22 August 2023, 03:16 GMT
This blocking bug has been opened for over two months. Should this package be moved to the AUR?

Loading...