Cannot upgrade

This has been happening for several upgrade attempts. Have not successfully upgraded since version 0.42.4. Have tried each version since. Keep getting these errors. Has not mattered if hass is running or not. Using exact same commands as previous successful upgrades. Any ideas?

Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python3.4/dist-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python3.4/dist-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python3.4/dist-packages/pip/wheel.py", line 316, in clobber
    ensure_dir(destdir)
  File "/usr/local/lib/python3.4/dist-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/lib/python3.4/os.py", line 237, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.4/dist-packages/pytz-2017.2.dist-info'

Hassbian?

$ sudo systemctl stop [email protected]
$ sudo su -s /bin/bash homeassistant
$ source /srv/homeassistant/bin/activate
$ pip3 install --upgrade homeassistant
$ exit
$ sudo systemctl start [email protected]
3 Likes

Nope. same results. Rpi all in one install.

I have Hassbian and cannot upgrade (to version 0.43.2) either.

pi@RPI3:~ $ sudo su -s /bin/bash homeassistant
homeassistant@RPI3:/home/pi $ source /srv/homeassistant/bin/activate
(homeassistant) homeassistant@RPI3:/home/pi $ hass --script check_config
INFO:homeassistant.util.package:Attempting install of colorlog>2.1,<3
Testing configuration at /home/homeassistant/.homeassistant
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up http
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up recorder
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up api
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up websocket_a                                                          pi
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up history
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up frontend
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up updater
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up light
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up conversatio                                                          n
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up emulated_hu                                                          e
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up sun
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up switch
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up scene
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up sensor
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up group
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up notify
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up discovery
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up xiaomi
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up zone
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up media_playe                                                          r
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up config
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up tts
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up logbook
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up camera
17-04-29 13:50:03 INFO (MainThread) [homeassistant.setup] Setting up device_trac                                                          ker
**17-04-29 13:50:03 ERROR (MainThread) [homeassistant.core] Error doing job: Task                                                           exception was never retrieved**
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/setup.py",                                                           line 60, in async_setup_component
return (yield from task)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
  File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
result = next(coro)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/setup.py",                                                           line 159, in _async_setup_component
conf_util.async_process_component_config(hass, config, domain)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/config.py",                                                           line 545, in async_process_component_config
p_validated = component.PLATFORM_SCHEMA(p_config)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 192, in __call__
return self._compiled([], data)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 486, in validate_dict
return base_validate(path, iteritems(data), out)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 269, in validate_mapping
cval = cvalue(key_path, value)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 625, in validate_callable
return schema(data)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/validators.py"                                                          , line 262, in __call__
v = schema(v)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 192, in __call__
return self._compiled([], data)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 523, in validate_sequence
cval = validate(index_path, value)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 625, in validate_callable
return schema(data)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/validators.py"                                                          , line 224, in __call__
return schema(v)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 192, in __call__
return self._compiled([], data)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 625, in validate_callable
return schema(data)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/validators.py"                                                          , line 262, in __call__
v = schema(v)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 192, in __call__
return self._compiled([], data)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 625, in validate_callable
return schema(data)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 192, in __call__
return self._compiled([], data)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 486, in validate_dict
return base_validate(path, iteritems(data), out)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 269, in validate_mapping
cval = cvalue(key_path, value)
  File "/srv/homeassistant/lib/python3.4/site-packages/voluptuous/schema_builder                                                          .py", line 625, in validate_callable
return schema(data)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/con                                                          fig_validation.py", line 223, in service
if valid_entity_id(value):
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/core.py", l                                                          ine 66, in valid_entity_id
return ENTITY_ID_PATTERN.match(entity_id) is not None
TypeError: expected string or buffer

I’m also getting a permissions error, but it’s on the homeassistant package. This is on a Hassbian install on a Pi 3

PermissionError: [Errno 13] Permission denied: ‘/usr/local/lib/python3.4/dist-packages/homeassistant’

@steevc

Are you stopping HASS prior to doing the upgrade?

Same here
Hassbian:

$ sudo systemctl stop [email protected]
$ sudo su -s /bin/bash homeassistant
$ source /srv/homeassistant/bin/activate
$ pip3 install --upgrade homeassistant
$ exit
$ sudo systemctl start [email protected]

