Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown connection error in Plex integration setup #28564

Closed
jjlawren opened this issue Nov 5, 2019 · 24 comments · Fixed by #29172
Closed

Unknown connection error in Plex integration setup #28564

jjlawren opened this issue Nov 5, 2019 · 24 comments · Fixed by #29172
Assignees

Comments

@jjlawren
Copy link
Contributor

jjlawren commented Nov 5, 2019

Home Assistant release with the issue:
0.101.2

Last working Home Assistant release (if known):
0.100.2

Operating environment (Hass.io/Docker/Windows/etc.):
Hass.io running as a VM on ESXi

Integration:
plex https://www.home-assistant.io/integrations/plex/

Description of problem:
Same as above
Removed, re-added. No new devices show up. Plex and Hass.io are on different subnets but never had an issue. Plex is running on a QNap NAS.

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

plex:
    host: !secret plex_host
    ssl: true
    verify_ssl: false

Originally posted by @SPCulhane in #28485 (comment)

Originally I have Plex setup with Required secured connection with the above Plex integration config. This was working until the recent update. Now its showing Unknown and doesn't show any plays.

If I change Plex to Preferred secured connection and change the Plex integration to ssl: false. It shows unknown until a show is played. It's reporting what is playing and adding devices.

Thinking my issue is different. I will do some more digging later but having Plex setup with Required secured connection isn't working right with the recently HA update. In the logs you'll notice some 10.x IPs, those are because the QNap NAS has docker running on it. When using autodiscovery, Plex is found and I login but end up with a 500 server error.

