Service failed with Hassbian out of the box

I’ve tried and failed to use Hassbian on a Raspberry Pi, with it seemingly not working as it should according to the docs.

After firing up the Pi with my freshly flashed microSD with Hassbian 1.1 as per the instructions I attempted to start Hass:

sudo systemctl stop [email protected]

There was no output, so I checked the status:

$ sudo systemctl status [email protected]
[email protected] - Home Assistant for homeassistant
Loaded: loaded (/lib/systemd/system/[email protected]; enabled)
Active: failed (Result: exit-code) since Sun 2017-03-12 11:01:49 UTC; 8s ago
Main PID: 1019 (code=exited, status=203/EXEC)

Mar 12 11:01:49 hassbian systemd[1]: Started Home Assistant for homeassistant.
Mar 12 11:01:49 hassbian systemd[1]: [email protected]: main process exited, code=exited, status=203/EXEC
Mar 12 11:01:49 hassbian systemd[1]: Unit [email protected] entered failed state.

After some searching I found a suggestion that the documentation was wrong - using the wrong user/bin dir - so I tried to follow these steps adjusting as necessary for what I actually saw on my Pi.

On my Pi, the install dir appeared to be /srv/homeassistant but of note was that there is no /srv/homeassistant/bin/hass present.

There is a /home/homeassistant directory but there is no /home/homeassistant/.homeassistant/ config dir.

I created /lib/systemd/system/[email protected] using the values that made sense based on what I had, and also created a blank /home/homeassistant/.homeassistant/configuration.yaml

Trying again to start Hass wasn’t any more or less successful:

[email protected] - Home Assistant
Loaded: loaded (/lib/systemd/system/[email protected]; enabled)
Active: failed (Result: exit-code) since Sun 2017-03-12 11:15:42 UTC; 9s ago
Process: 1217 ExecStart=/srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant (code=exited, status=203/EXEC)
Main PID: 1217 (code=exited, status=302/EXEC)

Mar 12 11:15:42 hassbian systemd[1]: Started Home Assistant.
Mar 12 11:15:42 hassbian systemd[1]: [email protected]: main process exited, code=exited, status=203/EXEC
Mar 12 11:15:42 hassbian systemd[1]: Unit [email protected] entered failed state.

I have a bunch of questions/concerns;

  • Is my installation dir correct?
  • Why is there no /srv/homeassistant/bin/hass?
  • Why is there no /home/homeassistant/.homeassistant/configuration.yaml?
  • What user should I be using - pi or homeassistant?
  • Did I not flash the image onto my microSD correcty (I used the instructions linked above and there were no errors)?
  • How can I get Hass started and working as expected?

Thanks

I’m having the exact same problem with a RPI 3B. Hassbian 1.1 and HASS 0.40.

I’m not a hassbian user, but I had a few questions that might clarify some things:

  • Why are you calling systemctl stop in order to start the service?

  • When checking for existence of config directory, did you use ls -a in order to show the hidden directory?

  • Did you look in /etc/systemd/system/ for the service file?

Also, rather than diving through all these checks, I’d start by flashing a new uSD card and trying again. Much of what you are describing above might be a result of a bad flash.

Why are you calling systemctl stop in order to start the service?

Because I am rubbish at copy/pasting the right things :wink:

When checking for existence of config directory, did you use ls -a in order to show the hidden directory?

I actually used ls -al

Did you look in /etc/systemd/system/ for the service file?

I did not.

I’ve just re-flashed and tried again. Exact same behaviour, and the flashing process reports it completed successfully (again).

I can confirm the exact same problem. I’ve reflashed. It appears something is causing the initial installation to fail midway through the process. Is there a way to check a log for the initial hassbian first install?

I ended up flashing my SD card with Raspbian and then installing Hass using the Raspberry Pi All in One Installer which worked straight away with no issues.