maykar / plex_assistant

❱ Plex Assistant is a Home Assistant integration for casting Plex media to Google devices, Sonos devices, and Plex clients with Google Assistant, HA's conversation integration, and more.
MIT License
281 stars 59 forks source link

Chromecast stuck at the Plex Loading screen. #121

Closed danbush closed 3 years ago

danbush commented 3 years ago

I'm like 100% sure this is user error, but I just absolutely cannot figure it out. I just upgraded to 1.x, after going through the steps listed in the "upgrading to 1.x" guide. I think it might be the Plex integration, and not Plex assistant? But the logs are being entirely unhelpful. I added the logger stuff into the config and restarted as the troubleshooting md said.

Step by step: I tell google to tell plex to play (anything). The screen goes to the plex loading screen. Eventually it gives up and says sorry.

Some more information: Not that this matters too much but just fyi: it worked prior to updating. If I just use the Plex app on my phone to cast it works fine.

One single time I got this in the log: 2021-04-29 15:14:53 DEBUG (SyncWorker_4) [custom_components.plex_assistant.const] Media titles: 204

and one other time I got this in the log, which either is definitely telling me the problem and I don't know it, or its just telling me I've been testing too much and now I'm being rate limited or something:

Source: components/plex/media_player.py:460
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 3:17:54 PM (1 occurrences)
Last logged: 3:17:54 PM

[139662008863616] HTTPConnectionPool(host='192.168.131.102', port=32500): Max retries exceeded with url: /player/playback/play?commandID=1&type=video (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0594f390d0>: Failed to establish a new connection: [Errno 111] Connection refused'))
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn
    conn = connection.create_connection(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection
    raise err
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1010, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.8/http/client.py", line 950, in send
    self.connect()
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 200, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f0594f390d0>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 573, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.131.102', port=32500): Max retries exceeded with url: /player/playback/play?commandID=1&type=video (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0594f390d0>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 141, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1488, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1523, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 642, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 681, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 679, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 790, in async_media_play_pause
    await self.async_media_play()
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 584, in async_media_play
    await self.hass.async_add_executor_job(self.media_play)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/plex/media_player.py", line 460, in media_play
    self.device.play(self._active_media_plexapi_type)
  File "/usr/local/lib/python3.8/site-packages/plexapi/client.py", line 336, in play
    self.sendCommand('playback/play', type=mtype)
  File "/usr/local/lib/python3.8/site-packages/plexapi/client.py", line 210, in sendCommand
    return query(key, headers=headers)
  File "/usr/local/lib/python3.8/site-packages/plexapi/client.py", line 161, in query
    response = method(url, headers=headers, timeout=timeout, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.131.102', port=32500): Max retries exceeded with url: /player/playback/play?commandID=1&type=video (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0594f390d0>: Failed to establish a new connection: [Errno 111] Connection refused'))

Any help at all would be greatly appreciated. Thank you!

github-actions[bot] commented 3 years ago

Important:

Issues that don't provide the information requested in the troubleshooting docs may not get a reply and may be closed until the info is provided. Please, include as much of the requested info as possible so that I can replicate and investigate your issue.

When pasting in your config/code/errors always place 3 backticks ``` above the first line and after the last line. Doing this will format it correctly.

danbush commented 3 years ago

Also to be clear I don’t think this is a bug, but more of a “help wanted” but that didn’t seem to be an option when I made the post.

danbush commented 3 years ago

http://xxx.xx.xx.xxx:32400: HTTPConnectionPool(host='xxx.xx.xx.xxx', port=32400): Max retries exceeded with url: /resources (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f6ebc6d4e50>, 'Connection to xxx.xx.xx.xxx timed out. (connect timeout=3)'))

danbush commented 3 years ago

OMG I GOT IT! Just in case someone else is running into a similar thing: it was due to my plex being on the same computer (but a diff docker container) as my HA. Switched to local IP in HA and it worked!!!