Issues with HA on Ubuntu 17.04

Hi

I’m currently running HA on ubuntu 16.10 and it works like a charm! Now Ubuntu 17.04 has been release and I’ve tried updating it without success.

This is the errors i get

Starting with systemd

pi@homeAssistant:~$ sudo 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 Wed 2017-04-26 09:50:53 CEST; 2min 44s ago
  Process: 1303 ExecStart=/srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant (code=exited, status=1/FAILURE)
 Main PID: 1303 (code=exited, status=1/FAILURE)

Apr 26 09:50:53 homeAssistant hass[1303]:   File "/srv/homeassistant/lib/python3.5/types.py", line 166, in <module>
Apr 26 09:50:53 homeAssistant hass[1303]:     import functools as _functools
Apr 26 09:50:53 homeAssistant hass[1303]:   File "/srv/homeassistant/lib/python3.5/functools.py", line 23, in <module>
Apr 26 09:50:53 homeAssistant hass[1303]:     from weakref import WeakKeyDictionary
Apr 26 09:50:53 homeAssistant hass[1303]:   File "/srv/homeassistant/lib/python3.5/weakref.py", line 12, in <module>
Apr 26 09:50:53 homeAssistant hass[1303]:     from _weakref import (
Apr 26 09:50:53 homeAssistant hass[1303]: ImportError: cannot import name '_remove_dead_weakref'
Apr 26 09:50:53 homeAssistant systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Apr 26 09:50:53 homeAssistant systemd[1]: [email protected]: Unit entered failed state.
Apr 26 09:50:53 homeAssistant systemd[1]: [email protected]: Failed with result 'exit-code'.

Starting it with sudo -u homeassistant -H /srv/homeassistant/bin/hass

pi@homeAssistant:/srv/homeassistant$ sudo -u homeassistant -H /srv/homeassistant/bin/hass
Failed to import the site module
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site.py", line 703, in <module>
    main()
  File "/srv/homeassistant/lib/python3.5/site.py", line 683, in main
    paths_in_sys = addsitepackages(paths_in_sys)
  File "/srv/homeassistant/lib/python3.5/site.py", line 282, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "/srv/homeassistant/lib/python3.5/site.py", line 204, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "/srv/homeassistant/lib/python3.5/site.py", line 173, in addpackage
    exec(line)
  File "<string>", line 1, in <module>
  File "/srv/homeassistant/lib/python3.5/types.py", line 166, in <module>
    import functools as _functools
  File "/srv/homeassistant/lib/python3.5/functools.py", line 23, in <module>
    from weakref import WeakKeyDictionary
  File "/srv/homeassistant/lib/python3.5/weakref.py", line 12, in <module>
    from _weakref import (
ImportError: cannot import name '_remove_dead_weakref'

Anyone has any idea how to solve this? Tried googling it but haven’t found any information that helped me fix it.

I just did the same thing… I feel so stupid! exact same errors

Back up and running this is what I did

$ sudo su -s /bin/bash homeassistant
$ virtualenv -p python3 /srv/homeassistant
$ source /srv/homeassistant/bin/activate
(homeassistant)$ pip3 install --upgrade homeassistant
$ sudo -u homeassistant -H /srv/homeassistant/bin/hass

1 Like

Sweet, just tried it again and it worked fine for me too, got some warnings when running $ virtualenv -p python3 /srv/homeassistant, but i ignored it and executed the rest and everything looks good now :slight_smile:

Lucky for me I’m running this on a virtual server so any updates I do I’m using snapshots, so its almost to easy to rollback, but the downside is that i dont have to find a solution right away, to lazy :wink:

Thanks Norien!

You are welcome guys. :slight_smile:

1 Like

I did the same thing, updated to Ubuntu 17.04. Same error so I tried the reinstall norein posted. Well that didn’t seem to work.

I’m not getting any logs either, and while it does start it no listeners on port 8123,

Try the original discussion here.
https://github.com/home-assistant/home-assistant/issues/7321

Reply back here if that doesn’t work.

1 Like