Core: Apple TV errors filling up logs

Created on 25 Mar 2017  路  10Comments  路  Source: home-assistant/core

Home Assistant release (hass --version): 0.40.2

Python release (python3 --version): 3.4.2

Component/platform: Apple TV

Description of problem: I don't want to add Apple TV to HA, but it is detected by discovery. The problem then is that the logs are full of ATV exceptions. If ATV is not configured, these error messages should be suppressed.

cc: @postlund

17-03-24 22:34:30 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/home/hass/.homeassistant/deps/aiohttp/web_server.py", line 62, in handle_request
    resp = yield from self._handler(request)
  File "/home/hass/.homeassistant/deps/aiohttp/web.py", line 270, in _handle
    resp = yield from handler(request)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/http/ban.py", line 58, in ban_middleware_handler
    return (yield from handler(request))
  File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
    res = yield from res
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/http/__init__.py", line 417, in handle
    result = yield from result
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/media_player/__init__.py", line 924, in get
    data, content_type = yield from player.async_get_media_image()
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/media_player/apple_tv.py", line 227, in async_get_media_image
    return (yield from self._atv.metadata.artwork()), 'image/png'
  File "/home/hass/.homeassistant/deps/pyatv/internal/apple_tv.py", line 64, in artwork
    art = yield from self.daap.get(_ARTWORK_CMD, daap_data=False)
  File "/home/hass/.homeassistant/deps/pyatv/daap.py", line 135, in get
    return (yield from self._do(_get_request, is_daap=daap_data))
  File "/home/hass/.homeassistant/deps/pyatv/daap.py", line 168, in _do
    action, False, is_login=is_login, is_daap=is_daap))
  File "/home/hass/.homeassistant/deps/pyatv/daap.py", line 171, in _do
    'failed to login: ' + str(status))
pyatv.exceptions.AuthenticationError: failed to login: 400
17-03-24 22:35:00 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/home/hass/.homeassistant/deps/aiohttp/web_server.py", line 62, in handle_request
    resp = yield from self._handler(request)
  File "/home/hass/.homeassistant/deps/aiohttp/web.py", line 270, in _handle
    resp = yield from handler(request)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/http/ban.py", line 58, in ban_middleware_handler
    return (yield from handler(request))
  File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
    res = yield from res
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/http/__init__.py", line 417, in handle
    result = yield from result
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/media_player/__init__.py", line 924, in get
    data, content_type = yield from player.async_get_media_image()
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/media_player/apple_tv.py", line 227, in async_get_media_image
    return (yield from self._atv.metadata.artwork()), 'image/png'
  File "/home/hass/.homeassistant/deps/pyatv/internal/apple_tv.py", line 64, in artwork
    art = yield from self.daap.get(_ARTWORK_CMD, daap_data=False)
  File "/home/hass/.homeassistant/deps/pyatv/daap.py", line 135, in get
    return (yield from self._do(_get_request, is_daap=daap_data))
  File "/home/hass/.homeassistant/deps/pyatv/daap.py", line 168, in _do
    action, False, is_login=is_login, is_daap=is_daap))
  File "/home/hass/.homeassistant/deps/pyatv/daap.py", line 171, in _do
    'failed to login: ' + str(status))
pyatv.exceptions.AuthenticationError: failed to login: 400

Expected: Don't fill up logs if the component is not configured.

waiting-for-reply

Most helpful comment

I'm having another problem related with Apple TV, it gets automatically turned on (and so does my TV) when I execute HA and go to the web ui o.O

All 10 comments

I'm having another problem related with Apple TV, it gets automatically turned on (and so does my TV) when I execute HA and go to the web ui o.O

These "400"-errors it something I yet have to understand why they are happening. They are still a mystery to me I'm afraid.

Your problem, @jcastro, however is known. See this PR https://github.com/home-assistant/home-assistant/pull/5962.

@postlund I was thinking that discovery detects the ATV and tries to configure it. However, given that it is not configured (due to missing hsgid), it gives the 400 errors.

@arsaboo The discovery will autodiscover your device if you have Home Sharing enabled. In this case it will figure out hsgid by itself, so you don't have to care about it (it's called login_id now, too). But for some reason it usually works for a while and then ends up giving these errors. Then it recovers and starts all over again.

If you don't want to autodiscover it, just add apple_tv to ignoreunder discovery:.

I do have Home Sharing enabled. BTW, those errors go away after I add the login_id. Let me know if I can help you in debugging the error.

@jcastro Yeah, the turning on of the appletv is maddening. Gonna have to turn off some features for now..

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

Any solutions for this?

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nodkan picture nodkan  路  161Comments

jeromelaban picture jeromelaban  路  123Comments

kdschlosser picture kdschlosser  路  374Comments

aguilaair picture aguilaair  路  162Comments

WilldabeastHA picture WilldabeastHA  路  203Comments