Home assistant service not starting on new hassbian install

I downloaded image_2018-10-27-Hassbian and used etcher to put it on a 16gig samsung class 10 microsd. When I boot it in my pi 3 B it gets to the login and after waiting at least 30 minutes and trying this a few times (re-etching, formating the sd with diskpart and re-etching) , it never starts the home assistant service.

I did this:

If you find that the web page is not reachable after 30 minutes or so, check that you have files in /home/homeassistant/.homeassistant/ , if there are no files in this location then run the installer manually using this command: sudo systemctl start install_homeassistant.service .

and there are no files and it wonā€™t download them either. Iā€™m connected to my network with ethernet and can ssh in. I can ping google fine. I also didnā€™t have a problem running and installing hassio previously.

I just canā€™t get it to download homeassistant. I copy paste this exact command ā€œsudo systemctl start install_homeassistant.serviceā€ and it does something for a few seconds and then goes back to the command prompt. No files are in the /home/homeassistant directory

Iā€™ve had hassio running on this pi 3 b but want to use hassbian instead.

It should work but doesnā€™t. Iā€™m not well versed enough to know if/what log in var/logs would tell me something

Any hints/tips/pointers would be greatly appreciated

Can you paste the output of

systemctl status [email protected]

and

ls -alR /home/homeassistant/.homeassistant/
pi@hassbian:~ $ systemctl status [email protected]

ā— [email protected] - Home Assistant for homeassistant
Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2018-11-09 17:17:59 UTC; 9min ago
Process: 1251 ExecStart=/srv/homeassistant/bin/hass (code=exited, status=203/EXEC)
Main PID: 1251 (code=exited, status=203/EXEC)

Nov 09 17:17:59 hassbian systemd[1]: Started Home Assistant for homeassistant.
Nov 09 17:17:59 hassbian systemd[1]: [email protected]: Main process exited, code=exited, status=203/EXEC
Nov 09 17:17:59 hassbian systemd[1]: [email protected]: Unit entered failed state.
Nov 09 17:17:59 hassbian systemd[1]: [email protected]: Failed with result ā€˜exit-codeā€™.

and

ls: cannot access ā€˜/home/homeassistant/.homeassistant/ā€™: No such file or directory

I tried formatting with sdformatter and using diskimager32 this time and now it started and said

services:
home-assistant@homeassistant: inactive (the messages above are from this new try at install)
instead of failed

Iā€™m sorry if I formatted this message wrong.

Just doesnā€™t seem to want to download or put things in the homeassistant directory. I thought this image had the download already? But what do I knowā€¦

Itā€™s very odd.

Edit I did try to start the download manually again but it does the same thing, sits for 3-5 seconds then goes back to the prompt, no messages.

It looks like you may have had some connection issues on first boot, try to run this sudo hassbian-config install homeassistant --force

2 Likes

pi@hassbian:/ $ sudo hassbian-config install homeassistant --force
Home Assistant install script for Hassbian.
Copyright(c) 2017 Fredrik Lindqvist https://github.com/Landrash.

Changing to the homeassistant user
Creating Home Assistant venv
Error: [Errno 13] Permission denied: ā€˜/srv/homeassistant/includeā€™
Changing to Home Assistant venv
/bin/bash: line 6: /srv/homeassistant/bin/activate: No such file or directory
Installing latest version of Home Assistant
Traceback (most recent call last):
File ā€œ/usr/bin/pip3ā€, line 9, in
from pip import main
ImportError: cannot import name ā€˜mainā€™
Traceback (most recent call last):
File ā€œ/usr/bin/pip3ā€, line 9, in
from pip import main
ImportError: cannot import name ā€˜mainā€™
Deactivating virtualenv
/bin/bash: line 13: deactivate: command not found
Enabling Home Assistant service
Disabling the Home Assistant install script
Starting Home Assistant
Checking the installationā€¦

Installation failedā€¦

For the heck of i tried

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

It downloaded a few things but not enough to make HA install, if that was even part of the problem.

This is the first thing that goes wrong - and it is odd. Can you post the output of

ls -l /srv

just to see what the permissions on the directory is now.

pi@hassbian:~ $ ls -l /srv
total 4
drwxr-xr-x 3 root root 4096 Nov 9 17:10 homeassistant

Iā€™m not sure how it got those permissions, but is should be possible to fix it with

sudo chown homeassistant:homeassistant /srv/homeassistant
sudo hassbian-config install homeassistant --force

This is all very odd though.

1 Like

Thats the ticket! I can assure you I never messed with any permissions, so yes, it is odd as heck. Iā€™m expecting my shiny new 128gb uh3 sdcard tomorrow and if it works without having to chown, Iā€™ll update here.

But that worked, it installed, took about 10 minutes before I could access the create account page (as expected) and now I poke and prod and learn the intricacies of HA.

Thank you very much!

1 Like

Why does HA hate me so much? I tried to setup my new sdcard and had to chown again but this time the install fails differently. I even tried repeating other steps like sudo apt-get update and sudo apt-get upgrade but now I am stuck getting this:


    pi@hassbian:~ $ sudo chown homeassistant:homeassistant /srv/homeassistant
pi@hassbian:~ $ sudo hassbian-config install homeassistant --force
Home Assistant install script for Hassbian.
Copyright(c) 2017 Fredrik Lindqvist <https://github.com/Landrash>.

Changing to the homeassistant user
Creating Home Assistant venv
Changing to Home Assistant venv
Installing latest version of Home Assistant
Requirement already satisfied: setuptools in /srv/homeassistant/lib/python3.5/site-packages
Requirement already satisfied: wheel in /srv/homeassistant/lib/python3.5/site-packages
Collecting homeassistant
  Using cached https://files.pythonhosted.org/packages/8c/eb/a7d1205eb765eca7f755bc967ae2f79e4d10b20a498a5cef8a82c8e0fc4f/homeassistant-0.82.0-py3-none-any.whl
Collecting pyyaml<4,>=3.13 (from homeassistant)
  Downloading https://www.piwheels.org/simple/pyyaml/PyYAML-3.13-cp35-cp35m-linux_armv7l.whl (42kB)
Collecting cryptography==2.3.1 (from homeassistant)
  Using cached https://www.piwheels.org/simple/cryptography/cryptography-2.3.1-cp35-cp35m-linux_armv7l.whl
Collecting astral==1.7.1 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/bb/0c/25701e9afad088d9873889fba0c45b0fbf8097c7e2ecf8d9b40a71985124/astral-1.7.1-py2.py3-none-any.whl
Collecting voluptuous==0.11.5 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/59/95/fa6218477c6999c9b7fdfab7c12c1bd4da2d5930f5eb2b232ec74eb344e7/voluptuous-0.11.5-py2.py3-none-any.whl
Collecting certifi>=2018.04.16 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/56/9d/1d02dd80bc4cd955f98980f28c5ee2200e1209292d5f9e9cc8d030d18655/certifi-2018.10.15-py2.py3-none-any.whl
Collecting aiohttp==3.4.4 (from homeassistant)
  Using cached https://www.piwheels.org/simple/aiohttp/aiohttp-3.4.4-cp35-cp35m-linux_armv7l.whl
Collecting async-timeout==3.0.1 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/e1/1e/5a4441be21b0726c4464f3f23c8b19628372f606755a9d2e46c187e65ec4/async_timeout-3.0.1-py3-none-any.whl
Requirement already satisfied: pip>=8.0.3 in /srv/homeassistant/lib/python3.5/site-packages (from homeassistant)
Collecting ruamel.yaml==0.15.72 (from homeassistant)
  Using cached https://www.piwheels.org/simple/ruamel-yaml/ruamel.yaml-0.15.72-cp35-cp35m-linux_armv7l.whl
Collecting jinja2>=2.10 (from homeassistant)
  Downloading https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl (126kB)
Collecting requests==2.20.0 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/f1/ca/10332a30cb25b627192b4ea272c351bce3ca1091e541245cccbace6051d8/requests-2.20.0-py2.py3-none-any.whl
Collecting PyJWT==1.6.4 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/93/d1/3378cc8184a6524dc92993090ee8b4c03847c567e298305d6cf86987e005/PyJWT-1.6.4-py2.py3-none-any.whl
Collecting voluptuous-serialize==2.0.0 (from homeassistant)
  Downloading https://www.piwheels.org/simple/voluptuous-serialize/voluptuous_serialize-2.0.0-py3-none-any.whl
Collecting bcrypt==3.1.4 (from homeassistant)
  Downloading https://www.piwheels.org/simple/bcrypt/bcrypt-3.1.4-cp35-cp35m-linux_armv7l.whl (52kB)
Collecting pytz>=2018.04 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/f8/0e/2365ddc010afb3d79147f1dd544e5ee24bf4ece58ab99b16fbb465ce6dc0/pytz-2018.7-py2.py3-none-any.whl
Collecting attrs==18.2.0 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/3a/e1/5f9023cc983f1a628a8c2fd051ad19e76ff7b142a0faf329336f9a62a514/attrs-18.2.0-py2.py3-none-any.whl
Collecting idna>=2.1 (from cryptography==2.3.1->homeassistant)
  Downloading https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl (58kB)
Collecting six>=1.4.1 (from cryptography==2.3.1->homeassistant)
  Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography==2.3.1->homeassistant)
  Downloading https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)
Collecting cffi!=1.11.3,>=1.7 (from cryptography==2.3.1->homeassistant)
  Downloading https://www.piwheels.org/simple/cffi/cffi-1.11.5-cp35-cp35m-linux_armv7l.whl (304kB)
Collecting multidict<5.0,>=4.0 (from aiohttp==3.4.4->homeassistant)
  Downloading https://www.piwheels.org/simple/multidict/multidict-4.4.2-cp35-cp35m-linux_armv7l.whl (373kB)
Collecting yarl<2.0,>=1.0 (from aiohttp==3.4.4->homeassistant)
  Downloading https://files.pythonhosted.org/packages/43/b8/057c3e5b546ff4b24263164ecda13f6962d85c9dc477fcc0bcdcb3adb658/yarl-1.2.6.tar.gz (159kB)
Collecting chardet<4.0,>=2.0 (from aiohttp==3.4.4->homeassistant)
Exception:
Traceback (most recent call last):
  File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
    chunked=chunked)
  File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 391, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 387, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.5/http/client.py", line 1198, in getresponse
    response.begin()
  File "/usr/lib/python3.5/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/commands/install.py", line 353, in run
    wb.build(autobuilding=True)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/index.py", line 465, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/index.py", line 423, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/index.py", line 568, in _get_pages
    page = self._get_page(location)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/index.py", line 683, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/index.py", line 792, in get_page
    "Cache-Control": "max-age=600",
  File "/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
    return self.request('GET', url, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/download.py", line 386, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/srv/homeassistant/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
    total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
Deactivating virtualenv
Enabling Home Assistant service
Disabling the Home Assistant install script
Starting Home Assistant
Checking the installation...

Installation failed...

If you have issues with this script, please say something in the #devs_hassbian channel on Discord.
pi@hassbian:~ $
1 Like

Looks like a network problem.

Seems Iā€™m behind a double nat which Iā€™m not certain I can get rid of. I was able to dmz the pi and I just finished the install.

Installation done..

Your Home Assistant installation is running at 192.168.1.226:8123 or if preferred http://hassbian.local:8123

2 Likes

I have the exact same issue. Downloaded image_2018-10-27-Hassbian, burned it an Sandisk card with Etcher and booted up on the RPi 3+ just fine. No home assistant running, even after a while.
Checked the directory as in this thread and it had the same permissions for root only.
Ran the chown command and restarted the setup and itā€™s moving along nicely now.
//Matt

I have the same issue as well:
64GB Sandisk Ultra SD, Raspberry Pi 3B+, image_2018-10-27-Hassbian.zip, had to chown. Ran the install command again and it seems to work now.

Had Hassio running fine on the same SD & RPi before I moved to Hassbian.

I ran into this issue as well. It looks like the install_homeassistant.service does not start properly over wifi. I tried several time using and using systemctl status would show that the service would fail to start.

I flashed a new image and kicked it off connected via wire to Ethernet and everything launched as expected!

Seems like there may be a timing issue where wifi isnā€™t fully connected before the install_homeassistant.service is.

If you are experiencing this issue I would encourage to spin up a freshly flashed SD card and launch when connected via wire.

Iā€™ve run into a similar issue - Iā€™m using a Raspberry Pi B+ (very slow!) but it seems to boot, with the similar timeout issue in the first post - looking through the logs it talks about timing out after getting online (connectivity checked, itā€™s a bit slow but should not cause timeouts, and Iā€™m hardwired to the router). I tried restarting the installer service but it again timed out. After a reboot to just make sure that it was not something else it seems to have deleted itself almost entirely? The homeassistant user does not have a .homeassistant folder, thereā€™s nothing in /srv/ and I canā€™t run hassbian-config (it does not exist) - Iā€™ve tried twice with different SD cards and Iā€™m going to try a fresh install now on top of raspbian lite - fwiw: I managed to get the hassio image to work on this setup but it was just incredibly slow (as you can imagine) - hoping for a minor speed boost by removing some layers of virtualisation.

Hi @zimchaa . Got the same issue on first try today. And

helped me.

In case you try to use homeassistant on top of raspbian - it would be slower rather hasspbian.
Cheers.

Iā€™ve run into the same issue. Iā€™m using a RPI B+ too. The image is image_2018-10-27-Hassbian.zip
After a while, iā€™ve connected to RPI by PuTTY and did some command, ping some webpages (included home-assistant.io) and everything is ok.
But no HA:

  • I tried to access 192.168.0.xxx:8123 in the Chrome but nothing (This site canā€™t be reached).
  • I tried: sudo systemctl start install_homeassistant.service
    but got the error: Failed to start install_homeassistant.service: Unit install_homeassistant.service not found.
  • I tried: sudo hassbian-config install homeassistant --force
    but got the error: sudo: hassbian-config: command not found

I donā€™t know whatā€™s wrong with it? Hope some help.
Thanks very much!


Iā€™ve installed another image image_2018-03-16-Hassbian.zip and itā€™s Ok.

I am having this same damn problem!

First it was the wifi. Then the SD card. Now this error!

How did you ā€œDMZā€ your Pi?

same problem for hassbian 2018-10-27 image. Type your command and it work. Thanks!