jcuccia
December 15, 2018, 5:05pm
1
Hello.
I just upgraded to v0.84.2 and am getting the following error message. What’s going on?
2018-12-15 11:03:49 INFO (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 172.17.0.2 (auth: False)
2018-12-15 11:03:49 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.139640661972808] Error handling message: {'id': 153, 'type': 'subscribe_events'}
Traceback (most recent call last):
File "/usr/src/app/homeassistant/components/websocket_api/connection.py", line 66, in async_handle
handler(self.hass, self, schema(msg))
File "/usr/src/app/homeassistant/components/websocket_api/commands.py", line 102, in handle_subscribe_events
if not connection.user.is_admin:
AttributeError: 'NoneType' object has no attribute 'is_admin'
1 Like
jcuccia
December 15, 2018, 5:15pm
2
Further to this, I’m running HA in a docker container on Ubuntu. I’m also running containers for MQTT and appdaemon. The error seems to be related to docker’s internal network, as appdaemon can no longer connects to HA. Must have been a breaking change I missed? Something in the auth system?
Thanks.
bbrendon
(bbrendon)
December 15, 2018, 5:20pm
3
Appdaemon requires a token instead of the api password as of 84.
1 Like
jcuccia
December 15, 2018, 5:21pm
4
And I guess these will be useful. My appdaemon.yaml file:
secret: /config/secrets.yaml
log:
logfile: /conf/appdaemon/appdaemon.log
errorfile: /conf/appdaemon/appdaemon.log
accessfile: /conf/appdaemon/appdaemon.log
log_generations: 3
log_size: 500000
appdaemon:
threads: 10
disable_apps: 1
plugins:
HASS:
type: hass
ha_url: http://192.168.2.243:8123
ha_key: xxxxxxxxx
hadashboard:
dash_url: http://192.168.2.243:5050
dash_dir: /conf/dashboards
docker-compose.yaml
version: '3.7'
services:
mqtt:
image: eclipse-mosquitto
container_name: MQTT
restart: always
ports:
- 1883:1883
volumes:
- /home/jcuccia/docker_files/mqtt/data:/mosquitto/data
- /home/jcuccia/docker_files/mqtt/config:/mosquitto/config
- /home/jcuccia/docker_files/mqtt/log:/mosquitto/log
network_mode: host
homeassistant:
image: homeassistant/home-assistant
container_name: home-assistant
restart: always
depends_on:
- mqtt
volumes:
- /home/jcuccia/docker_files/hass:/config
- /etc/localtime:/etc/localtime:ro
- /root/.ssh:/root/.ssh
devices:
- /dev/ttyACM0:/dev/ttyACM0
network_mode: host
And my script to start appdemon, which I can’t get to work with docker-compose):
docker run --name=appdaemon -d -p 5050:5050 \
--restart=no \
-e HA_URL="http://192.168.2.243:8123" \
-e HA_KEY="xxxxxxxx" \
-v /home/jcuccia/docker_files/hass/:/conf \
acockburn/appdaemon:latest
Thanks again.
jcuccia
December 15, 2018, 5:40pm
5
This is sorted out. I changed AppDaemon’s access to a long-lived token and added location info (latitude/longitude/elevation) to appdaemon.yaml and it’s all working.
jcuccia
December 15, 2018, 5:41pm
6
Yes, that fixed it, thanks.
bbrendon
(bbrendon)
December 15, 2018, 6:24pm
7
Awesome. I checked the release notes on 84 and didn’t see anything about this. Go figure. Oh well, we are both back up and running!
Jiran
(Jiran)
December 16, 2018, 1:55pm
8
@jcuccia posted appdaemon.yaml is the one working fine? If not could you please post the running one? Not sure where to define token instead of password.
jcuccia
December 16, 2018, 2:11pm
9
This one works.
log:
logfile: /conf/appdaemon/appdaemon.log
errorfile: /conf/appdaemon/appdaemon.log
accessfile: /conf/appdaemon/appdaemon.log
log_generations: 3
log_size: 500000
appdaemon:
threads: 10
disable_apps: 1
plugins:
HASS:
type: hass
ha_url: http://192.168.2.243:8123
token: xxxxxxxxxxxxxxxxxxxxxxxxx
hadashboard:
dash_url: http://192.168.2.243:5050
dash_dir: /conf/dashboards
1 Like