Help, upgrade to Stretch broke my homeassistant

There are a few threads in the forum about problems with Mosquitto after upgrading, and there are a couple of solutions, so I suggest you do a search.

I think I avoided them because I get my packages directly from the mosquitto.org debian package site using these instructions http://mosquitto.org/2013/01/mosquitto-debian-repository/. Just replace jessie with stretch when necessary, and you get a workable version. This is rather non-hassbian though, so you may want to stick to the mainstream.

I actually have a whole lot more than that -

driver.pxd libopenzwave.pyx mylibc.pxd options.pxd
group.pxd log.pxd node.pxd values.pxd
libopenzwave.cpp manager.pxd notification.pxd

What’s interesting to me is that according to the CHANGELOG in the python-openzwave folder, this appears to be source code for version 0.33.

I’m actually going to start another new virtual environment and reinstall HA to it and see what happens…

This still nets the same error. Any other ideas?

Thanks, I tried searching, but didn’t find a solution that worked for me.

Tried adding the mosquitto repository you suggested, but that gave an error on a dependency libwebsockets3.

So then I went back to the official source and used apt to remove and purge mosquitto and mosquitto-client
After installing it again from scratch it is working fine!

All good now, thanks for all your help!

1 Like

Thanks for the guidance on this Dayve67. I haven’t been well lately but today felt like I had the brain capacity to sort this out - only took me about 15mins to find the problem in the end.

It’s party because I started with an AiO installation and switched to a virtual environment when I did the stretch upgrade.

I had an options.xml (Zwave config file) file within my home assistant home directory. It was a symlink pointing to a folder which was also a symlink, for an old zwave version from the original install. Should have all worked as the paths were still valid, but it was looking for a config set from libopenzwave 0.3.3 so I decided to get rid of that. I deleted the options.xml file, restarted home-assistant and zwave came straight up. It’s now regenerated its own file and so far it seems that things are working as they should.

hi,

I’ve done all this started with…

sudo mv /srv/homeassistant /srv/ha_old

after i’ve recreated my new virtual env and reinstalled HA, how do i resotre the old config from… /srv/ha_old

?

Your configuration is not stored in the virtual environment, it is in

/home/homeassistant/.homeassistant/configuration.yaml

Ah - ok, I misunderstood, got that.

So it’s probably all fine - only thing is it’s not starting up when the pi reboots as it used to - do I need to do something else to get it to autostart post this stretch upgrade and reinstall of the virtual environment.

Again, this has nothing to do with the virtual environment.

Try the following command

[email protected]:~ 
$ systemctl status [email protected][email protected] - Home Assistant for homeassistant
   Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: 
   Active: active (running) since Sun 2017-11-19 11:49:40 GMT; 1 weeks 4 days ago
 Main PID: 15641 (hass)
   CGroup: /system.slice/system-home\x2dassistant.slice/[email protected]
           └─15641 /srv/homeassistant/bin/python3 /srv/homeassistant/bin/hass

If you get disabled instead of enabled in the loaded: line then

$ sudo systemctl enable [email protected]

should be ok.

If there is more wrong, you could try researching what is missing from this page

thanks for this… says

Loaded: loaded
Active: failed

Then things definitely are not ok. What does the log file say?

(homeassistant) [email protected]:/home/homeassistant/.homeassistant$ systemctl status [email protected]
[email protected] - Home Assistant
Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2017-11-30 12:23:52 GMT; 2min 50s ago
Process: 424 ExecStart=/srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant (code=exited, statu Main PID: 424 (code=exited, status=203/EXEC)

Nov 30 12:23:52 custard-pi systemd[1]: Started Home Assistant.
Nov 30 12:23:52 custard-pi systemd[1]: [email protected]: Main process exited, code=exited,Nov 30 12:23:52 custard-pi systemd[1]: [email protected]: Unit entered failed state.
Nov 30 12:23:52 custard-pi systemd[1]: [email protected]: Failed with result ‘exit-code’.
lines 1-10/10 (END)

Actually, I meant the HA log file at

/home/homeassistant/.homeassistant/home-assistant.log

Checked it, all timestamps from while ago so new instance is not being started.

So it looks like your new virtual environment isn’t working, or isn’t where the service expects it to be.

What is the output of

ls -l /srv/homeassistant/bin

[email protected]:~$ ls -l /srv/homeassistant/bin
ls: cannot access ‘/srv/homeassistant/bin’: No such file or directory
[email protected]:~$ which hass
[email protected]:~$ ls -l /srv/ha_old/
bin/ lib/ pyvenv.cfg
include/ pip-selfcheck.json share/
[email protected]:~$ ls -l /srv/ha_old/
bin/ lib/ pyvenv.cfg
include/ pip-selfcheck.json share/
[email protected]:~$ ls -l /srv/ha_old/
total 24
drwxr-xr-x 2 homeassistant homeassistant 4096 Nov 29 12:49 bin
drwxr-xr-x 2 homeassistant homeassistant 4096 Aug 6 07:48 include
drwxr-xr-x 4 homeassistant homeassistant 4096 Aug 6 07:48 lib
-rw-r–r-- 1 homeassistant homeassistant 60 Nov 29 12:49 pip-selfcheck.json
-rw-r–r-- 1 homeassistant homeassistant 69 Aug 6 08:04 pyvenv.cfg
drwxr-xr-x 3 homeassistant homeassistant 4096 Aug 6 07:55 share
[email protected]:~$

Well that is why its not running. I suggest you review what you did when you thought you created a new virtual environment - it didn’t actually happen.

Cheers, I’ve clearly messaged something up, now struggling to destroy all traces and reinstall the venv but I’ll get there.

Can’t figure this permission denied message…

[email protected]:~$ sudo adduser --system homeassistant
The system user homeassistant' already exists. Exiting. [email protected]:~$ sudo addgroup homeassistant addgroup: The group homeassistant’ already exists.
[email protected]:~$ sudo mkdir /srv/homeassistant
[email protected]:~$ sudo chown homeassistant:homeassistant /srv/homeassistant
[email protected]:~$
[email protected]:~$
[email protected]:~$ python3 -m venv /srv/homeassistant
Error: [Errno 13] Permission denied: ‘/srv/homeassistant/include’
[email protected]:~$

It looks like 18 days ago someone decided that the instructions that were working fine should be changed, and now the instructions on that page don’t work.

It was done in this edit

Which makes answering questions like this very hard. My previous link is now no longer valid.

As a short answer, you need to switch to user homeassistant before you actually create the virtual environment.

Do

$ sudo su -s /bin/bash -l homeassistant
[email protected]:~ $ python3 -m venv /srv/homeassistantsource [email protected]:~ $ /srv/homeassistant/bin/activate
[email protected]:~ $ pip3 install  homeassistant

and that should work - although I haven’t tested it. But there again, neither did the person who re-wrote the documentation page, so you are no worse off.:roll_eyes: