Instalation Problem

I am trying to install Home Assistant on a Pi 3 with the latest Raspbian using the guide on https://home-assistant.io/docs/installation/virtualenv/
Following the instructions, I get to the line

python3 -m venv /srv/homeassistant

and this returns

Error: [Errno 13] Permission denied ‘/srv/homeassistant/pyvenv.cfg’

Initially although I had performed the chown on homeassistant, everything created in the directory was own by root. I chowned that to homeassistant, but it made no difference.
What have I done wrong?

Regards, Paul Dixon

1 Like

Same, or similar problem here when trying a new install on RPi3 on Debian Stretch 9.1.

Mine says Error: [Errno 13] Permission denied: '/srv/homeassistant/include'

I tried first installing python3-venv

sudo apt-get apt-get install python3-venv

then using sudo

sudo python3 -m venv /srv/homeassistant

And the setting ownership again, but recursively

sudo chown -R homeassistant:homeassistant /srv/homeassistant

Before continuing with switching to homeassistant user and installing. This installed home assistant, but then I got an error when running (output of homeassistant.log)

2017-12-10 09:37:14 WARNING (Thread-10) [homeassistant.components.light.hue] Connected to Hue at 192.168.0.10 but not registered.
2017-12-10 09:45:01 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_protocol.py", line 271, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method

And I’ve got no clue about what to do about that. Did I screw everything up? Anyone have any ideas?

The installation instructions have an error regarding which user to run the python3 -m venv /srv/homeassistant command as.

Revised instructions are currently at https://github.com/home-assistant/home-assistant.github.io/commit/a757a34c4005c0326c5bb0a81e7687927ba36f13

If you can try them out, it would be useful.

1 Like

Thanks for the note @gpbenton.

I still have issues when changing to homeassistant user before making /srv/homeassistant a virtualenv. Could it be because I upgraded to python 3.6.3 before starting (basically using this guide; upgrading python version seems to work fine)?

I will test with a clean Raspbian Stretch Lite installation (python 3.5) when I have time.

Its unlikely different versions of python would cause a permissions problem.

The new instructions do specify changing the ownership of /srv/homeassistant to homeassistant user immediately after creating it, and then creating the virtual environment as homeassistant user, which should avoid permissions problems.

I can confirm that the new instructions work with Raspbian Stretch Lite. It also works after upgrading to python3.6.3, but I then get an error in the log:

2017-12-16 12:15:04 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 271, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2017-12-16 12:15:04 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 271, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2017-12-16 12:15:04 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 271, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method

Not sure what the effect is; I haven’t set up my old configuration yet. So far, I haven’t found anything not working.