Installation of new version 0.48 failed on Rapberry PI 3

Hi,

I’ve just tried to update my PI 3 with latest 0.48 version of HA. The previous installed version was 0.47.1
My initial configuration was flashed to a SD card from installation package available at HA website.
I ran the proposed updated method and was logged as PI

I previously did a system update (sudo apt-get update / apt-get -y upgrade) without any issue.

Please find, at the bottom of this post, a copy/paste of the exception when installing the update:
This is apparently a permission denied error

Ca someone help me figured out what’s happening and out to get rid of it?

Many thanks in advance,

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/multidict-3.0.0.egg-info’ -> ‘/tmp/pip-zkq6fgia-uninstall/srv/homeassistant/lib/python3.4/site-packages/multidict-3.0.0.egg-info’

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 532, in move
rmtree(src)
File “/usr/lib/python3.4/shutil.py”, line 463, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File “/usr/lib/python3.4/shutil.py”, line 421, in _rmtree_safe_fd
onerror(os.unlink, fullname, sys.exc_info())
File “/usr/lib/python3.4/shutil.py”, line 419, in _rmtree_safe_fd
os.unlink(name, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: ‘PKG-INFO’

It is not entirely clear which installation method you used, but none of them I know have the user as Pi. Normally its user homeassistant.

The upgrade guide for hassbian shows how to switch user before doing the installation.

I know this may not be super helpful, but I used the AIO installer and the .48 installation went perfectly following the upgrade instructions here.

How to Update Home Assistant AIO HASSPIAN RPI

Log in as the pi account and execute the following commands:

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]

Hi,

Thank you for your answers and your help.

I finally missed this one:

sudo su -s /bin/bash homeassistant

It’s now running 0.48 like a charm.

Cheers,

I am too going from 47.1 to 48.1
I am running the sudo su - /bin/bash homeassistant
I also ran

sudo apt-get update
sudo apt-get -y upgrade

I ran the install twice and it seem to error out at the same place. Any thoughts?
Here is a screen shot showing both commands and errors.

pi@hassbian:~ $ sudo systemctl start [email protected]
pi@hassbian:~ $ sudo systemctl stop [email protected]
pi@hassbian:~ $ sudo su -s /bin/bash homeassistant
homeassistant@hassbian:/home/pi $ source /srv/homeassistant/bin/activate
(homeassistant) homeassistant@hassbian:/home/pi $ pip3 install --upgrade homeassistant
Collecting homeassistant
  Downloading homeassistant-0.48.1-py2.py3-none-any.whl (7.2MB)
    14% |████▋                           | 1.0MB 3.0kB/s eta 0:34:33Exception:
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 232, in _error_catcher
    yield
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 314, in read
    data = self._fp.read(amt)
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 60, in read
    data = self.__fp.read(amt)
  File "/usr/lib/python3.4/http/client.py", line 500, in read
    return super(HTTPResponse, self).read(amt)
  File "/usr/lib/python3.4/http/client.py", line 539, in readinto
    n = self.fp.readinto(b)
  File "/usr/lib/python3.4/socket.py", line 371, in readinto
    return self._sock.recv_into(b)
  File "/usr/lib/python3.4/ssl.py", line 745, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/lib/python3.4/ssl.py", line 617, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

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 324, in run
    requirement_set.prepare_files(finder)
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/req/req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/download.py", line 821, in unpack_url
    hashes=hashes
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/download.py", line 659, in unpack_http_url
    hashes)
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/download.py", line 882, in _download_http_url
    _download_url(resp, link, content_file, hashes)
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/download.py", line 603, in _download_url
    hashes.check_against_chunks(downloaded_chunks)
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/utils/hashes.py", line 46, in check_against_chunks
    for chunk in chunks:
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/download.py", line 571, in written_chunks
    for chunk in chunks:
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/utils/ui.py", line 139, in iter
    for x in it:
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/download.py", line 560, in resp_read
    decode_content=False):
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 357, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 324, in read
    flush_decoder = True
  File "/usr/lib/python3.4/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/srv/homeassistant/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 237, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.
(homeassistant) homeassistant@hassbian:/home/pi $ exit
exit
pi@hassbian:~ $ sudo systemctl start [email protected]
pi@hassbian:~ $

Update: After running through the steps again

Upgrading Hassbian
sudo apt-get update
sudo apt-get -y upgrade

Update HASS on 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]

This time the update loaded, but did not come up. Log looked like an issue with zwave. So I rem out the :zwave and /dev/zwave (that was working on 47.1) and it came up. I seem to see something about zwave and I know .48 has the new entities programing, so I will go and look at some of that before posting anything else.

After googling did not find any thing, so starting trying things on my own.
I even did a shutdown/power on, it would not start. The last thing I did was while the pi3 was booted and running, I pulled the zwave device and plugged it back in. Started HASS and it came up and I can control the zwave devices.
Not sure what just happened here?