Categories
Uncategorized

Fixing Home Assistant 2024.10 on FreeBSD

This is the fix I found for my own HA install, running HA Core in a FreeBSD jail. This may also apply to other operating systems as well.

The problem

The main issue in Github for this problem is here. You can see a few solutions there but none of them applied to my case.

I was getting:

No such file or directory: 'uv'

or

2024-10-02 17:24:41.608 ERROR (SyncWorker_9) [homeassistant.util.package] Unable to install package home-assistant-frontend==20241002.2: error: No virtual environment found; run uv venv to create an environment, or pass --system to install into a non-virtual environment

What pointed me in the right direction was the uv venv hint.

The fix

In my case, I’m using FreeBSD. What I needed to do was source the venv created by uv. I had been using the installation guide from here, but it stopped working after 2024.10. These are the steps to upgrade this setup.

  1. Become homeassistant: su homeassistant
  2. cd home: cd
  3. Create a new venv: uv venv hap312 --python 3.12
  4. Activate it: . /home/homeassistant/hap312-202410/bin/activate
  5. Install HA: uv pip install homeassistant
  6. Go back to being root: Ctrl-D
  7. Edit your rc.conf, and set: homeassistant_venv=/home/homeassistant/hap312
  8. This is the important bit, and I don’t have a better solution: Edit your rc.script for homeassistant (/usr/local/etc/rc.d/homeassistant) and activate the venv in it too. Look for the line . /etc/rc.subr and add . /home/homeassistant/hap312-202410/bin/activate below it.
  9. Start HA /usr/local/etc/rc.d/homeassistant start
  10. Check the logs to see if everything is fine tail -f /var/log/homeassistant.log

After this, I had to restart Home Assistant several times. I’ve had this happen before. Some packages don’t finish installing and they need “nudging” by running a restart. In this case, I had to restart 3 times until everythin (especially ESPHome which my house relies heavily on!) started working.

Leave a Reply

Your email address will not be published. Required fields are marked *