permission denied:

Uninstalling homeassistant-0.43.1:

Exception:
Traceback (most recent call last):
File “/usr/lib/python3.4/shutil.py”, line 522, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: ‘/srv/homeassistant/lib/python3.4/site-packages/homeassistant-0.43.1.dist-info/DESCRIPTION.rst’ → ‘/tmp/pip-3_82eql4-uninstall/srv/homeassistant/lib/python3.4/site-packages/homeassistant-0.43.1.dist-info/DESCRIPTION.rst’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.4/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/srv/homeassistant/lib/python3.4/site-packages/pip/commands/install.py”, line 342, in run
prefix=options.prefix_path,
File “/srv/homeassistant/lib/python3.4/site-packages/pip/req/req_set.py”, line 778, in install
requirement.uninstall(auto_confirm=True)
File “/srv/homeassistant/lib/python3.4/site-packages/pip/req/req_install.py”, line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File “/srv/homeassistant/lib/python3.4/site-packages/pip/req/req_uninstall.py”, line 115, in remove
renames(path, new_path)
File “/srv/homeassistant/lib/python3.4/site-packages/pip/utils/init.py”, line 267, in renames
shutil.move(old, new)
File “/usr/lib/python3.4/shutil.py”, line 535, in move
os.unlink(src)
PermissionError: [Errno 13] Permission denied: ‘/srv/homeassistant/lib/python3.4/site-packages/homeassistant-0.43.1.dist-info/DESCRIPTION.rst’

the directory is owned by root:

homeassistant@pi3:/srv/homeassistant/lib/python3.4/site-packages/homeassistant-0.43.1.dist-info $ ll
total 192
drwxr-xr-x 2 root root 4096 Apr 25 19:34 .
drwxr-xr-x 38 homeassistant homeassistant 4096 Apr 25 19:34 …
-rw-r–r-- 1 root root 10 Apr 25 19:33 DESCRIPTION.rst
-rw-r–r-- 1 root root 54 Apr 25 19:33 entry_points.txt
-rw-r–r-- 1 root root 4 Apr 25 19:34 INSTALLER
-rw-r–r-- 1 root root 1021 Apr 25 19:33 METADATA
-rw-r–r-- 1 root root 1284 Apr 25 19:33 metadata.json
-rw-r–r-- 1 root root 47 Apr 25 19:33 pbr.json
-rw-r–r-- 1 root root 152875 Apr 25 19:34 RECORD
-rw-r–r-- 1 root root 14 Apr 25 19:33 top_level.txt
-rw-r–r-- 1 root root 110 Apr 25 19:33 WHEEL

homeassistant is stopped during upgrade.

@Coolie1101 I did, as always. Tried again with the same result.

@hollladiewaldfee

Try upgrading HASSBIAN first, I had this issue before and upgrading HASSBIAN worked.
sudo apt-get update
sudo apt-get -y upgrade

Did you set a password in HASS?

I did upgrade hassbian first.
I did not set a password in the GUI, but I updated the password of the homeassistant OS user.

Actually homeassistant is not starting anymore.
Neither via systemctl nor direct /srv/homeassistant/bin/hass.

edit: there is on hass in /srv/homeassistant/bin/ anymore.

Can you browse to the .homeassistant directory?

yes

