Skip to content

Read timed out with no apparent reason #421

Description

@glensc

Expected Result

plex.tv request to complete successfully.

Actual Result

ReadTimeout: HTTPSConnectionPool(host='plex.tv', port=443): Read timed out. (read timeout=30)                
traceback
2026-07-14 19:35:38,577 DEBUG[plexapi]:GET https://plex.tv/api/v2/user 
2026-07-14 19:35:38,579 DEBUG[urllib3.connectionpool]:Starting new HTTPS connection (1): plex.tv:443
2026-07-14 19:36:11,946 ERROR[plextraktsync.cli]:HTTPSConnectionPool(host='plex.tv', port=443): Read timed out. (read timeout=30)
Traceback (most recent call last):
  File "/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1281, in _make_request
    self._validate_conn(conn)
  File "/lib/python3.10/site-packages/urllib3/connectionpool.py", line 2446, in _validate_conn
    super()._validate_conn(conn)
  File "/lib/python3.10/site-packages/urllib3/connectionpool.py", line 820, in _validate_conn
    conn.connect()
  File "/lib/python3.10/site-packages/urllib3/connection.py", line 841, in connect
    sock_and_verified = _ssl_wrap_socket_and_match_hostname(
  File "/lib/python3.10/site-packages/urllib3/connection.py", line 1008, in _ssl_wrap_socket_and_match_hostname
    ssl_sock = ssl_wrap_socket(
  File "/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 883, in ssl_wrap_socket
    return _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
  File "/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 926, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/opt/homebrew/Cellar/python@3.10/3.10.20_3/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/opt/homebrew/Cellar/python@3.10/3.10.20_3/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1104, in _create
    self.do_handshake()
  File "/opt/homebrew/Cellar/python@3.10/3.10.20_3/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1375, in do_handshake
    self._sslobj.do_handshake()
TimeoutError: _ssl.c:1000: The handshake operation timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/lib/python3.10/site-packages/requests/adapters.py", line 696, in send
    resp = conn.urlopen(
  File "/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1900, in urlopen
    retries = retries.increment(
  File "/lib/python3.10/site-packages/urllib3/util/retry.py", line 515, in increment
    raise reraise(type(error), error, _stacktrace)
  File "/lib/python3.10/site-packages/urllib3/util/util.py", line 40, in reraise
    raise value
  File "/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1821, in urlopen
    response = self._make_request(  # type: ignore[call-overload,misc]
  File "/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1305, in _make_request
    raise new_e
  File "/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1283, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
  File "/lib/python3.10/site-packages/urllib3/connectionpool.py", line 847, in _raise_timeout
    raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='plex.tv', port=443): Read timed out. (read timeout=30)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./plextraktsync/cli.py", line 28, in wrap
    cmd(*args, **kwargs)
  File "./plextraktsync/commands/sync.py", line 74, in sync
    run_async(runner, walker=w, dry_run=config.dry_run)
  File "/lib/python3.10/site-packages/decorator/__init__.py", line 247, in fun
    return caller(func, *(extras + args), **kw)
  File "./plextraktsync/decorators/coro.py", line 15, in coro
    return asyncio.run(f(*args, **kwargs))
  File "/opt/homebrew/Cellar/python@3.10/3.10.20_3/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/opt/homebrew/Cellar/python@3.10/3.10.20_3/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "./plextraktsync/commands/sync.py", line 13, in run_async
    await runner.sync(**kwargs)
  File "./plextraktsync/sync/Sync.py", line 45, in sync
    pm = self.pm
  File "/opt/homebrew/Cellar/python@3.10/3.10.20_3/Frameworks/Python.framework/Versions/3.10/lib/python3.10/functools.py", line 981, in __get__
    val = self.func(instance)
  File "./plextraktsync/sync/Sync.py", line 37, in pm
    pm.register_plugins(self)
  File "./plextraktsync/sync/plugin/SyncPluginManager.py", line 68, in register_plugins
    self.pm.register(p)
  File "/lib/python3.10/site-packages/apluggy/wrap/main.py", line 126, in register
    return super().register(plugin, name=name)
  File "/lib/python3.10/site-packages/pluggy/_manager.py", line 157, in register
    hookimpl_opts = self.parse_hookimpl_opts(plugin, name)
  File "/lib/python3.10/site-packages/pluggy/_manager.py", line 184, in parse_hookimpl_opts
    method: object = getattr(plugin, name)
  File "/opt/homebrew/Cellar/python@3.10/3.10.20_3/Frameworks/Python.framework/Versions/3.10/lib/python3.10/functools.py", line 981, in __get__
    val = self.func(instance)
  File "./plextraktsync/sync/WatchListPlugin.py", line 60, in plex_wl
    return PlexWatchList(self.plex.watchlist())
  File "./plextraktsync/plex/PlexApi.py", line 248, in watchlist
    if not self.account:
  File "/opt/homebrew/Cellar/python@3.10/3.10.20_3/Frameworks/Python.framework/Versions/3.10/lib/python3.10/functools.py", line 981, in __get__
    val = self.func(instance)
  File "./plextraktsync/plex/PlexApi.py", line 241, in account
    return try_login()
  File "./plextraktsync/plex/PlexApi.py", line 236, in try_login
    return MyPlexAccount(token=plex_account_token, session=factory.session)
  File "/lib/python3.10/site-packages/plexapi/myplex.py", line 138, in __init__
    data, initpath = self._signin(username, password, code, remember, timeout)
  File "/lib/python3.10/site-packages/plexapi/myplex.py", line 143, in _signin
    return self.query(self.key), self.key
  File "/lib/python3.10/site-packages/plexapi/myplex.py", line 255, in query
    response = method(url, headers=headers, timeout=timeout, **kwargs)
  File "/lib/python3.10/site-packages/requests_cache/session.py", line 133, in get
    return self.request('GET', url, params=params, **kwargs)
  File "/lib/python3.10/site-packages/requests_cache/session.py", line 189, in request
    return super().request(method, url, *args, headers=headers, **kwargs)  # type: ignore
  File "/lib/python3.10/site-packages/requests/sessions.py", line 651, in request
    resp = self.send(prep, **send_kwargs)
  File "/lib/python3.10/site-packages/requests_cache/session.py", line 253, in send
    response = self._resend(request, actions, cached_response, **kwargs)  # type: ignore
  File "/lib/python3.10/site-packages/requests_cache/session.py", line 319, in _resend
    return self._handle_error(cached_response, actions)
  File "/lib/python3.10/site-packages/requests_cache/session.py", line 311, in _resend
    response = self._send_and_cache(request, actions, cached_response, **kwargs)
  File "/lib/python3.10/site-packages/requests_cache/session.py", line 279, in _send_and_cache
    response = super().send(request, **kwargs)
  File "/lib/python3.10/site-packages/requests/sessions.py", line 784, in send
    r = adapter.send(request, **kwargs)
  File "/lib/python3.10/site-packages/requests/adapters.py", line 742, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='plex.tv', port=443): Read timed out. (read timeout=30)

Reproduction Steps

No minimal reproducer, but reproducible from a pr:

System Information

Details
<summary>$ python -m niquests.help</summary>
{
  "charset_normalizer": {
    "version": "3.4.9"
  },
  "gil": true,
  "http1": {
    "h11": "0.16.0"
  },
  "http2": {
    "jh2": "5.0.13"
  },
  "http3": {
    "enabled": true,
    "qh3": "1.9.4"
  },
  "idna": {
    "version": "3.18"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.10.20"
  },
  "niquests": {
    "version": "3.20.1"
  },
  "ocsp": {
    "enabled": true
  },
  "platform": {
    "release": "25.5.0",
    "system": "Darwin"
  },
  "system_ssl": {
    "name": "OpenSSL 3.6.3 9 Jun 2026",
    "version": "30600030"
  },
  "urllib3.future": {
    "cohabitation_version": null,
    "version": "2.22.901"
  },
  "wassima": {
    "version": "2.1.2"
  },
  "websocket": {
    "enabled": false,
    "wsproto": null
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⚖️ not a bugDescribe an unexpected situation encountered by a user that have an explanation outside of us

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions