Apple TV (Error doing job: Task exception was never retrieved)

Hi Homies,

I have added the Apple TV component and every time my server restarts I get the following in the log file. Does anyone know how I can fix this?

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/apple_tv/__init__.py", line 201, in _setup_atv
    await atv.airplay.load_credentials(credentials)
  File "/usr/lib/python3.5/asyncio/coroutines.py", line 210, in coro
    res = func(*args, **kw)
  File "/srv/homeassistant/lib/python3.5/site-packages/pyatv/internal/apple_tv.py", line 433, in load_credentials
    self.srp.initialize(binascii.unhexlify(split[1]))
  File "/srv/homeassistant/lib/python3.5/site-packages/pyatv/airplay/srp.py", line 100, in initialize
    signing_key = SigningKey(self.seed)
  File "/srv/homeassistant/lib/python3.5/site-packages/ed25519/keys.py", line 88, in __init__
    raise ValueError("SigningKey takes 32-byte seed or 64-byte string")
ValueError: SigningKey takes 32-byte seed or 64-byte string

You have entered invalid credentials in your config.

1 Like

Ahhh, thank you sir!

Not sure how they got invalid - it was a new installl. I however went ahead and replaced them and it seems to be up and running again.

Thanks again! :slight_smile:

Great! Usually it is because you miss to copy one or more characters :slight_smile:

I am having this error for my Samsung TV - do you know what is happening with this on? @postlund

Mon Feb 25 2019 13:45:33 GMT+0000 (GMT)

Update for media_player.bedroom_tv fails
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/websocket/_socket.py", line 81, in recv
    bytes_ = sock.recv(bufsize)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
    await self.async_device_update()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/samsungtv.py", line 132, in update
    self.send_key("KEY")
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/samsungtv.py", line 153, in send_key
    self.get_remote().control(key)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/samsungtv.py", line 138, in get_remote
    self._remote = self._remote_class(self._config)
  File "/srv/homeassistant/lib/python3.5/site-packages/samsungctl/remote.py", line 11, in __init__
    self.remote = RemoteWebsocket(config)
  File "/srv/homeassistant/lib/python3.5/site-packages/samsungctl/remote_websocket.py", line 30, in __init__
    self._read_response()
  File "/srv/homeassistant/lib/python3.5/site-packages/samsungctl/remote_websocket.py", line 67, in _read_response
    response = self.connection.recv()
  File "/srv/homeassistant/lib/python3.5/site-packages/websocket/_core.py", line 310, in recv
    opcode, data = self.recv_data()
  File "/srv/homeassistant/lib/python3.5/site-packages/websocket/_core.py", line 327, in recv_data
    opcode, frame = self.recv_data_frame(control_frame)
  File "/srv/homeassistant/lib/python3.5/site-packages/websocket/_core.py", line 340, in recv_data_frame
    frame = self.recv_frame()
  File "/srv/homeassistant/lib/python3.5/site-packages/websocket/_core.py", line 374, in recv_frame
    return self.frame_buffer.recv_frame()
  File "/srv/homeassistant/lib/python3.5/site-packages/websocket/_abnf.py", line 361, in recv_frame
    self.recv_header()
  File "/srv/homeassistant/lib/python3.5/site-packages/websocket/_abnf.py", line 309, in recv_header
    header = self.recv_strict(2)
  File "/srv/homeassistant/lib/python3.5/site-packages/websocket/_abnf.py", line 396, in recv_strict
    bytes_ = self.recv(min(16384, shortage))
  File "/srv/homeassistant/lib/python3.5/site-packages/websocket/_core.py", line 449, in _recv
    return recv(self.sock, bufsize)
  File "/srv/homeassistant/lib/python3.5/site-packages/websocket/_socket.py", line 84, in recv
    raise WebSocketTimeoutException(message)
websocket._exceptions.WebSocketTimeoutException: timed out

You would have to ask someone that knows how the Samsung integration works, I have no clue.