Skip to content

Conversation

robsdedude
Copy link
Member

Current Error

When a routing driver (neo4j[+s[sc]] URL scheme), fails to fetch a routing table, is swallows all errors from the connection and RT fetching attempts that lead up to the failure and just reports

neo4j.exceptions.ServiceUnavailable: Unable to retrieve routing information

This hides the relevant information to the user: why did this fail? SSL problems, connectivity issues, unsupported server version, ...?

New Erorr

This PR chains all errors (and their causes) as __cause__ of the top-level ServiceUnavailable. When available an ExceptionGroup is used (running on Python 3.11+), else all errors are flattened into a single cause chain.

Example Output Python 3.11

output
  | ExceptionGroup: All routing table requests failed (4 sub-exceptions)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 439, in _connect_secure
    |     s = ssl_context.wrap_socket(s, server_hostname=sni_host)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.11/ssl.py", line 517, in wrap_socket
    |     return self.sslsocket_class._create(
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.11/ssl.py", line 1108, in _create
    |     self.do_handshake()
    |   File "/usr/lib/python3.11/ssl.py", line 1379, in do_handshake
    |     self._sslobj.do_handshake()
    | ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    |     s = cls._connect_secure(
    |         ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 441, in _connect_secure
    |     raise BoltSecurityError(
    | neo4j._exceptions.BoltSecurityError: [SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    |     new_routing_info = self.fetch_routing_info(
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    |     cx = self._acquire(address, auth, deadline, None)
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    |     return connection_creator()
    |            ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    |     connection = self.opener(
    |                  ^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    |     return Bolt.open(
    |            ^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    |     s, protocol_version = BoltSocket.connect(
    |                           ^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    |     raise ServiceUnavailable(
    | neo4j.exceptions.ServiceUnavailable: Couldn't connect to [::1]:7687 (resolved to ('[::1]:7687',)):
[SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 439, in _connect_secure
    |     s = ssl_context.wrap_socket(s, server_hostname=sni_host)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.11/ssl.py", line 517, in wrap_socket
    |     return self.sslsocket_class._create(
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.11/ssl.py", line 1108, in _create
    |     self.do_handshake()
    |   File "/usr/lib/python3.11/ssl.py", line 1379, in do_handshake
    |     self._sslobj.do_handshake()
    | ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    |     s = cls._connect_secure(
    |         ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 441, in _connect_secure
    |     raise BoltSecurityError(
    | neo4j._exceptions.BoltSecurityError: [SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    |     new_routing_info = self.fetch_routing_info(
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    |     cx = self._acquire(address, auth, deadline, None)
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    |     return connection_creator()
    |            ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    |     connection = self.opener(
    |                  ^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    |     return Bolt.open(
    |            ^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    |     s, protocol_version = BoltSocket.connect(
    |                           ^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    |     raise ServiceUnavailable(
    | neo4j.exceptions.ServiceUnavailable: Couldn't connect to 127.0.0.1:7687 (resolved to ('127.0.0.1:7687',)):
[SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)
    +---------------- 3 ----------------
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    |     s = cls._connect_secure(
    |         ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 415, in _connect_secure
    |     raise ServiceUnavailable(
    | neo4j.exceptions.ServiceUnavailable: Timed out trying to establish connection to ResolvedIPv4Address(('172.0.0.1', 7687))
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    |     new_routing_info = self.fetch_routing_info(
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    |     cx = self._acquire(address, auth, deadline, None)
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    |     return connection_creator()
    |            ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    |     connection = self.opener(
    |                  ^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    |     return Bolt.open(
    |            ^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    |     s, protocol_version = BoltSocket.connect(
    |                           ^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    |     raise ServiceUnavailable(
    | neo4j.exceptions.ServiceUnavailable: Couldn't connect to 172.0.0.1:7687 (resolved to ('172.0.0.1:7687',)):
Timed out trying to establish connection to ResolvedIPv4Address(('172.0.0.1', 7687))
    +---------------- 4 ----------------
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 439, in _connect_secure
    |     s = ssl_context.wrap_socket(s, server_hostname=sni_host)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.11/ssl.py", line 517, in wrap_socket
    |     return self.sslsocket_class._create(
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.11/ssl.py", line 1108, in _create
    |     self.do_handshake()
    |   File "/usr/lib/python3.11/ssl.py", line 1379, in do_handshake
    |     self._sslobj.do_handshake()
    | ConnectionResetError: [Errno 104] Connection reset by peer
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    |     s = cls._connect_secure(
    |         ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 441, in _connect_secure
    |     raise BoltSecurityError(
    | neo4j._exceptions.BoltSecurityError: [ConnectionResetError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 104: Connection reset by peer)
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    |     new_routing_info = self.fetch_routing_info(
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    |     cx = self._acquire(address, auth, deadline, None)
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    |     return connection_creator()
    |            ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    |     connection = self.opener(
    |                  ^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    |     return Bolt.open(
    |            ^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    |     s, protocol_version = BoltSocket.connect(
    |                           ^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    |     raise ServiceUnavailable(
    | neo4j.exceptions.ServiceUnavailable: Couldn't connect to 34.78.76.49:7687 (resolved to ('34.78.76.49:7687',)):
[ConnectionResetError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 104: Connection reset by peer)
    +------------------------------------

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

Traceback (most recent call last):
  File "/home/alice/main.py", line 180, in <module>
    main()
  File "/home/alice/main.py", line 50, in main
    driver.verify_connectivity()
  File "/<neo4j-install-path>/neo4j/_sync/driver.py", line 1054, in verify_connectivity
    self._get_server_info(session_config)
  File "/<neo4j-install-path>/neo4j/_sync/driver.py", line 1283, in _get_server_info
    return session._get_server_info()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<neo4j-install-path>/neo4j/_sync/work/session.py", line 173, in _get_server_info
    self._connect(
  File "/<neo4j-install-path>/neo4j/_sync/work/session.py", line 126, in _connect
    super()._connect(
  File "/<neo4j-install-path>/neo4j/_sync/work/workspace.py", line 160, in _connect
    target_db = self._get_routing_target_database(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<neo4j-install-path>/neo4j/_sync/work/workspace.py", line 234, in _get_routing_target_database
    self._pool.update_routing_table(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 1075, in update_routing_table
    raise ServiceUnavailable(
neo4j.exceptions.ServiceUnavailable: Unable to retrieve routing information

Example Output Python 3.10

output
Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 439, in _connect_secure
    s = ssl_context.wrap_socket(s, server_hostname=sni_host)
  File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.10/ssl.py", line 1100, in _create
    self.do_handshake()
  File "/usr/lib/python3.10/ssl.py", line 1371, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007)

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    s = cls._connect_secure(
  File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 441, in _connect_secure
    raise BoltSecurityError(
neo4j._exceptions.BoltSecurityError: [SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    new_routing_info = self.fetch_routing_info(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    cx = self._acquire(address, auth, deadline, None)
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    return connection_creator()
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    connection = self.opener(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    return Bolt.open(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    s, protocol_version = BoltSocket.connect(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    raise ServiceUnavailable(
neo4j.exceptions.ServiceUnavailable: Couldn't connect to [::1]:7687 (resolved to ('[::1]:7687',)):
[SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 439, in _connect_secure
    s = ssl_context.wrap_socket(s, server_hostname=sni_host)
  File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.10/ssl.py", line 1100, in _create
    self.do_handshake()
  File "/usr/lib/python3.10/ssl.py", line 1371, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007)

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    s = cls._connect_secure(
  File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 441, in _connect_secure
    raise BoltSecurityError(
neo4j._exceptions.BoltSecurityError: [SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    new_routing_info = self.fetch_routing_info(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    cx = self._acquire(address, auth, deadline, None)
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    return connection_creator()
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    connection = self.opener(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    return Bolt.open(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    s, protocol_version = BoltSocket.connect(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    raise ServiceUnavailable(
neo4j.exceptions.ServiceUnavailable: Couldn't connect to 127.0.0.1:7687 (resolved to ('127.0.0.1:7687',)):
[SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    s = cls._connect_secure(
  File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 415, in _connect_secure
    raise ServiceUnavailable(
neo4j.exceptions.ServiceUnavailable: Timed out trying to establish connection to ResolvedIPv4Address(('172.0.0.1', 7687))

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    new_routing_info = self.fetch_routing_info(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    cx = self._acquire(address, auth, deadline, None)
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    return connection_creator()
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    connection = self.opener(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    return Bolt.open(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    s, protocol_version = BoltSocket.connect(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    raise ServiceUnavailable(
neo4j.exceptions.ServiceUnavailable: Couldn't connect to 172.0.0.1:7687 (resolved to ('172.0.0.1:7687',)):
Timed out trying to establish connection to ResolvedIPv4Address(('172.0.0.1', 7687))

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 439, in _connect_secure
    s = ssl_context.wrap_socket(s, server_hostname=sni_host)
  File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.10/ssl.py", line 1100, in _create
    self.do_handshake()
  File "/usr/lib/python3.10/ssl.py", line 1371, in do_handshake
    self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    s = cls._connect_secure(
  File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 441, in _connect_secure
    raise BoltSecurityError(
neo4j._exceptions.BoltSecurityError: [ConnectionResetError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 104: Connection reset by peer)

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    new_routing_info = self.fetch_routing_info(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    cx = self._acquire(address, auth, deadline, None)
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    return connection_creator()
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    connection = self.opener(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    return Bolt.open(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    s, protocol_version = BoltSocket.connect(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    raise ServiceUnavailable(
neo4j.exceptions.ServiceUnavailable: Couldn't connect to 34.78.76.49:7687 (resolved to ('34.78.76.49:7687',)):
[ConnectionResetError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 104: Connection reset by peer)

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

Traceback (most recent call last):
  File "//home/alice/main.py", line 180, in <module>
    main()
  File "//home/alice/main.py", line 50, in main
    driver.verify_connectivity()
  File "/<neo4j-install-path>/neo4j/_sync/driver.py", line 1054, in verify_connectivity
    self._get_server_info(session_config)
  File "/<neo4j-install-path>/neo4j/_sync/driver.py", line 1283, in _get_server_info
    return session._get_server_info()
  File "/<neo4j-install-path>/neo4j/_sync/work/session.py", line 173, in _get_server_info
    self._connect(
  File "/<neo4j-install-path>/neo4j/_sync/work/session.py", line 126, in _connect
    super()._connect(
  File "/<neo4j-install-path>/neo4j/_sync/work/workspace.py", line 160, in _connect
    target_db = self._get_routing_target_database(
  File "/<neo4j-install-path>/neo4j/_sync/work/workspace.py", line 234, in _get_routing_target_database
    self._pool.update_routing_table(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 1075, in update_routing_table
    raise ServiceUnavailable(
neo4j.exceptions.ServiceUnavailable: Unable to retrieve routing information

When a routing driver (`neo4j[+s[sc]]` URL scheme), fails to fetch a routing
table, is swallows all errors from the connection and RT fetching attempts
that lead up to the failure and just reports

```
neo4j.exceptions.ServiceUnavailable: Unable to retrieve routing information
```

This hides the relevant information to the user: why did this fail?
SSL problems, connectivity issues, unsupported server version, ...?

This PR chains all errors (and their causes) as `__cause__` of the top-level
`ServiceUnavailable`. When available an `ExceptionGroup` is used (running on
Python 3.11+), else all errors are flattened into a single cause chain.

```
  | ExceptionGroup: All routing table requests failed (4 sub-exceptions)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 439, in _connect_secure
    |     s = ssl_context.wrap_socket(s, server_hostname=sni_host)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.11/ssl.py", line 517, in wrap_socket
    |     return self.sslsocket_class._create(
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.11/ssl.py", line 1108, in _create
    |     self.do_handshake()
    |   File "/usr/lib/python3.11/ssl.py", line 1379, in do_handshake
    |     self._sslobj.do_handshake()
    | ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    |     s = cls._connect_secure(
    |         ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 441, in _connect_secure
    |     raise BoltSecurityError(
    | neo4j._exceptions.BoltSecurityError: [SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    |     new_routing_info = self.fetch_routing_info(
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    |     cx = self._acquire(address, auth, deadline, None)
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    |     return connection_creator()
    |            ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    |     connection = self.opener(
    |                  ^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    |     return Bolt.open(
    |            ^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    |     s, protocol_version = BoltSocket.connect(
    |                           ^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    |     raise ServiceUnavailable(
    | neo4j.exceptions.ServiceUnavailable: Couldn't connect to [::1]:7687 (resolved to ('[::1]:7687',)):
[SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 439, in _connect_secure
    |     s = ssl_context.wrap_socket(s, server_hostname=sni_host)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.11/ssl.py", line 517, in wrap_socket
    |     return self.sslsocket_class._create(
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.11/ssl.py", line 1108, in _create
    |     self.do_handshake()
    |   File "/usr/lib/python3.11/ssl.py", line 1379, in do_handshake
    |     self._sslobj.do_handshake()
    | ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    |     s = cls._connect_secure(
    |         ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 441, in _connect_secure
    |     raise BoltSecurityError(
    | neo4j._exceptions.BoltSecurityError: [SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    |     new_routing_info = self.fetch_routing_info(
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    |     cx = self._acquire(address, auth, deadline, None)
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    |     return connection_creator()
    |            ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    |     connection = self.opener(
    |                  ^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    |     return Bolt.open(
    |            ^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    |     s, protocol_version = BoltSocket.connect(
    |                           ^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    |     raise ServiceUnavailable(
    | neo4j.exceptions.ServiceUnavailable: Couldn't connect to 127.0.0.1:7687 (resolved to ('127.0.0.1:7687',)):
[SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)
    +---------------- 3 ----------------
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    |     s = cls._connect_secure(
    |         ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 415, in _connect_secure
    |     raise ServiceUnavailable(
    | neo4j.exceptions.ServiceUnavailable: Timed out trying to establish connection to ResolvedIPv4Address(('172.0.0.1', 7687))
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    |     new_routing_info = self.fetch_routing_info(
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    |     cx = self._acquire(address, auth, deadline, None)
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    |     return connection_creator()
    |            ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    |     connection = self.opener(
    |                  ^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    |     return Bolt.open(
    |            ^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    |     s, protocol_version = BoltSocket.connect(
    |                           ^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    |     raise ServiceUnavailable(
    | neo4j.exceptions.ServiceUnavailable: Couldn't connect to 172.0.0.1:7687 (resolved to ('172.0.0.1:7687',)):
Timed out trying to establish connection to ResolvedIPv4Address(('172.0.0.1', 7687))
    +---------------- 4 ----------------
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 439, in _connect_secure
    |     s = ssl_context.wrap_socket(s, server_hostname=sni_host)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.11/ssl.py", line 517, in wrap_socket
    |     return self.sslsocket_class._create(
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.11/ssl.py", line 1108, in _create
    |     self.do_handshake()
    |   File "/usr/lib/python3.11/ssl.py", line 1379, in do_handshake
    |     self._sslobj.do_handshake()
    | ConnectionResetError: [Errno 104] Connection reset by peer
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    |     s = cls._connect_secure(
    |         ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 441, in _connect_secure
    |     raise BoltSecurityError(
    | neo4j._exceptions.BoltSecurityError: [ConnectionResetError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 104: Connection reset by peer)
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    |     new_routing_info = self.fetch_routing_info(
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    |     cx = self._acquire(address, auth, deadline, None)
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    |     return connection_creator()
    |            ^^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    |     connection = self.opener(
    |                  ^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    |     return Bolt.open(
    |            ^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    |     s, protocol_version = BoltSocket.connect(
    |                           ^^^^^^^^^^^^^^^^^^^
    |   File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    |     raise ServiceUnavailable(
    | neo4j.exceptions.ServiceUnavailable: Couldn't connect to 34.78.76.49:7687 (resolved to ('34.78.76.49:7687',)):
[ConnectionResetError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 104: Connection reset by peer)
    +------------------------------------

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

Traceback (most recent call last):
  File "/home/alice/main.py", line 180, in <module>
    main()
  File "/home/alice/main.py", line 50, in main
    driver.verify_connectivity()
  File "/<neo4j-install-path>/neo4j/_sync/driver.py", line 1054, in verify_connectivity
    self._get_server_info(session_config)
  File "/<neo4j-install-path>/neo4j/_sync/driver.py", line 1283, in _get_server_info
    return session._get_server_info()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<neo4j-install-path>/neo4j/_sync/work/session.py", line 173, in _get_server_info
    self._connect(
  File "/<neo4j-install-path>/neo4j/_sync/work/session.py", line 126, in _connect
    super()._connect(
  File "/<neo4j-install-path>/neo4j/_sync/work/workspace.py", line 160, in _connect
    target_db = self._get_routing_target_database(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<neo4j-install-path>/neo4j/_sync/work/workspace.py", line 234, in _get_routing_target_database
    self._pool.update_routing_table(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 1075, in update_routing_table
    raise ServiceUnavailable(
neo4j.exceptions.ServiceUnavailable: Unable to retrieve routing information
```

```
Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 439, in _connect_secure
    s = ssl_context.wrap_socket(s, server_hostname=sni_host)
  File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.10/ssl.py", line 1100, in _create
    self.do_handshake()
  File "/usr/lib/python3.10/ssl.py", line 1371, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007)

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    s = cls._connect_secure(
  File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 441, in _connect_secure
    raise BoltSecurityError(
neo4j._exceptions.BoltSecurityError: [SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    new_routing_info = self.fetch_routing_info(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    cx = self._acquire(address, auth, deadline, None)
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    return connection_creator()
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    connection = self.opener(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    return Bolt.open(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    s, protocol_version = BoltSocket.connect(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    raise ServiceUnavailable(
neo4j.exceptions.ServiceUnavailable: Couldn't connect to [::1]:7687 (resolved to ('[::1]:7687',)):
[SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 439, in _connect_secure
    s = ssl_context.wrap_socket(s, server_hostname=sni_host)
  File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.10/ssl.py", line 1100, in _create
    self.do_handshake()
  File "/usr/lib/python3.10/ssl.py", line 1371, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007)

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    s = cls._connect_secure(
  File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 441, in _connect_secure
    raise BoltSecurityError(
neo4j._exceptions.BoltSecurityError: [SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    new_routing_info = self.fetch_routing_info(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    cx = self._acquire(address, auth, deadline, None)
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    return connection_creator()
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    connection = self.opener(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    return Bolt.open(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    s, protocol_version = BoltSocket.connect(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    raise ServiceUnavailable(
neo4j.exceptions.ServiceUnavailable: Couldn't connect to 127.0.0.1:7687 (resolved to ('127.0.0.1:7687',)):
[SSLEOFError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 8: Exec format error)

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    s = cls._connect_secure(
  File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 415, in _connect_secure
    raise ServiceUnavailable(
neo4j.exceptions.ServiceUnavailable: Timed out trying to establish connection to ResolvedIPv4Address(('172.0.0.1', 7687))

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    new_routing_info = self.fetch_routing_info(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    cx = self._acquire(address, auth, deadline, None)
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    return connection_creator()
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    connection = self.opener(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    return Bolt.open(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    s, protocol_version = BoltSocket.connect(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    raise ServiceUnavailable(
neo4j.exceptions.ServiceUnavailable: Couldn't connect to 172.0.0.1:7687 (resolved to ('172.0.0.1:7687',)):
Timed out trying to establish connection to ResolvedIPv4Address(('172.0.0.1', 7687))

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 439, in _connect_secure
    s = ssl_context.wrap_socket(s, server_hostname=sni_host)
  File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.10/ssl.py", line 1100, in _create
    self.do_handshake()
  File "/usr/lib/python3.10/ssl.py", line 1371, in do_handshake
    self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 324, in connect
    s = cls._connect_secure(
  File "/<neo4j-install-path>/neo4j/_async_compat/network/_bolt_socket.py", line 441, in _connect_secure
    raise BoltSecurityError(
neo4j._exceptions.BoltSecurityError: [ConnectionResetError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 104: Connection reset by peer)

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

Traceback (most recent call last):
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 832, in fetch_routing_table
    new_routing_info = self.fetch_routing_info(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 791, in fetch_routing_info
    cx = self._acquire(address, auth, deadline, None)
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 416, in _acquire
    return connection_creator()
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 231, in connection_creator
    connection = self.opener(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 710, in opener
    return Bolt.open(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt.py", line 364, in open
    s, protocol_version = BoltSocket.connect(
  File "/<neo4j-install-path>/neo4j/_sync/io/_bolt_socket.py", line 371, in connect
    raise ServiceUnavailable(
neo4j.exceptions.ServiceUnavailable: Couldn't connect to 34.78.76.49:7687 (resolved to ('34.78.76.49:7687',)):
[ConnectionResetError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 104: Connection reset by peer)

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

Traceback (most recent call last):
  File "//home/alice/main.py", line 180, in <module>
    main()
  File "//home/alice/main.py", line 50, in main
    driver.verify_connectivity()
  File "/<neo4j-install-path>/neo4j/_sync/driver.py", line 1054, in verify_connectivity
    self._get_server_info(session_config)
  File "/<neo4j-install-path>/neo4j/_sync/driver.py", line 1283, in _get_server_info
    return session._get_server_info()
  File "/<neo4j-install-path>/neo4j/_sync/work/session.py", line 173, in _get_server_info
    self._connect(
  File "/<neo4j-install-path>/neo4j/_sync/work/session.py", line 126, in _connect
    super()._connect(
  File "/<neo4j-install-path>/neo4j/_sync/work/workspace.py", line 160, in _connect
    target_db = self._get_routing_target_database(
  File "/<neo4j-install-path>/neo4j/_sync/work/workspace.py", line 234, in _get_routing_target_database
    self._pool.update_routing_table(
  File "/<neo4j-install-path>/neo4j/_sync/io/_pool.py", line 1075, in update_routing_table
    raise ServiceUnavailable(
neo4j.exceptions.ServiceUnavailable: Unable to retrieve routing information
```
@robsdedude robsdedude force-pushed the improve-discovery-error branch from 588faf2 to a831901 Compare July 17, 2025 10:29
@robsdedude robsdedude marked this pull request as ready for review July 17, 2025 12:46
Copy link
Contributor

@StephenCathcart StephenCathcart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@robsdedude robsdedude merged commit 23f8242 into neo4j:6.x Jul 18, 2025
20 checks passed
@robsdedude robsdedude deleted the improve-discovery-error branch July 18, 2025 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants