core: ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140098482857688] Error handling message: {'id': 6517, 'type': 'subscribe_events'}

Home Assistant release with the issue:

0.84.0

Last working Home Assistant release (if known): 0.82.1

Operating environment (Hass.io/Docker/Windows/etc.): docker on centos

Component/platform: appears to be homeassistant.components.websocket_api.http.connection

Description of problem: After upgrade to 0.84.0 there is an error in the logs related to homeassistant.components.websocket_api.http.connection. Traceback below.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):


Traceback (if applicable):

2018-12-12 10:54:30 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140098482857688] Error handling message: {'id': 6517, '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'

Additional information:

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 5
  • Comments: 22 (5 by maintainers)

Most upvoted comments

Hi, I can confirm that @cytech’s solution works.

Here’s my appdaemon.yml:

log:
  accessfile: /home/pi/AppDaemon/logs/access.log
  errorfile: /home/pi/AppDaemon/logs/error.log
  logfile: /home/pi/AppDaemon/logs/appdaemon.log
  log_generations: 3
  log_size: 1000000
appdaemon:
  time_zone: America/Lima
  threads: 10
  plugins:
    HASS:
      type: hass
      ha_url: http://192.168.x.x:8123
      token: <long_live_token>

And here’s my configuration.yaml

homeassistant:
  # Authentication providers
  auth_providers:
   - type: homeassistant
   - type: legacy_api_password

http:
  api_password: !secret http_password
  server_port: 3000

Working with HA 0.84.1

I believe this is happening due to appdaemon trying to connect and failing. Here’s the error I see in the appdaemon log:

2018-12-13 06:31:25.293545 INFO Connected to Home Assistant 0.84.1
2018-12-13 06:31:25.315806 WARNING Unable to subscribe to HA events, id = 8172
2018-12-13 06:31:25.316836 WARNING {'id': 8172, 'type': 'result', 'success': False, 'error': {'code': 'unknown_error', 'message': 'Unknown error'}}
2018-12-13 06:31:25.317942 WARNING Disconnected from Home Assistant, retrying in 5 seconds
2018-12-13 06:31:25.319210 WARNING Scheduler clock skew detected - delta = 2.254889965057373 - resetting

Is everyone else running appdaemon as well?