Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

HA Core 2024.10 uses uv now for handling the virtual environment and the older core install fails #3817

Closed
dmshimself opened this issue Oct 2, 2024 · 9 comments
Labels
🐞 bug Something isn't working ✅ Completed

Comments

@dmshimself
Copy link

Please verify that you have read and understood the guidelines.

Yes

A clear and concise description of the issue.

HA has moved to using UV to manage the virtual environment and additional module installs. The current helper script doesn't use this in the install and so various things fail with missing file/directory UV shown in systemctl status homeassistant and the logs

What settings are you currently utilizing?

Default Settings

Which Linux distribution are you employing?

Ubuntu 24.04

If relevant, including screenshots or a code block can be helpful in clarifying the issue.

No response

Please provide detailed steps to reproduce the issue.

Run the current HA core script and try to access HA. It fails and the ha logs/systemctl status highlight missing uv

@tteck
Copy link
Owner

tteck commented Oct 2, 2024

https://www.home-assistant.io/installation/linux#install-home-assistant-core

Where are the instructions listed?

@dmshimself
Copy link
Author

The release notes comment on the use of uv here:
https://www.home-assistant.io/blog/2024/10/02/release-202410/

(under the section Faster Upgrades ...)
When I did a fresh install of 2024.10, the need for uv was clear from the log and systemctl status.

However I note in the core install guide:
https://www.home-assistant.io/installation/linux

There appears to be no mention of uv in the pre-reqs. A sin of omission on their part perhaps :-)

I'd be happy to try a manual core install following their instructions so if there is a problem upstream, it can be fixed there?

@tteck tteck added the 🐞 bug Something isn't working label Oct 3, 2024
@tteck tteck closed this as completed in f2937fe Oct 3, 2024
@dmshimself
Copy link
Author

So fast and it works a treat. Many thanks

@jimeelicious
Copy link

jimeelicious commented Oct 3, 2024

For others in case this is helpful, I was able to upgrade my HA LXC from 2024.8.3 to 2024.10.0 directly by running the following commands:

  1. Enter Home Assistant LXC, and update packages via:
apt update && apt upgrade -y
source /srv/homeassistant/bin/activate
pip install --upgrade pip
pip install uv
  1. Edit the Home Assistant systemd service by adding an environment path. Add the following line: Environment="PATH=/srv/homeassistant/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/homeassistant/.local/bin" under the [Service] block. Mine was located at /etc/systemd/system/homeassistant.service. For example: nano /etc/systemd/system/homeassistant.service
[Unit]
Description=Home Assistant
After=network-online.target
[Service]
Type=simple
WorkingDirectory=/root/.homeassistant
ExecStart=/srv/homeassistant/bin/hass -c "/root/.homeassistant"
Environment="PATH=/srv/homeassistant/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/homeassistant/.local/bin"
Restart=always
RestartForceExitStatus=100
[Install]
WantedBy=multi-user.target

#127359 in HA Core, courtesy of @prairiesnpr

  1. Reload systemd and run the full upgrade command
systemctl daemon-reload
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/homeassistant-core.sh)"

I'm not sure how to do this but if someone would like to submit a PR, please feel free to do so.

@proddy
Copy link

proddy commented Oct 3, 2024

thanks @jimeelicious - that fixed it for me too! Thanks for sharing and making it so clear.

@elad-bar
Copy link
Contributor

elad-bar commented Oct 3, 2024

thanks @jimeelicious solved the issue in 1 min., after trying to figue out what changed for more than hour :)
maybe that post can be added to discussions for ppl encoutering this issue as well

@tteck
Copy link
Owner

tteck commented Oct 3, 2024

@proddy does it survive a LXC reboot? I don't see how this is working because the original virtual environment was created with pip (python3 -m venv .) instead of uv (uv venv .)

@tteck
Copy link
Owner

tteck commented Oct 3, 2024

Using python3 -m homeassistant is generally more robust because it leverages Python's module management, ensuring the correct environment is in place.

Using the hass Binary is convenient for quick startup and works fine in environments that are already properly set up, but it may miss some initialization that the module-based execution ensures.

@tteck
Copy link
Owner

tteck commented Oct 3, 2024

If you need to create a new Home Assistant Core LXC and want to transfer your data #2341 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working ✅ Completed
Projects
None yet
Development

No branches or pull requests

5 participants