Upgrading my Pi3 to stretch has killed HAS

Ive just upgraded my Pi3 to rasbiane stretch as per guidelines https://www.raspberrypi.org/blog/raspbian-stretch/

its now seemingly destroyed my HAS installation.

Im unable to start it or uprgade…

pi@media-pi:~ $ sudo su -s /bin/bash homeassistant
homeassistant@media-pi:/home/pi $ source /srv/homeassistant/bin/activate
(homeassistant) homeassistant@media-pi:/home/pi $ pip3 install --upgrade homeassistant
Traceback (most recent call last):
  File "/srv/homeassistant/bin/pip3", line 7, in <module>
    from pip import main
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/__init__.py", line 28, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/download.py", line 36, in <module>
    from pip.utils.glibc import libc_ver
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/utils/glibc.py", line 4, in <module>
    import ctypes
  File "/usr/lib/python3.4/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ImportError: /srv/homeassistant/lib/python3.4/lib-dynload/_ctypes.cpython-34m-arm-linux-gnueabihf.so: undefined symbol: _PyTraceback_Add
1 Like

You have to rebuild your virtual environment. See this answer (but start from step 2 not step 3)

Thanks for this, I was sure id read something somewhere but couldn’t finds it!

I guess this is the case, even though I can still activate my current virt. env.?

Your virtual env is referencing python3.4 which does not exist on stretch, so although you can activate it, it will not run anything.

awesome thanks
I had to create the folder in /srv and chown it to homeassistant user and i have my HAS back…but…always a but…
i get an error in the log:

ERROR:homeassistant.components.http:Failed to create HTTP server at port 80: [Errno 13] error while attempting to bind on address ('192.168.0.50', 80): permission denied

Something in your configuration.yaml is trying to use port 80, but you have to have root privileges to do that. You need to use a port higher than 1024 (I think) for non-root users.

yep, you’re right.
I have emulated hue running on port 80.

I had to re-run the below command to allow it to use port 80 as a non-root user

sudo setcap 'cap_net_bind_service=+ep' /srv/homeassistant/bin/python3

I also updated my hass(bian) to stretch and (almost) everything stopped working.
After rebuilding the virtual environment, reinstalling homeassistant and dropping mysql tables, it looks like it is all working again.

However, it seems that my ethernet port is no longer ‘/dev/eth0’, but changed to ‘/dev/enx[xxyyzzxyxz]’ due to predictable network interface names. So I had to hook up an old monitor and keyboard to login before I found out what was wrong.

1 Like

yeah, I did read some people had problems after and even during upgrade.
during the upgrade all the changes were presented to me and I was given the option to keep my original config files, or install the ‘new’ one, for example dhcpcd.conf
also have the option to compare, which I did and kept everything I thought might have any breaking effect.

or I was lucky…

1 Like

Yeah I did read some of the changes but not all of them, it seems…
Lessons learned :slight_smile:

I copied my config files and started over with a new installation. Using the AIO, my configuration had issues with Mosquitto, FFMPEG, and Zwave. If you google Mosquitto and Stretch, there is a solution out there to have the necessary files to configure mosquitto properly. Same with FFMPEG.

Zwave was a little more tricky because my homeassistant install had created the config files in two places and they were not sourcing like it should. I think it has something to do with Python3.5 vs 3.4 which is what all the HA docs continue to reference. Once I realized it and copied the files in the /src/ location to the .homeassistant location, it has been working properly since.