Update error after updating from 0.84 version

Merry Christmas to all!
I was running a bit old version but when my iPhone got the latest version I tried to update the Home Assistant version also.
I am running HA on rasberry pi3.
I used the following in order to update:

sudo -u homeassistant -H -s
source /srv/homeassistant/bin/activate
pip3 install --upgrade homeassistant

I got an error that I am running an old python version so I did the following to update python:

sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev

wget -O /tmp/Python-3.7.3.tar.xz https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz

cd /tmp

tar xf Python-3.7.3.tar.xz

cd Python-3.7.3

./configure

sudo make altinstall

sudo apt -y autoremove

cd

rm -r /tmp/Python-3.7.3

rm /tmp/Python-3.7.3.tar.xz

sudo systemctl stop [email protected]

sudo mv /srv/homeassistant /srv/homeassistant_old

sudo mkdir /srv/homeassistant

sudo chown homeassistant:homeassistant -R /srv/homeassistant

cd /srv/homeassistant

/usr/local/bin/python3.7 -m venv .

source bin/activate

pip install wheel homeassistant

And then I run the upgrade again, rebooted but now the service cannot start.

[email protected] - Home Assistant
Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2019-12-27 13:54:51 EET; 10min ago
Process: 910 ExecStart=/srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant (code=exited, status=203/EXEC)
Main PID: 910 (code=exited, status=203/EXEC)

I am realy confused… I dont’t even know how to check my current versions to see if HA is updated or not.

See Tediore’s answer here:

Every upgrade contains breaking changes that just build up. You can try to walk through each set of release notes and compare it to your config. But if it were me, I would probably copy my config off, start from scratch with the latest version then try to add back in the configuration little by little. That’s what I did recently when I went from .84 to .10x something. Unfortunately the amount of work is the same to upgrade from version to version so for those of us that don’t have time to break our house every 2 weeks, and investigate things, it becomes several days of work less often instead.

It might also be a good time to consider switching to docker. There has been a lot of emphasis on updating python versions (a little too aggressively IMHO) recently as you discovered. The good thing about docker is HA is packaged with the recommended versions of python, python libs etc that work. Docker also makes it a quick rollback if you manage your configuration files. So you can flip back to a working house if you run out of time to troubleshoot.

That’s terrible advice. There’s no need to start from scratch.

Also the major breaking change that I would put money on causing the problem is in Tedior’s answer I linked to above.

Breaking changes are clearly listed in the release notes and all it usually takes is a few quick ‘find and replace’ searches with a text editor to rectify.

For bugs that were not found by the beta testers it’s easy to roll back to the last working version and dot releases that fix these problems are quick to be released. There is not much of an excuse for not keeping up to date and it is a lot easier in the long run.

Ok, so what do you propose? Is there a way to troubleshoot the problem or maybe starting from scratch would be quicker?
Meaning have a system running quicker.

Read that post I linked to. It has all the advice you need.

1 Like

Ok, I got the idea. To update one version at a time. But how can I tell which version is currently installed? And if it is the latest do I have to go back to 0.84 and then one by one?

hassio homeassistant info

Other commands listed here: https://www.home-assistant.io/hassio/commandline/

Did you remove api_password from under http: first though? That is what I wanted you to read in the post I linked to.

I think from the first post they are running HA in a venv not hassio…

Correct?

Correct. Not hassio…

Normally I would just say to roll back to a good known working version of HA and update one version at a time as has been advised.

However, in this case you didn’t just do an update of HA you also (tried…?) updated the python version. So there’s no way for me to know the reason that the service won’t start. I have no idea what that error message means.

to start off do you have a good backup image of your SD card? if not that is problem number one. You should always make a backup of the SD card before making changes, especially when you are messing with the underlying OS.

If you do I would restore that image and move one step at a time in the update and fixing the breaking changes (saving a backup image each time) until you get to the python upgrade requirement. There was a thread on here a couple of months back that had the correct procedure to update the python version by (I think…) @kanga_who.

If you don’t have a backup then I think the easiest thing to do would be to save all of the HA files in your config directory (where configuration.yaml lives) and then just do a complete re-install of Raspbian/HA on your card (which will give you the latest python version) then see if you can roll back your known good version of HA. If that works then you can step thru the HA versions fixing the breaking changes and you won’t need to worry about the python version update.

OR…better yet would be to take the opportunity to explore installing HA (hassio or non-hassio) in Docker. It’s very simple and you’ll never need to worry about updates to python or any other dependencies since they are shipped in the docker image. Updates and maintenance are also way easier.

1 Like

To begin with, thank you for the long answer!

Unfortunately not!

So you mean format card and re-install everything? Is there a way of just deleting everything that has to do with Home Assistance?

This sounds better. I will find some videos to better understand how Docker works and what it does!