Unauthorized

HADashboard suddenly died on my with this message. I haven’t done any specific changes and I’m not able to connect to Hass.

Edit: It gives me this message also but when I try to press a button to trigger a scene the error is showing up

2018-07-23 19:50:02.695862 INFO AppDaemon: HASS: Connected to Home Assistant 0.73.2
> 2018-07-23 19:44:40.639559 WARNING HADasboard: ------------------------------------------------------------
> 2018-07-23 19:44:40.640156 WARNING HADasboard: Unexpected error in call_service()
> 2018-07-23 19:44:40.641790 WARNING HADasboard: ------------------------------------------------------------
> 2018-07-23 19:44:40.644942 WARNING HADasboard: Traceback (most recent call last):
>   File "/usr/lib/python3.6/site-packages/appdaemon/rundash.py", line 341, in call_service
>     await plugin.call_service (service, **args)
>   File "/usr/lib/python3.6/site-packages/appdaemon/plugins/hass/hassplugin.py", line 360, in call_service
>     r.raise_for_status()
>   File "/usr/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 718, in raise_for_status
>     headers=self.headers)
> aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized'

no change in HASS? no update or anything?
did you restart HASS?
did you restart everything?

I am getting the same error. But only when trying to press a button in the dashboard. Been using the dashboard for months without issue. Rebooted the entire system and still got the same error. Home Assistant is detecting each button press as a failed login attempt. Currently running on a pi 3 hassio and the appdaemon addon.

Edit: Downgraded to 0.73.1 and the same result

Did you make any attempt to use the new user based auth with home assistant? ( think it was introduced in 0.73)

Had same issue. Went into appdaemon.yaml file and set ha_url and ha_key to correct settings and restarted app daemon. Issue now resolved

Started happening for me as well - “read-only” operations work in HADasboard and apps but mutating (button or notify) fail with unauthorized error. I’m on 0.74, but it started to fail suddenly.

How did you modify it?
What did you change?

I have same error!!

/Steffen

for those who tried to use the new authorisation method in home assistant (with username and password)
that is not yet supported in appdaemon.

I had the same issue. I just disabled passwords all together because appdaemon is running all my motion lights.

My appdaemon.yaml file was located in the appdaemon folder I use configurator to change the file but use whatever you use to change your config files.
ha_url had http://hassio/homeassistant I changed this to my hassio url
ha_key I put in the password I use when I login.
Restarted appdaemon and no more errors

I have not enabled new HA auth system and the authorization error started popping up out of the sudden (i.e. not immediatly after 0.74 update).
I can confirm that setting ha_key in appdeamon.yaml did actually fix the authorization issue, however now I wonder how did it work in the past ? What auth mechanism does Appdeamon use against HA API ? Note that I’m not using trusted_networks in http config. Appdeamon runs on the same host as HA. (@awarecan FYI)

you are probably using hassio.

the hassio addon that installs appdaemon also changes the appdaemon configuration.
appdaemon needs the url and pasword from HA and uses the HA API.

Hi thanks for the quick reply.

The problem persists. However with a twist.

I have changed the HA Key in the appdeamon.yaml file. To my PW for HA. But when I restart the service the HA key is switched back to:

ha_key: de10f0e29fc74fce…

and my changes are removed.

I have also tried to remove the appdeamon plugin and reinstall.

/Steffen

Note:
When I restart after changes to ha key i get this message in the Appdeamon log
INFO: ha_key is missing in the AppDaemon configuration, fixing…

Info: I’m using HassIO

I am having the same problem with AppDaemon on Hassio. It started this morning - can it be something with the hass.io supervisor, because I read in another thread that it was being updated to version 118, and I can see mine is 118, but I don’t know when that has been updated.

Changing the password only lasts to a reboot. I have changed absolutely nothing in my setup since yesterday.

+1

Nothing’s changed, no updates performed in at least a week, it just stopped working.

Somehow kept crashing my Hassio as well, so I’ve disabled AppDeamon for now.

Exactly the same here,

Update:

If I remove authorization everything seems to work. The dashboard can control my devices.

configuration.yaml
#api_password: !secret http_password

So the question remains, how do I get by authorization and HADashboard running at the same time?

/Steffen

Was able to get it working again. I changed the ha_url from http://hassio/homeassistant to https://yourdomain.duckdns.org and changed the ha_key to my api_password. Seems like one of the later updates changed the way http://hassio/homeassistant authentication works.

1 Like

this is a hassio addon problem.
i suggest that the people who keep having problems with this open a thread in the hassio section and ask frenck to look at it.

i think you are right @Morten_DK

This worked to get it back up and running again.

Thank you! :+1: