Hass.io problems after power outage

That is not my situation. The sidebar is still there and works fine but “Hass.io” gets me “Unable to load the hass.io panel from the supervisor”. With no access to the hass.io I cannot reach the addons (ssh, samba, mosquito, and LetsEncrypt), and my encryption certificate expires in just over two weeks. When that happens, I will have no access via the web to home assistant at all, unless there’s a work around to turn encryption off

That did the trick! I just added “hassio:” to my configuration.yaml et voilá, the “Hass.io” button is back again.

But: I still can’t use any “hassio” ssh-command. It’s still saying “parse error: Expected string key before ‘:’ at line 1, column 4”. Therefore no save reboot is possible.

This doc

https://developers.home-assistant.io/docs/en/hassio_debugging.html

mentions you can access the docker command to access the supervisor

docker logs resin_supervisor

Perhaps you are able to use the docker command to view what’s going on or even restart the supervisor container?

BTW do this at your own risk!

I had the same problem a week back, but that was fixed by doing a reboot by disconnecting power to the Pi

I can reach the logs from docker. One hint might be:
“[homeassistant.components.hassio] /homeassistant/options return code 401.” in the log. Also:
“[homeassistant.components.hassio] /supervisor/options return code 401.”
These mirror the results from some hassio commands in the shell.

For me it changed nothing.

Now i get

pare error: Expected string key before ':' at line 1, column 4

or

401: Unauthorized

if i hit any “hassio […]” command per ssh

I am logging into the resinOS above the HA system and running docker commands.

I never got any answers (lots of suggestions that didn’t work but thanks to all who tried) to how to fix this problem, so I am running a new HA system on a Raspberry Pi 3 B+ using the install method from https://github.com/dale3h/hassio-installer. I had to go through and work out the bugs in MQTT and LetsEncrypt, and I still do not have ssh running, but the system otherwise seems to be working.

Did you ever find a fix for this issue? I’m only able to restart via the hass.io web section and not via the Command line. Getting similar error as you

hassio -d ha info
**Error decoding json invalid character ':' after top-level value: 401: Unauthorized**

I did some digging and the Supervisor docker image logs have this:

18-09-27 23:38:59 WARNING (MainThread) [hassio.api.security] No API token provided for 
/homeassistant/info

So it looks like the hassio command isn’t passing a proper API key to the supervisor…

Did anyone ever find a fix for this issue? I started facing it this morning and things seem to have gotten worse. At first I was able to log in through SSH and every time I tried running a hassio command I would get an error like
Error decoding json invalid character ':' after top-level value: 403: Forbidden

This morning I was unable to log into SSH, and the log of the SSH & Web Terminal addon shows:

[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: SSH & Web Terminal v3.5.0
 SSH & Web Terminal access to your Home Assistant instance
parse error: Expected string key before ':' at line 1, column 4
ERROR: Unknown HTTP error occured
 From: 
parse error: Expected string key before ':' at line 1, column 4
ERROR: Unknown HTTP error occured
 By: 
-----------------------------------------------------------

So it’s not starting properly either. I looked at the logs and found this entry:

18-10-06 17:22:26 ERROR (MainThread) [hassio.api.security] Invalid token for access /addons

Which makes sense because trying to download a snapshot gives me a browser error that says:
Firefox can’t find the file at http://hassio:8123/api/hassio/snapshots/7eae17b5/download?api_password=undefined.

I think @ryanb33 is right in the API key issue but I have no idea where to start to try and fix it.

So… a few minutes after posting my above message I was able to fix the API key!

Random AF, but when I got the link to download the snapshot, I went into my local secrets file and put in the API password I had configured into the URL to download the snapshot.

http://hassio:8123/api/hassio/snapshots/7eae17b5/download?api_password=PASSWORD_HERE

The file downloaded and I thought nothing of it. Then I tried rebooting the SSH server again, and it worked! After that I SSH’d in and tried running a few hassio commands, and they also worked!

It seems like the API password was re-set and saved when I provided it through snapshot URL. Give that a shot guys, it might just work :slight_smile:

So I figured out what my issue was and I was missing the OS variable HASSIO_TOKEN due to modifying the default login shell. To check to see that you have this variable set, simply run this in the shell:
user@host$ echo $HASSIO_TOKEN

It just returns an empty line :confused:

core-ssh:~# echo $HASSIO_TOKEN

core-ssh:~#

When I had that variable missing it wasn’t working, I configured it and it worked immediately . To fix I copied the HASSIO_TOKEN from the correctly working shell, which in my case was zsh vs bash so it was easy to obtain - simply log into the zsh shell and run the previous command:
echo $HASSIO_TOKEN
to set on missing shell save the output of that command into your shell startup params (.bash_profile, .bashrc etc.)

Little update on this: I just figured out the following on my Hassio System-Logfile (Webfrontend -> Hassio -> System):

18-10-13 14:41:48 WARNING (MainThread) [hassio.api.security] No API token provided for /host/shutdown

It seems that ryanb33 pointed out the actual problem. I’m going to give his solution a try in the next days. But how do i use another shell? Sorry, i’m a little unix-noob :confused:

@blackmesa Did you get this figured out? I am experiencing this same issue and am unsure how to proceed.

Thanks!

Hey folks,

I never solved this problem with the missing API token. Because just a few days after my last posting my file system on the sd card got broken (https://community.home-assistant.io/t/my-hassio-crashed-over-night-file-system-seems-to-be-read-only/73374. Due to that error i got to set up my hassio-system again. This time I used the new version based on HassOS instead of ResinOs. I works perfectly with none of the issues I experienced before :wink:

That’s what I ended up ding as well :confused: oh well the newer versions are very slick!

This power outage and getting HASSIO totally broken happened to me several times now. I had to flash a new IMG on the SD card and restore from backup :confused:

Yes, this happened to me several times. I suspect Docker to be the root cause. You need an UPS for running Docker based systems. At least this is what some suggest in the WWW. Docker is made for data centers, not for devices that can have power outages without proper shutdown.