2019-11-05 09:39:37 ERROR (Thread-21) [plexapi] http://192.168.0.10:32400: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-05 09:39:57 INFO (SyncWorker_3) [plexapi] Testing 8 resource connections..
2019-11-05 09:39:57 ERROR (Thread-29) [plexapi] http://192.168.0.10:32400: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-05 09:40:06 ERROR (MainThread) [homeassistant.components.plex] Unknown error connecting to Plex server: 
2019-11-05 09:40:07 ERROR (Thread-22) [plexapi] http://10.0.5.1:32400: HTTPConnectionPool(host='10.0.5.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f93b4e3eb90>, 'Connection to 10.0.5.1 timed out. (connect timeout=30)'))
2019-11-05 09:40:07 ERROR (Thread-24) [plexapi] http://24.164.00.00:32400: HTTPConnectionPool(host='24.164.00.00', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f93b5115b10>, 'Connection to 24.164.00.00 timed out. (connect timeout=30)'))
2019-11-05 09:40:07 ERROR (Thread-23) [plexapi] http://10.0.3.1:32400: HTTPConnectionPool(host='10.0.3.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f93b522c150>, 'Connection to 10.0.3.1 timed out. (connect timeout=30)'))
2019-11-05 09:40:07 ERROR (Thread-18) [plexapi] https://10-0-5-1.something.plex.direct:32400: HTTPSConnectionPool(host='10-0-5-1.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f93b4e42250>, 'Connection to 10-0-5-1.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 09:40:07 ERROR (Thread-20) [plexapi] https://24-164-00-00.something.plex.direct:32400: HTTPSConnectionPool(host='24-164-00-00.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f93b52015d0>, 'Connection to 24-164-00-00.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 09:40:07 ERROR (Thread-19) [plexapi] https://10-0-3-1.something.plex.direct:32400: HTTPSConnectionPool(host='10-0-3-1.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f93b4ede0d0>, 'Connection to 10-0-3-1.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 09:40:07 INFO (SyncWorker_8) [plexapi] Resource connection OK (1s): https://192-168-0-10.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:07 INFO (SyncWorker_8) [plexapi] Resource connection ERR (30s): https://10-0-5-1.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:07 INFO (SyncWorker_8) [plexapi] Resource connection ERR (30s): https://10-0-3-1.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:07 INFO (SyncWorker_8) [plexapi] Resource connection ERR (30s): https://24-164-00-00.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:07 INFO (SyncWorker_8) [plexapi] Resource connection ERR (0s): http://192.168.0.10:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:07 INFO (SyncWorker_8) [plexapi] Resource connection ERR (30s): http://10.0.5.1:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:07 INFO (SyncWorker_8) [plexapi] Resource connection ERR (30s): http://10.0.3.1:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:07 INFO (SyncWorker_8) [plexapi] Resource connection ERR (30s): http://24.164.00.00:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:07 INFO (SyncWorker_8) [plexapi] Connecting to Resource: https://192-168-0-10.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:08 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 136, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 122, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
2019-11-05 09:40:26 ERROR (MainThread) [homeassistant.components.plex] Unknown error connecting to Plex server: 
2019-11-05 09:40:26 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 136, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 122, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 154, in get
    return await super().get(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 78, in get
    result = await self._flow_mgr.async_configure(flow_id)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 89, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 162, in _async_handle_step
    self._progress.pop(flow.flow_id)
KeyError: 'cb6a84de01c44773a6fb8db44d6c2e19'
2019-11-05 09:40:27 ERROR (Thread-27) [plexapi] https://10-0-3-1.something.plex.direct:32400: HTTPSConnectionPool(host='10-0-3-1.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f93b4c90c10>, 'Connection to 10-0-3-1.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 09:40:27 ERROR (Thread-28) [plexapi] https://24-164-00-00.something.plex.direct:32400: HTTPSConnectionPool(host='24-164-00-00.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f93b4c98cd0>, 'Connection to 24-164-00-00.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 09:40:27 ERROR (Thread-30) [plexapi] http://10.0.5.1:32400: HTTPConnectionPool(host='10.0.5.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f93b5094090>, 'Connection to 10.0.5.1 timed out. (connect timeout=30)'))
2019-11-05 09:40:27 ERROR (Thread-26) [plexapi] https://10-0-5-1.something.plex.direct:32400: HTTPSConnectionPool(host='10-0-5-1.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f93b4c90e90>, 'Connection to 10-0-5-1.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 09:40:27 ERROR (Thread-32) [plexapi] http://24.164.00.00:32400: HTTPConnectionPool(host='24.164.00.00', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f93b4cab190>, 'Connection to 24.164.00.00 timed out. (connect timeout=30)'))
2019-11-05 09:40:27 ERROR (Thread-31) [plexapi] http://10.0.3.1:32400: HTTPConnectionPool(host='10.0.3.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f93b4cabc90>, 'Connection to 10.0.3.1 timed out. (connect timeout=30)'))
2019-11-05 09:40:27 INFO (SyncWorker_3) [plexapi] Resource connection OK (0s): https://192-168-0-10.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:27 INFO (SyncWorker_3) [plexapi] Resource connection ERR (30s): https://10-0-5-1.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:27 INFO (SyncWorker_3) [plexapi] Resource connection ERR (30s): https://10-0-3-1.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:27 INFO (SyncWorker_3) [plexapi] Resource connection ERR (30s): https://24-164-00-00.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:27 INFO (SyncWorker_3) [plexapi] Resource connection ERR (0s): http://192.168.0.10:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:27 INFO (SyncWorker_3) [plexapi] Resource connection ERR (30s): http://10.0.5.1:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:27 INFO (SyncWorker_3) [plexapi] Resource connection ERR (30s): http://10.0.3.1:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:27 INFO (SyncWorker_3) [plexapi] Resource connection ERR (30s): http://24.164.00.00:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:27 INFO (SyncWorker_3) [plexapi] Connecting to Resource: https://192-168-0-10.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:40:48 INFO (MainThread) [homeassistant.components.ambient_station] Connected to websocket
2019-11-05 09:40:48 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.ambient_station
2019-11-05 09:40:48 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.ambient_station
2019-11-05 09:40:52 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.140272372033424] Connection closed by client
2019-11-05 09:41:26 INFO (SyncWorker_9) [plexapi] Testing 8 resource connections..
2019-11-05 09:41:26 ERROR (Thread-37) [plexapi] http://192.168.0.10:32400: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-05 09:41:39 INFO (SyncWorker_0) [plexapi] Testing 8 resource connections..
2019-11-05 09:41:39 ERROR (Thread-45) [plexapi] http://192.168.0.10:32400: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-05 09:41:55 ERROR (MainThread) [homeassistant.components.plex] Unknown error connecting to Plex server: 
2019-11-05 09:41:56 ERROR (Thread-35) [plexapi] https://10-0-3-1.something.plex.direct:32400: HTTPSConnectionPool(host='10-0-3-1.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f93b4ca7510>, 'Connection to 10-0-3-1.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 09:41:56 ERROR (Thread-38) [plexapi] http://10.0.5.1:32400: HTTPConnectionPool(host='10.0.5.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f93b4ca8150>, 'Connection to 10.0.5.1 timed out. (connect timeout=30)'))
2019-11-05 09:41:56 ERROR (Thread-36) [plexapi] https://24-164-00-00.something.plex.direct:32400: HTTPSConnectionPool(host='24-164-00-00.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f93b4c53b90>, 'Connection to 24-164-00-00.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 09:41:56 ERROR (Thread-40) [plexapi] http://24.164.00.00:32400: HTTPConnectionPool(host='24.164.00.00', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f93b4edc0d0>, 'Connection to 24.164.00.00 timed out. (connect timeout=30)'))
2019-11-05 09:41:56 ERROR (Thread-39) [plexapi] http://10.0.3.1:32400: HTTPConnectionPool(host='10.0.3.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f93b4c6d0d0>, 'Connection to 10.0.3.1 timed out. (connect timeout=30)'))
2019-11-05 09:41:56 ERROR (Thread-34) [plexapi] https://10-0-5-1.something.plex.direct:32400: HTTPSConnectionPool(host='10-0-5-1.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f93b4bbce90>, 'Connection to 10-0-5-1.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 09:41:56 INFO (SyncWorker_9) [plexapi] Resource connection OK (0s): https://192-168-0-10.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:41:56 INFO (SyncWorker_9) [plexapi] Resource connection ERR (30s): https://10-0-5-1.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:41:56 INFO (SyncWorker_9) [plexapi] Resource connection ERR (30s): https://10-0-3-1.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:41:56 INFO (SyncWorker_9) [plexapi] Resource connection ERR (30s): https://24-164-00-00.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:41:56 INFO (SyncWorker_9) [plexapi] Resource connection ERR (0s): http://192.168.0.10:32400?X-Plex-Token=<hidden>
2019-11-05 09:41:56 INFO (SyncWorker_9) [plexapi] Resource connection ERR (30s): http://10.0.5.1:32400?X-Plex-Token=<hidden>
2019-11-05 09:41:56 INFO (SyncWorker_9) [plexapi] Resource connection ERR (30s): http://10.0.3.1:32400?X-Plex-Token=<hidden>
2019-11-05 09:41:56 INFO (SyncWorker_9) [plexapi] Resource connection ERR (30s): http://24.164.00.00:32400?X-Plex-Token=<hidden>
2019-11-05 09:41:56 INFO (SyncWorker_9) [plexapi] Connecting to Resource: https://192-168-0-10.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:41:58 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 136, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 122, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
2019-11-05 09:42:08 ERROR (MainThread) [homeassistant.components.plex] Unknown error connecting to Plex server: 
2019-11-05 09:42:08 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 136, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 122, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 89, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 162, in _async_handle_step
    self._progress.pop(flow.flow_id)