(homeassistant) homeassistant@pi3:~/.homeassistant $ ll
total 164380
drwxr-xr-x  7 homeassistant homeassistant      4096 Apr 29 20:29 .
drwxr-xr-x  8 homeassistant homeassistant      4096 Apr 29 20:32 ..
-rw-r--r--  1 homeassistant homeassistant         0 Mar 22 20:10 alarm_control_panel.yaml
-rw-r--r--  1 homeassistant homeassistant         0 Mar 22 20:10 automation.yaml
-rw-r--r--  1 homeassistant homeassistant        50 Apr  9 13:25 binary_sensors.yaml
-rw-r--r--  1 homeassistant homeassistant         0 Mar 22 20:09 cameras.yaml
-rw-r--r--  1 homeassistant homeassistant      1941 Apr 19 19:11 configuration.yaml
-rw-r--r--  1 homeassistant homeassistant      3392 Apr  9 12:49 covers.yaml
-rw-r--r--  1 homeassistant homeassistant      1281 Apr  2 21:21 customization.yaml
drwxr-xr-x 64 homeassistant homeassistant      4096 Apr 25 19:56 deps
drwxr-xr-x  2 homeassistant homeassistant      4096 Apr  8 20:23 devices
-rw-r--r--  1 homeassistant homeassistant       154 Mar 22 21:30 device_trackers.yaml
-rw-r--r--  1 homeassistant homeassistant       824 Apr  9 13:42 groups.yaml
-rw-r--r--  1 homeassistant homeassistant         6 Apr 25 19:34 .HA_VERSION
-rw-r--r--  1 homeassistant homeassistant  11950076 Apr 29 20:29 home-assistant.log
-rw-r--r--  1 homeassistant homeassistant 156275712 Apr 29 20:29 home-assistant_v2.db
-rw-r--r--  1 homeassistant homeassistant       426 Apr 16 20:01 input_boolean.yaml
-rw-r--r--  1 homeassistant homeassistant         0 Mar 22 20:10 input_select.yaml
-rw-r--r--  1 homeassistant homeassistant      1771 Apr 25 19:36 known_devices.yaml
-rw-r--r--  1 homeassistant homeassistant         0 Mar 22 20:09 lights.yaml
-rw-r--r--  1 homeassistant homeassistant        36 Mar 24 14:50 media_players.yaml
-rw-r--r--  1 homeassistant homeassistant       468 Apr 16 19:43 notify.yaml
drwxr-xr-x  2 homeassistant homeassistant      4096 Apr 21 20:40 packages
-rw-r--r--  1 homeassistant homeassistant         0 Mar 22 20:10 scenes.yaml
drwxr-xr-x  3 homeassistant homeassistant      4096 Mar 25 19:29 scripts
-rw-r--r--  1 homeassistant homeassistant         0 Mar 22 20:10 scripts.yaml
-rw-r--r--  1 homeassistant homeassistant       111 Mar 22 21:31 secrets.yaml
-rw-r--r--  1 homeassistant homeassistant      1065 Apr 15 11:15 sensors.yaml
-rw-r--r--  1 homeassistant homeassistant         0 Apr  1 20:07 shell_commands.yaml
-rw-r--r--  1 homeassistant homeassistant         0 Mar 29 19:12 switches.yaml
drwxr-xr-x  2 homeassistant homeassistant      4096 Apr 22 16:54 tts
-rw-r--r--  1 homeassistant homeassistant        44 Mar 22 19:33 .uuid

Check the log:
sudo su -s /bin/bash homeassistant
cd /home/homeassistant/.homeassistant
nano homeassistant.log

Check the Config:
sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
hass --script check_config

What’s displayed in the log?

If you can access the .homeassistant directory, copy out your .yaml files, then delete them from the .homeassistant directory, restart HASS and see if you can connect.

I’ve upgraded the Hassbian system. Still get the error, but I can still run HA (0.42.3).

I actually need to swap the Pi 3 in for my old Pi B that is actually running my system. That is stuck on a much older version (0.33.3) that I haven’t been able to upgrade either due to similar issues.

I’m lost “but I can still run HA (0.42.3)”?

If you are trying to move your config to another Pi, that’s a whole different story.

As far as I know, you can’t move file across versions, but I may be wrong, I never had to.

For the issue on the Pi3 you can try resetting the root password and login again.

nothing new in the log since hass does not start because the upgrade uninstalled it:


Uninstalling homeassistant-0.43.1:

an did not install the new version.

I will search for a way to reinstall homeassistant completely.
Anybody knows how to do it on hassbian?

New install=
https://home-assistant.io/docs/hassbian/installation/

If you can access the .homeassistant directory, copy out your .yaml files, then delete them from the .homeassistant directory, restart HASS and see if you can connect.

I didn’t ment a fresh installation of HASSBIAN, just HASS
/srv/homeassistant/…

Just delete everything from the .homeassistant directory.

0.43.2 up and running :grin:

rm -rf /srv/homeassistant/
$ sudo su -s /bin/bash homeassistant
$ cd /srv/homeassistant
$ python3 -m venv .
$ source bin/activate

$ pip3 install homeassistant
1 Like