[BUG]: sl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1000) #7

Closed
opened 2025-01-16 08:04:53 +01:00 by jiriks74 · 1 comment
Owner

Fix potential SSL EOF errors while the Nextcloud server is down.

Error log
Traceback (most recent call last):
  File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/connectionpool.py", line 466, in _make_request
    self._validate_conn(conn)
  File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/connectionpool.py", line 1095, in _validate_conn
    conn.connect()
  File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/connection.py", line 730, in connect
    sock_and_verified = _ssl_wrap_socket_and_match_hostname(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/connection.py", line 909, in _ssl_wrap_socket_and_match_hostname
    ssl_sock = ssl_wrap_socket(
               ^^^^^^^^^^^^^^^^
  File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/util/ssl_.py", line 469, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/util/ssl_.py", line 513, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/lib/python3.12/ssl.py", line 455, in wrap_socket
    return self.sslsocket_class._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/lib/python3.12/ssl.py", line 1041, in _create
    self.do_handshake()
  File "/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/lib/python3.12/ssl.py", line 1319, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1000)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/connectionpool.py", line 490, in _make_request
    raise new_e
urllib3.exceptions.SSLError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1000)

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

Traceback (most recent call last):
  File "/nix/store/5giff6v311m4sqywc5pkdadfg3mzyfaz-python3.12-requests-2.32.3/lib/python3.12/site-packages/requests/adapters.py", line 683, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='nextcloud', port=443): Max retries exceeded with url: /ocs/v2.php/apps/notifications/api/v2/notifications (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1000)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jirka/nextcloud2ntfy/nextcloud2ntfy.py", line 283, in <module>
    main()
  File "/home/jirka/nextcloud2ntfy/nextcloud2ntfy.py", line 189, in main
    response = requests.get(
               ^^^^^^^^^^^^^
  File "/nix/store/5giff6v311m4sqywc5pkdadfg3mzyfaz-python3.12-requests-2.32.3/lib/python3.12/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5giff6v311m4sqywc5pkdadfg3mzyfaz-python3.12-requests-2.32.3/lib/python3.12/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5giff6v311m4sqywc5pkdadfg3mzyfaz-python3.12-requests-2.32.3/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5giff6v311m4sqywc5pkdadfg3mzyfaz-python3.12-requests-2.32.3/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5giff6v311m4sqywc5pkdadfg3mzyfaz-python3.12-requests-2.32.3/lib/python3.12/site-packages/requests/adapters.py", line 714, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='nextcloud', port=443): Max retries exceeded with url: /ocs/v2.php/apps/notifications/api/v2/notifications (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1000)')))
Fix potential SSL EOF errors while the Nextcloud server is down. <details> <summary>Error log</summary> ```python Traceback (most recent call last): File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/connectionpool.py", line 466, in _make_request self._validate_conn(conn) File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/connectionpool.py", line 1095, in _validate_conn conn.connect() File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/connection.py", line 730, in connect sock_and_verified = _ssl_wrap_socket_and_match_hostname( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/connection.py", line 909, in _ssl_wrap_socket_and_match_hostname ssl_sock = ssl_wrap_socket( ^^^^^^^^^^^^^^^^ File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/util/ssl_.py", line 469, in ssl_wrap_socket ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/util/ssl_.py", line 513, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock, server_hostname=server_hostname) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/lib/python3.12/ssl.py", line 455, in wrap_socket return self.sslsocket_class._create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/lib/python3.12/ssl.py", line 1041, in _create self.do_handshake() File "/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/lib/python3.12/ssl.py", line 1319, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1000) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/connectionpool.py", line 490, in _make_request raise new_e urllib3.exceptions.SSLError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1000) The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/nix/store/5giff6v311m4sqywc5pkdadfg3mzyfaz-python3.12-requests-2.32.3/lib/python3.12/site-packages/requests/adapters.py", line 683, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "/nix/store/j2jwmcj5r20ch62zm4rx4k9iv0y3wlqd-python3.12-urllib3-2.2.3/lib/python3.12/site-packages/urllib3/util/retry.py", line 519, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='nextcloud', port=443): Max retries exceeded with url: /ocs/v2.php/apps/notifications/api/v2/notifications (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1000)'))) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/jirka/nextcloud2ntfy/nextcloud2ntfy.py", line 283, in <module> main() File "/home/jirka/nextcloud2ntfy/nextcloud2ntfy.py", line 189, in main response = requests.get( ^^^^^^^^^^^^^ File "/nix/store/5giff6v311m4sqywc5pkdadfg3mzyfaz-python3.12-requests-2.32.3/lib/python3.12/site-packages/requests/api.py", line 73, in get return request("get", url, params=params, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/5giff6v311m4sqywc5pkdadfg3mzyfaz-python3.12-requests-2.32.3/lib/python3.12/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/5giff6v311m4sqywc5pkdadfg3mzyfaz-python3.12-requests-2.32.3/lib/python3.12/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/5giff6v311m4sqywc5pkdadfg3mzyfaz-python3.12-requests-2.32.3/lib/python3.12/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/5giff6v311m4sqywc5pkdadfg3mzyfaz-python3.12-requests-2.32.3/lib/python3.12/site-packages/requests/adapters.py", line 714, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='nextcloud', port=443): Max retries exceeded with url: /ocs/v2.php/apps/notifications/api/v2/notifications (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1000)'))) ``` </details>
Collaborator

Mirrored on GitHub as #GH15.

Mirrored on GitHub as [#GH15](https://github.com/jiriks74/nextcloud2ntfy/issues/15).
jiriks74 added the
bug
label 2025-01-16 08:05:19 +01:00
jiriks74 added this to the Release 1.1.0 milestone 2025-01-16 08:05:22 +01:00
jiriks74 self-assigned this 2025-01-16 08:05:26 +01:00
jiriks74 started working 2025-01-16 08:31:48 +01:00
jiriks74 stopped working 2025-01-16 09:03:34 +01:00
31 minutes 46 seconds
jiriks74 deleted spent time 2025-01-16 09:03:39 +01:00
- 31 minutes 46 seconds
jiriks74 started working 2025-01-16 15:50:32 +01:00
jiriks74 stopped working 2025-01-16 15:56:13 +01:00
5 minutes 41 seconds
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Total time spent: 5 minutes 41 seconds
jiriks74
5 minutes 41 seconds
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jiriks74/nextcloud2ntfy#7
No description provided.