KeyError: '416b53dfd2e542ccacdc38f579a64432'
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 136, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 122, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
2019-11-05 09:42:09 ERROR (Thread-42) [plexapi] https://10-0-5-1.something.plex.direct:32400: HTTPSConnectionPool(host='10-0-5-1.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f93b4cc2590>, 'Connection to 10-0-5-1.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 09:42:09 ERROR (Thread-43) [plexapi] https://10-0-3-1.something.plex.direct:32400: HTTPSConnectionPool(host='10-0-3-1.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f93b4cc2790>, 'Connection to 10-0-3-1.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 09:42:09 ERROR (Thread-46) [plexapi] http://10.0.5.1:32400: HTTPConnectionPool(host='10.0.5.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f93b4cc6490>, 'Connection to 10.0.5.1 timed out. (connect timeout=30)'))
2019-11-05 09:42:09 ERROR (Thread-44) [plexapi] https://24-164-00-00.something.plex.direct:32400: HTTPSConnectionPool(host='24-164-00-00.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f93b4cc3310>, 'Connection to 24-164-00-00.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 09:42:09 ERROR (Thread-47) [plexapi] http://10.0.3.1:32400: HTTPConnectionPool(host='10.0.3.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f93b4ce0410>, 'Connection to 10.0.3.1 timed out. (connect timeout=30)'))
2019-11-05 09:42:09 ERROR (Thread-48) [plexapi] http://24.164.00.00:32400: HTTPConnectionPool(host='24.164.00.00', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f93b4cd7790>, 'Connection to 24.164.00.00 timed out. (connect timeout=30)'))
2019-11-05 09:42:09 INFO (SyncWorker_0) [plexapi] Resource connection OK (0s): https://192-168-0-10.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:42:09 INFO (SyncWorker_0) [plexapi] Resource connection ERR (30s): https://10-0-5-1.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:42:09 INFO (SyncWorker_0) [plexapi] Resource connection ERR (30s): https://10-0-3-1.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:42:09 INFO (SyncWorker_0) [plexapi] Resource connection ERR (30s): https://24-164-00-00.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 09:42:09 INFO (SyncWorker_0) [plexapi] Resource connection ERR (0s): http://192.168.0.10:32400?X-Plex-Token=<hidden>
2019-11-05 09:42:09 INFO (SyncWorker_0) [plexapi] Resource connection ERR (30s): http://10.0.5.1:32400?X-Plex-Token=<hidden>
2019-11-05 09:42:09 INFO (SyncWorker_0) [plexapi] Resource connection ERR (30s): http://10.0.3.1:32400?X-Plex-Token=<hidden>
2019-11-05 09:42:09 INFO (SyncWorker_0) [plexapi] Resource connection ERR (30s): http://24.164.00.00:32400?X-Plex-Token=<hidden>
2019-11-05 09:42:09 INFO (SyncWorker_0) [plexapi] Connecting to Resource: https://192-168-0-10.something.plex.direct:32400?X-Plex-Token=<hidden>
@jjlawren
Copy link
Contributor Author

jjlawren commented Nov 5, 2019

@SPCulhane Looks like a few of things going on here:

  1. Your 192.168.0.10 connection is reachable, but is rejected because it's attempting with a non-SSL URL prefix and the Plex server requires a secure connection.
  2. The other failures may be because of unreachable docker IPs, or perhaps because of a DNS issue on your end.
  3. It seems to finally succeed with the local 192-168-0-10.something.plex.direct URL, but still throws an error during the connection for some unknown reason.

I'm not exactly sure why the config flow is failing for you as the exception is being gobbled up. I normally don't like to do it this way, but can you try to edit /usr/src/homeassistant/homeassistant/components/plex/config_flow.py and change line 105 from _LOGGER.error(... to _LOGGER.exception(... and try again? If that helps I'll commit it for future use.

@SPCulhane
Copy link

I made those changes and the results are the same. I tried it with my normal plex: config and then I remove config and tried using auto-discovery/integration.

2019-11-05 11:44:54 ERROR (Thread-21) [plexapi] http://192.168.0.10:32400: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-05 11:45:23 ERROR (MainThread) [homeassistant.components.plex] Unknown error connecting to Plex server: 
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 86, in async_step_server_validate
    await self.hass.async_add_executor_job(plex_server.connect)
concurrent.futures._base.CancelledError
2019-11-05 11:45:24 ERROR (Thread-23) [plexapi] http://10.0.3.1:32400: HTTPConnectionPool(host='10.0.3.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f542663f550>, 'Connection to 10.0.3.1 timed out. (connect timeout=30)'))
2019-11-05 11:45:24 ERROR (Thread-24) [plexapi] http://24.164.00.00:32400: HTTPConnectionPool(host='24.164.00.00', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f5426644910>, 'Connection to 24.164.00.00 timed out. (connect timeout=30)'))
2019-11-05 11:45:24 ERROR (Thread-22) [plexapi] http://10.0.5.1:32400: HTTPConnectionPool(host='10.0.5.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f542663a110>, 'Connection to 10.0.5.1 timed out. (connect timeout=30)'))
2019-11-05 11:45:24 ERROR (Thread-20) [plexapi] https://24-164-00-00.something.plex.direct:32400: HTTPSConnectionPool(host='24-164-00-00.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f5426634050>, 'Connection to 24-164-00-00.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 11:45:24 ERROR (Thread-19) [plexapi] https://10-0-3-1.something.plex.direct:32400: HTTPSConnectionPool(host='10-0-3-1.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f5426aa9190>, 'Connection to 10-0-3-1.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 11:45:24 ERROR (Thread-18) [plexapi] https://10-0-5-1.something.plex.direct:32400: HTTPSConnectionPool(host='10-0-5-1.something.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f5426aa9890>, 'Connection to 10-0-5-1.something.plex.direct timed out. (connect timeout=30)'))
2019-11-05 11:45:24 INFO (SyncWorker_9) [plexapi] Resource connection OK (1s): https://192-168-0-10.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 11:45:24 INFO (SyncWorker_9) [plexapi] Resource connection ERR (30s): https://10-0-5-1.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 11:45:24 INFO (SyncWorker_9) [plexapi] Resource connection ERR (30s): https://10-0-3-1.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 11:45:24 INFO (SyncWorker_9) [plexapi] Resource connection ERR (30s): https://24-164-00-00.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 11:45:24 INFO (SyncWorker_9) [plexapi] Resource connection ERR (0s): http://192.168.0.10:32400?X-Plex-Token=<hidden>
2019-11-05 11:45:24 INFO (SyncWorker_9) [plexapi] Resource connection ERR (30s): http://10.0.5.1:32400?X-Plex-Token=<hidden>
2019-11-05 11:45:24 INFO (SyncWorker_9) [plexapi] Resource connection ERR (30s): http://10.0.3.1:32400?X-Plex-Token=<hidden>
2019-11-05 11:45:24 INFO (SyncWorker_9) [plexapi] Resource connection ERR (30s): http://24.164.00.00:32400?X-Plex-Token=<hidden>
2019-11-05 11:45:24 INFO (SyncWorker_9) [plexapi] Connecting to Resource: https://192-168-0-10.something.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-05 11:45:42 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 136, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 122, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow

@jjlawren
Copy link
Contributor Author

jjlawren commented Nov 5, 2019

At what point in the integration setup does it fail? Can you successfully authenticate at plex.tv? Does the redirect back to HA succeed?

@SPCulhane
Copy link

Well I have some good news. I changed my config to this:

plex:
    host: 192-168-0-10.something.plex.direct
    ssl: true
    verify_ssl: false

Before the host was 192.168.0.10

So right now, it works just using the above config without authenticating via plex.tv

watch counter does start off as unknown but it increases/decreases and players are showing up again

@SPCulhane
Copy link

At what point in the integration setup does it fail? Can you successfully authenticate at plex.tv? Does the redirect back to HA succeed?

It would fail when it would do the redirect back to HA. The first prompt "Connect Plex server :Continue to authorize at plex.tv." works and then this pops up "This step requires you to visit an external website to be completed.". I'm able to login then when it redirects back, i receive the 500 error (https://hassio.1234.net/auth/plex/callback?flow_id=123456)

@jjlawren
Copy link
Contributor Author

jjlawren commented Nov 5, 2019

That's really good to hear. I'm still trying to understand what was going wrong with setting it up via the Integration page.

@SPCulhane
Copy link

It failed when it was redirecting back to HA using this url: https://hassio.1234.net/auth/plex/callback?flow_id=123456 that's were I would get a 500 error.

My last set of logs everything at "2019-11-05 11:45:42 ERROR (MainThread) [aiohttp.server] Error handling request" and after is when its redirecting back to HA

@CheeseySandal
Copy link

Just like @dshokouhi I'm also getting the plex sensor showing as unknown since upgrading to all versions of 0.101. My setup can be seen in #28630 which I've closed. My sensor however, never seems to update when streams have started.

I also get timeouts/errors when trying to integrate using the frontend, just like @SPCulhane

@jjlawren jjlawren self-assigned this Nov 21, 2019
@jjlawren
Copy link
Contributor Author

@SPCulhane will you be able to test this again when 0.102.1 is released? Bumping up the logging for Plex would also be very helpful:

logs:
    homeassistant.components.plex: debug
    plexapi: debug
    plexwebsocket: debug

@SPCulhane
Copy link

I'm seeing the same results. I don't know if this factor, I do have Plex set to auto authenticate my local subnets

With these options using local IP for host

plex:
    host: !secret plex_host
#    token: !secret plex_token
#    ssl: true
#   verify_ssl: false
2019-11-24 09:09:59 INFO (SyncWorker_4) [plexapi] Testing 10 resource connections..
2019-11-24 09:09:59 ERROR (Thread-23) [plexapi] http://192.168.0.10:32400: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-24 09:09:59 ERROR (Thread-27) [plexapi] http://45.79.129.106:8443: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-24 09:10:26 WARNING (event_thread_0) [sucks] Ping did not reach VacBot. Will retry.
2019-11-24 09:10:28 ERROR (MainThread) [homeassistant.components.plex] Unknown error connecting to Plex server: 
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 86, in async_step_server_validate
    await self.hass.async_add_executor_job(plex_server.connect)
concurrent.futures._base.CancelledError
2019-11-24 09:10:29 ERROR (Thread-24) [plexapi] http://10.0.5.1:32400: HTTPConnectionPool(host='10.0.5.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f276a45a390>, 'Connection to 10.0.5.1 timed out. (connect timeout=30)'))
2019-11-24 09:10:29 ERROR (Thread-25) [plexapi] http://10.0.3.1:32400: HTTPConnectionPool(host='10.0.3.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f276a465550>, 'Connection to 10.0.3.1 timed out. (connect timeout=30)'))
2019-11-24 09:10:29 ERROR (Thread-26) [plexapi] http://0.0.0.0:32400: HTTPConnectionPool(host='0.0.0.0', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f276a46a690>, 'Connection to 0.0.0.0 timed out. (connect timeout=30)'))
2019-11-24 09:10:29 ERROR (Thread-21) [plexapi] https://0.0.0.0.somecode.plex.direct:32400: HTTPSConnectionPool(host='0.0.0.0.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f276a6cfb90>, 'Connection to 0.0.0.0.somecode.plex.direct timed out. (connect timeout=30)'))
2019-11-24 09:10:29 ERROR (Thread-19) [plexapi] https://10-0-5-1.somecode.plex.direct:32400: HTTPSConnectionPool(host='10-0-5-1.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f276a6c4d90>, 'Connection to 10-0-5-1.somecode.plex.direct timed out. (connect timeout=30)'))
2019-11-24 09:10:29 ERROR (Thread-20) [plexapi] https://10-0-3-1.somecode.plex.direct:32400: HTTPSConnectionPool(host='10-0-3-1.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f276a6c2e90>, 'Connection to 10-0-3-1.somecode.plex.direct timed out. (connect timeout=30)'))
2019-11-24 09:10:29 INFO (SyncWorker_4) [plexapi] Resource connection OK (1s): https://192-168-0-10.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 09:10:29 INFO (SyncWorker_4) [plexapi] Resource connection ERR (30s): https://10-0-5-1.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 09:10:29 INFO (SyncWorker_4) [plexapi] Resource connection ERR (30s): https://10-0-3-1.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 09:10:29 INFO (SyncWorker_4) [plexapi] Resource connection ERR (30s): https://0.0.0.0.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 09:10:29 INFO (SyncWorker_4) [plexapi] Resource connection OK (2s): https://45-79-129-106.somecode.plex.direct:8443?X-Plex-Token=<hidden>
2019-11-24 09:10:29 INFO (SyncWorker_4) [plexapi] Resource connection ERR (0s): http://192.168.0.10:32400?X-Plex-Token=<hidden>
2019-11-24 09:10:29 INFO (SyncWorker_4) [plexapi] Resource connection ERR (30s): http://10.0.5.1:32400?X-Plex-Token=<hidden>
2019-11-24 09:10:29 INFO (SyncWorker_4) [plexapi] Resource connection ERR (30s): http://10.0.3.1:32400?X-Plex-Token=<hidden>
2019-11-24 09:10:29 INFO (SyncWorker_4) [plexapi] Resource connection ERR (30s): http://0.0.0.0:32400?X-Plex-Token=<hidden>
2019-11-24 09:10:29 INFO (SyncWorker_4) [plexapi] Resource connection ERR (0s): http://45.79.129.106:8443?X-Plex-Token=<hidden>
2019-11-24 09:10:29 INFO (SyncWorker_4) [plexapi] Connecting to Resource: https://192-168-0-10.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 09:10:44 INFO (MainThread) [homeassistant.components.ambient_station] Connected to websocket
2019-11-24 09:10:45 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.ambient_station
2019-11-24 09:10:45 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.ambient_station
2019-11-24 09:10:56 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 136, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 122, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow

With these options, still local IP

plex:
    host: !secret plex_host
#    token: !secret plex_token
    ssl: true
    verify_ssl: false
2019-11-24 09:33:17 INFO (SyncWorker_0) [plexapi] Testing 10 resource connections..
2019-11-24 09:33:17 ERROR (Thread-23) [plexapi] http://192.168.0.10:32400: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-24 09:33:17 ERROR (Thread-27) [plexapi] http://172.104.219.70:8443: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-24 09:33:45 ERROR (MainThread) [homeassistant.components.plex] Unknown error connecting to Plex server: 
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 86, in async_step_server_validate
    await self.hass.async_add_executor_job(plex_server.connect)
concurrent.futures._base.CancelledError
2019-11-24 09:33:47 ERROR (Thread-24) [plexapi] http://10.0.5.1:32400: HTTPConnectionPool(host='10.0.5.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1379b1cb90>, 'Connection to 10.0.5.1 timed out. (connect timeout=30)'))
2019-11-24 09:33:47 ERROR (Thread-25) [plexapi] http://10.0.3.1:32400: HTTPConnectionPool(host='10.0.3.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1377f02990>, 'Connection to 10.0.3.1 timed out. (connect timeout=30)'))
2019-11-24 09:33:47 ERROR (Thread-26) [plexapi] http://0.0.0.0:32400: HTTPConnectionPool(host='0.0.0.0', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1379f751d0>, 'Connection to 0.0.0.0 timed out. (connect timeout=30)'))
2019-11-24 09:33:47 ERROR (Thread-19) [plexapi] https://10-0-5-1.somecode.plex.direct:32400: HTTPSConnectionPool(host='10-0-5-1.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f137a441150>, 'Connection to 10-0-5-1.somecode.plex.direct timed out. (connect timeout=30)'))
2019-11-24 09:33:47 ERROR (Thread-21) [plexapi] https://0.0.0.0.somecode.plex.direct:32400: HTTPSConnectionPool(host='0.0.0.0.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1379f6aa50>, 'Connection to 0.0.0.0.somecode.plex.direct timed out. (connect timeout=30)'))
2019-11-24 09:33:47 ERROR (Thread-20) [plexapi] https://10-0-3-1.somecode.plex.direct:32400: HTTPSConnectionPool(host='10-0-3-1.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f137af45690>, 'Connection to 10-0-3-1.somecode.plex.direct timed out. (connect timeout=30)'))
2019-11-24 09:33:47 INFO (SyncWorker_0) [plexapi] Resource connection OK (1s): https://192-168-0-10.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 09:33:47 INFO (SyncWorker_0) [plexapi] Resource connection ERR (30s): https://10-0-5-1.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 09:33:47 INFO (SyncWorker_0) [plexapi] Resource connection ERR (30s): https://10-0-3-1.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 09:33:47 INFO (SyncWorker_0) [plexapi] Resource connection ERR (30s): https://0.0.0.0.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 09:33:47 INFO (SyncWorker_0) [plexapi] Resource connection OK (1s): https://172-104-219-70.somecode.plex.direct:8443?X-Plex-Token=<hidden>
2019-11-24 09:33:47 INFO (SyncWorker_0) [plexapi] Resource connection ERR (0s): http://192.168.0.10:32400?X-Plex-Token=<hidden>
2019-11-24 09:33:47 INFO (SyncWorker_0) [plexapi] Resource connection ERR (30s): http://10.0.5.1:32400?X-Plex-Token=<hidden>
2019-11-24 09:33:47 INFO (SyncWorker_0) [plexapi] Resource connection ERR (30s): http://10.0.3.1:32400?X-Plex-Token=<hidden>
2019-11-24 09:33:47 INFO (SyncWorker_0) [plexapi] Resource connection ERR (30s): http://0.0.0.0:32400?X-Plex-Token=<hidden>
2019-11-24 09:33:47 INFO (SyncWorker_0) [plexapi] Resource connection ERR (0s): http://172.104.219.70:8443?X-Plex-Token=<hidden>
2019-11-24 09:33:47 INFO (SyncWorker_0) [plexapi] Connecting to Resource: https://192-168-0-10.somecode.plex.direct:32400?X-Plex-Token=<hidden>
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow

@jjlawren
Copy link
Contributor Author

Looks like you're using configuration.yaml and also attempting to setup from the Integrations page. Pick one or the other. Also, make sure you don't have Plex marked as configured already on your Integrations page. If you do, delete it before trying again.

I do have Plex set to auto authenticate my local subnets

Perhaps this could be a factor. I'll have to run some more tests with this setup.

@SPCulhane
Copy link

i removed the config from the yaml file and deleted it. same results

2019-11-24 10:44:24 INFO (SyncWorker_4) [plexapi] Testing 10 resource connections..
2019-11-24 10:44:24 ERROR (Thread-23) [plexapi] http://192.168.0.10:32400: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-24 10:44:24 ERROR (Thread-27) [plexapi] http://45.56.108.77:8443: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-24 10:44:53 ERROR (MainThread) [homeassistant.components.plex] Unknown error connecting to Plex server: 
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 86, in async_step_server_validate
    await self.hass.async_add_executor_job(plex_server.connect)
concurrent.futures._base.CancelledError
2019-11-24 10:44:54 ERROR (Thread-25) [plexapi] http://10.0.3.1:32400: HTTPConnectionPool(host='10.0.3.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f0da43f23d0>, 'Connection to 10.0.3.1 timed out. (connect timeout=30)'))
2019-11-24 10:44:54 ERROR (Thread-24) [plexapi] http://10.0.5.1:32400: HTTPConnectionPool(host='10.0.5.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f0da44f7e90>, 'Connection to 10.0.5.1 timed out. (connect timeout=30)'))
2019-11-24 10:44:54 ERROR (Thread-26) [plexapi] http://0.0.0.0:32400: HTTPConnectionPool(host='0.0.0.0', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f0da6a29850>, 'Connection to 0.0.0.0 timed out. (connect timeout=30)'))
2019-11-24 10:44:54 ERROR (Thread-19) [plexapi] https://10-0-5-1.somecode.plex.direct:32400: HTTPSConnectionPool(host='10-0-5-1.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f0da4401890>, 'Connection to 10-0-5-1.somecode.plex.direct timed out. (connect timeout=30)'))
2019-11-24 10:44:54 ERROR (Thread-20) [plexapi] https://10-0-3-1.somecode.plex.direct:32400: HTTPSConnectionPool(host='10-0-3-1.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f0da439ef10>, 'Connection to 10-0-3-1.somecode.plex.direct timed out. (connect timeout=30)'))
2019-11-24 10:44:54 ERROR (Thread-21) [plexapi] https://0.0.0.0.somecode.plex.direct:32400: HTTPSConnectionPool(host='0.0.0.0.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f0da43af5d0>, 'Connection to 0.0.0.0.somecode.plex.direct timed out. (connect timeout=30)'))
2019-11-24 10:44:54 INFO (SyncWorker_4) [plexapi] Resource connection OK (1s): https://192-168-0-10.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 10:44:54 INFO (SyncWorker_4) [plexapi] Resource connection ERR (30s): https://10-0-5-1.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 10:44:54 INFO (SyncWorker_4) [plexapi] Resource connection ERR (30s): https://10-0-3-1.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 10:44:54 INFO (SyncWorker_4) [plexapi] Resource connection ERR (30s): https://0.0.0.0.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 10:44:54 INFO (SyncWorker_4) [plexapi] Resource connection OK (2s): https://45-56-108-77.somecode.plex.direct:8443?X-Plex-Token=<hidden>
2019-11-24 10:44:54 INFO (SyncWorker_4) [plexapi] Resource connection ERR (0s): http://192.168.0.10:32400?X-Plex-Token=<hidden>
2019-11-24 10:44:54 INFO (SyncWorker_4) [plexapi] Resource connection ERR (30s): http://10.0.5.1:32400?X-Plex-Token=<hidden>
2019-11-24 10:44:54 INFO (SyncWorker_4) [plexapi] Resource connection ERR (30s): http://10.0.3.1:32400?X-Plex-Token=<hidden>
2019-11-24 10:44:54 INFO (SyncWorker_4) [plexapi] Resource connection ERR (30s): http://0.0.0.0:32400?X-Plex-Token=<hidden>
2019-11-24 10:44:54 INFO (SyncWorker_4) [plexapi] Resource connection ERR (0s): http://45.56.108.77:8443?X-Plex-Token=<hidden>
2019-11-24 10:44:54 INFO (SyncWorker_4) [plexapi] Connecting to Resource: https://192-168-0-10.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 10:45:40 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 136, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 122, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow

@jjlawren
Copy link
Contributor Author

Hmm. Your server has 10(!) ways to connect, most of which time out. The config flow is getting aborted before all of the connection attempts return. Perhaps the default plexapi timeout (30s) is too long for the async flow here.

@SPCulhane
Copy link

lol. I can't help that. It's running on a QNAP NAS. the 10.x and 172.x are internal networks within the NAS for docker. I'm using the native QNAP Plex app

@jjlawren
Copy link
Contributor Author

I have a theory. Can you try to apply this change in your server.py? It will reduce the connection timeout and hopefully keep it from getting aborted.

71b581e

If that works I'll create a PR to put it in the release.

@SPCulhane
Copy link

same results :(

2019-11-24 12:11:28 INFO (SyncWorker_5) [plexapi] Testing 10 resource connections..
2019-11-24 12:11:28 ERROR (Thread-23) [plexapi] http://192.168.0.10:32400: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-24 12:11:28 ERROR (Thread-27) [plexapi] http://104.200.30.183:8443: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-24 12:11:57 ERROR (MainThread) [homeassistant.components.plex] Unknown error connecting to Plex server: 
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 86, in async_step_server_validate
    await self.hass.async_add_executor_job(plex_server.connect)
concurrent.futures._base.CancelledError
2019-11-24 12:11:57 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 192.168.0.190
2019-11-24 12:11:58 ERROR (Thread-24) [plexapi] http://10.0.5.1:32400: HTTPConnectionPool(host='10.0.5.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7fe48f9d5a90>, 'Connection to 10.0.5.1 timed out. (connect timeout=30)'))
2019-11-24 12:11:58 ERROR (Thread-26) [plexapi] http://0.0.0.0:32400: HTTPConnectionPool(host='0.0.0.0', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7fe48f9e4f50>, 'Connection to 0.0.0.0 timed out. (connect timeout=30)'))
2019-11-24 12:11:58 ERROR (Thread-25) [plexapi] http://10.0.3.1:32400: HTTPConnectionPool(host='10.0.3.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7fe48f9dfc50>, 'Connection to 10.0.3.1 timed out. (connect timeout=30)'))
2019-11-24 12:11:58 ERROR (Thread-21) [plexapi] https://0.0.0.0.somecode.plex.direct:32400: HTTPSConnectionPool(host='0.0.0.0.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7fe48e06a6d0>, 'Connection to 0.0.0.0.somecode.plex.direct timed out. (connect timeout=30)'))
2019-11-24 12:11:58 ERROR (Thread-19) [plexapi] https://10-0-5-1.somecode.plex.direct:32400: HTTPSConnectionPool(host='10-0-5-1.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7fe490177ed0>, 'Connection to 10-0-5-1.somecode.plex.direct timed out. (connect timeout=30)'))
2019-11-24 12:11:58 ERROR (Thread-20) [plexapi] https://10-0-3-1.somecode.plex.direct:32400: HTTPSConnectionPool(host='10-0-3-1.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7fe4903d1dd0>, 'Connection to 10-0-3-1.somecode.plex.direct timed out. (connect timeout=30)'))
2019-11-24 12:11:58 INFO (SyncWorker_5) [plexapi] Resource connection OK (1s): https://192-168-0-10.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 12:11:58 INFO (SyncWorker_5) [plexapi] Resource connection ERR (30s): https://10-0-5-1.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 12:11:58 INFO (SyncWorker_5) [plexapi] Resource connection ERR (30s): https://10-0-3-1.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 12:11:58 INFO (SyncWorker_5) [plexapi] Resource connection ERR (30s): https://0.0.0.0.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 12:11:58 INFO (SyncWorker_5) [plexapi] Resource connection OK (1s): https://104-200-30-183.somecode.plex.direct:8443?X-Plex-Token=<hidden>
2019-11-24 12:11:58 INFO (SyncWorker_5) [plexapi] Resource connection ERR (0s): http://192.168.0.10:32400?X-Plex-Token=<hidden>
2019-11-24 12:11:58 INFO (SyncWorker_5) [plexapi] Resource connection ERR (30s): http://10.0.5.1:32400?X-Plex-Token=<hidden>
2019-11-24 12:11:58 INFO (SyncWorker_5) [plexapi] Resource connection ERR (30s): http://10.0.3.1:32400?X-Plex-Token=<hidden>
2019-11-24 12:11:58 INFO (SyncWorker_5) [plexapi] Resource connection ERR (30s): http://0.0.0.0:32400?X-Plex-Token=<hidden>
2019-11-24 12:11:58 INFO (SyncWorker_5) [plexapi] Resource connection ERR (0s): http://104.200.30.183:8443?X-Plex-Token=<hidden>
2019-11-24 12:11:58 INFO (SyncWorker_5) [plexapi] Connecting to Resource: https://192-168-0-10.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-24 12:12:10 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 136, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 122, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow
  File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 286, in get
    flow_id=request.query["flow_id"], user_input=None
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 82, in async_configure
    raise UnknownFlow
homeassistant.data_entry_flow.UnknownFlow

@jjlawren
Copy link
Contributor Author

Bah, it didn't take the value, there's some confusing import logic on the defaults used in the library. Sorry. Please try this one instead: 00fe033

@jjlawren
Copy link
Contributor Author

@SPCulhane did you see my last update? I'm hoping that will help your setup issues.

@SPCulhane
Copy link

I have not but I will try today

@SPCulhane
Copy link

@jjlawren I think you threoy is right. Cause it worked!! I'm going to try it again just to make sure =D

2019-11-27 07:29:18 INFO (SyncWorker_9) [plexapi] Testing 10 resource connections..
2019-11-27 07:29:18 ERROR (Thread-21) [plexapi] http://192.168.0.10:32400: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-27 07:29:18 ERROR (Thread-25) [plexapi] http://45.56.104.126:8443: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2019-11-27 07:29:28 ERROR (Thread-22) [plexapi] http://10.0.5.1:32400: HTTPConnectionPool(host='10.0.5.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f2d91c72a50>, 'Connection to 10.0.5.1 timed out. (connect timeout=10)'))
2019-11-27 07:29:28 ERROR (Thread-23) [plexapi] http://10.0.3.1:32400: HTTPConnectionPool(host='10.0.3.1', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f2d91c7ac10>, 'Connection to 10.0.3.1 timed out. (connect timeout=10)'))
2019-11-27 07:29:28 ERROR (Thread-24) [plexapi] http://0.0.0.0:32400: HTTPConnectionPool(host='0.0.0.0', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f2d91c81f10>, 'Connection to 0.0.0.0 timed out. (connect timeout=10)'))
2019-11-27 07:29:28 ERROR (Thread-18) [plexapi] https://10-0-3-1.somecode.plex.direct:32400: HTTPSConnectionPool(host='10-0-3-1.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f2d91c60ed0>, 'Connection to 10-0-3-1.somecode.plex.direct timed out. (connect timeout=10)'))
2019-11-27 07:29:28 ERROR (Thread-19) [plexapi] https://0.0.0.0.somecode.plex.direct:32400: HTTPSConnectionPool(host='0.0.0.0.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f2d91c60b50>, 'Connection to 0.0.0.0.somecode.plex.direct timed out. (connect timeout=10)'))
2019-11-27 07:29:28 ERROR (Thread-17) [plexapi] https://10-0-5-1.somecode.plex.direct:32400: HTTPSConnectionPool(host='10-0-5-1.somecode.plex.direct', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f2d91cb5cd0>, 'Connection to 10-0-5-1.somecode.plex.direct timed out. (connect timeout=10)'))
2019-11-27 07:29:28 INFO (SyncWorker_9) [plexapi] Resource connection OK (1s): https://192-168-0-10.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-27 07:29:28 INFO (SyncWorker_9) [plexapi] Resource connection ERR (10s): https://10-0-5-1.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-27 07:29:28 INFO (SyncWorker_9) [plexapi] Resource connection ERR (10s): https://10-0-3-1.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-27 07:29:28 INFO (SyncWorker_9) [plexapi] Resource connection ERR (10s): https://0.0.0.0.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-27 07:29:28 INFO (SyncWorker_9) [plexapi] Resource connection OK (1s): https://45-56-104-126.somecode.plex.direct:8443?X-Plex-Token=<hidden>
2019-11-27 07:29:28 INFO (SyncWorker_9) [plexapi] Resource connection ERR (0s): http://192.168.0.10:32400?X-Plex-Token=<hidden>
2019-11-27 07:29:28 INFO (SyncWorker_9) [plexapi] Resource connection ERR (10s): http://10.0.5.1:32400?X-Plex-Token=<hidden>
2019-11-27 07:29:28 INFO (SyncWorker_9) [plexapi] Resource connection ERR (10s): http://10.0.3.1:32400?X-Plex-Token=<hidden>
2019-11-27 07:29:28 INFO (SyncWorker_9) [plexapi] Resource connection ERR (10s): http://0.0.0.0:32400?X-Plex-Token=<hidden>
2019-11-27 07:29:28 INFO (SyncWorker_9) [plexapi] Resource connection ERR (0s): http://45.56.104.126:8443?X-Plex-Token=<hidden>
2019-11-27 07:29:28 INFO (SyncWorker_9) [plexapi] Connecting to Resource: https://192-168-0-10.somecode.plex.direct:32400?X-Plex-Token=<hidden>
2019-11-27 07:29:28 DEBUG (MainThread) [homeassistant.components.plex] Valid config created for nasbox
2019-11-27 07:29:28 INFO (MainThread) [homeassistant.setup] Setting up plex
2019-11-27 07:29:28 INFO (MainThread) [homeassistant.setup] Setup of domain plex took 0.0 seconds.
2019-11-27 07:29:28 DEBUG (MainThread) [homeassistant.components.plex] Connected to: nasbox (https://192-168-0-10.somecode.plex.direct:32400)
2019-11-27 07:29:28 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.plex
2019-11-27 07:29:28 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.plex
2019-11-27 07:29:28 DEBUG (MainThread) [homeassistant.components.plex.media_player] New entity listener created
2019-11-27 07:29:28 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.plex entity: sensor.plex_nasbox
2019-11-27 07:29:28 DEBUG (MainThread) [plexwebsocket] Websocket connected
2019-11-27 07:29:28 DEBUG (SyncWorker_2) [homeassistant.components.plex.server] Updating devices
2019-11-27 07:29:28 DEBUG (SyncWorker_2) [homeassistant.components.plex.server] New device: e930dc5dd0396643a68cd1c4264a235d
2019-11-27 07:29:28 DEBUG (SyncWorker_0) [homeassistant.components.plex.media_player] New entities: [{'device': <PlexClient:http://192.168.0.64::Family-Room-Roku>}]
2019-11-27 07:29:28 DEBUG (SyncWorker_4) [homeassistant.components.plex.sensor] Refreshing sensor [sensor-6a1712f6e5d31a709076a582be705379b85381fd]
2019-11-27 07:29:28 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new media_player.plex entity: media_player.plex_family_room_roku
2019-11-27 07:29:28 DEBUG (MainThread) [homeassistant.components.plex.media_player] Added media_player.plex_family_room_roku [6a1712f6e5d31a709076a582be705379b85381fd:e930dc5dd0396643a68cd1c4264a235d]

@chezpaul
Copy link

chezpaul commented Feb 28, 2020

Was this ever fixed? I still can't connect to my plex server. I tried the discovered integration and seeing that it didn't work, I deleted it and tried through the config file. But that also does not work.

2020-02-27 10:14:12 WARNING (SyncWorker_5) [urllib3.connection] Certificate did not match expected hostname: 192.168.1.44. Certificate: {'subject': ((('commonName', '*.406f62ccf6244745ae1xxxxx99408241.plex.direct'),),), 'subjectAltName': [('DNS', '*.406f62ccf6244745aexxxxx799408241.plex.direct')]} 2020-02-27 10:14:13 ERROR (MainThread) [homeassistant.components.plex] Plex server could not be reached: https://192.168.1.44:32400

Using:

plex:
host: !secret plex_host
port: 32400
token: !secret plex_token
ssl: true
verify_ssl: false

@jjlawren
Copy link
Contributor Author

@chezpaul not sure why it's not ignoring the certificate validation, but it's because the hostname you're using doesn't match the certificate. Try to use 192-168-1-44. 406f62ccf6244745ae1xxxxx99408241.plex.direct as the host instead.

@chezpaul
Copy link

Tried it. Still no luck but a more understandable error.

2020-02-28 11:05:45 ERROR (MainThread) [homeassistant.components.plex] Plex server could not be reached: https://192-168-1-44.406f62ccf6244745xxxxx64799408241.plex.direct:32400

@jjlawren
Copy link
Contributor Author

DNS probably isn't resolving then. Can you remove both the YAML config and integration and try to add via the integrations UI again? There's no known problems with setup now, so if you're still having issues can you please create a new issue with your details?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants