Python Driver on Windows 11 fails with ServiceUnavailable: Unable to retrieve routing information despite successful Test-NetConnection

"Hello, I'm trying to connect to a free Neo4j Aura instance from my local Windows 11 machine using the official Python driver, but I consistently get neo4j.exceptions.ServiceUnavailable: Unable to retrieve routing information.

I have already tried the following:

  • Confirmed my Aura instance is active and running.
  • Double- and triple-checked my connection URI, username, and password in my .env file. They are correct.
  • Run Test-NetConnection -ComputerName <your-db-address> -Port 7687 in PowerShell, and it returns TcpTestSucceeded : True. This shows there is no basic firewall or network block.
  • Tried simplifying the driver call to its most basic form: GraphDatabase.driver(uri, auth=(user, password)).
  • I am not using a VPN or any corporate proxy.

Here is the full traceback from my Python script:
C:\Users\jenks\my_test_project.venv\Scripts\python.exe C:\Users\jenks\PycharmProjects\skillforge-core\db_connection_test.py
--- Database Interaction Script Started ---
:white_check_mark: Step 1: 'skills' table check complete.
:white_check_mark: Step 2: 'Docker' skill already exists.

--- Fetching all skills from database ---

  • ID: cd695836-5935-4aff-b943-71f0380b7c0f
    Name: Docker
    Description: Containerization technology for creating isolated application environments.

:white_check_mark: Step 3: Select operation complete.
Attempting to connect to Neo4j...
URI: neo4j+s://50cba505.databases.neo4j.io
Connection failed: Unable to retrieve routing information
2025-06-27 09:45:14,760 - neo4j.pool - ERROR - Unable to retrieve routing information
Traceback (most recent call last):
File "C:\Users\jenks\PycharmProjects\skillforge-core\db_connection_test.py", line 100, in main
driver.verify_connectivity()
File "C:\Users\jenks\my_test_project.venv\Lib\site-packages\neo4j_sync\driver.py", line 1082, in verify_connectivity
self._get_server_info(session_config)
File "C:\Users\jenks\my_test_project.venv\Lib\site-packages\neo4j_sync\driver.py", line 1297, in _get_server_info
return session._get_server_info()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jenks\my_test_project.venv\Lib\site-packages\neo4j_sync\work\session.py", line 183, in _get_server_info
self._connect(READ_ACCESS, liveness_check_timeout=0)
File "C:\Users\jenks\my_test_project.venv\Lib\site-packages\neo4j_sync\work\session.py", line 136, in _connect
super()._connect(
File "C:\Users\jenks\my_test_project.venv\Lib\site-packages\neo4j_sync\work\workspace.py", line 186, in _connect
target_db = self._get_routing_target_database(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jenks\my_test_project.venv\Lib\site-packages\neo4j_sync\work\workspace.py", line 260, in _get_routing_target_database
self._pool.update_routing_table(
File "C:\Users\jenks\my_test_project.venv\Lib\site-packages\neo4j_sync\io_pool.py", line 1011, in update_routing_table
raise ServiceUnavailable("Unable to retrieve routing information")
neo4j.exceptions.ServiceUnavailable: Unable to retrieve routing information

Process finished with exit code 0

I seem to be able to make a basic TCP connection, but the driver's protocol handshake is failing. Has anyone seen this specific behavior on Windows 11? Is there a known issue with SSL/TLS certificate stores or something similar that I should be looking at?

Thank you!

@jenks.tyler

if you turn on driver debug logging as described at

does this provide more detail on the failure to connect?

Why is there Docker ?
Are you running your python inside a docker?

Could just be that there is no dns built in to resolve neo4j+s://50cba505.databases.neo4j.io (that's what the 'unable to retrieve routing' problem looks like ?

try from the cli wherever you are running:

$ curl https://50cba505.databases.neo4j.io/browser/
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><title>Neo4j Browser</title><style>* {
        padding: 0;
        margin: 0;
      }
      html,
      body {
        width: 100%;
        height: 100%;
      }</style><link rel="apple-touch-icon" sizes="57x57" href="assets/images/device-icons/apple-touch-icon-57x57.png"/><link rel="apple-touch-icon" sizes="60x60" href="assets/images/device-icons/apple-touch-icon-60x60.png"/><link rel="apple-touch-icon" sizes="72x72" href="assets/images/device-icons/apple-touch-icon-72x72.png"/><link rel="apple-touch-icon" sizes="76x76" href="assets/images/device-icons/apple-touch-icon-76x76.png"/><link rel="apple-touch-icon" sizes="114x114" href="assets/images/device-icons/apple-touch-icon-114x114.png"/><link rel="apple-touch-icon" sizes="120x120" href="assets/images/device-icons/apple-touch-icon-120x120.png"/><link rel="apple-touch-icon" sizes="144x144" href="assets/images/device-icons/apple-touch-icon-144x144.png"/><link rel="apple-touch-icon" sizes="152x152" href="assets/images/device-icons/apple-touch-icon-152x152.png"/><link rel="apple-touch-icon" sizes="180x180" href="assets/images/device-icons/apple-touch-icon-180x180.png"/><link rel="icon" type="image/png" href="assets/images/device-icons/favicon-32x32.png" sizes="32x32"/><link rel="icon" type="image/png" href="assets/images/device-icons/android-chrome-192x192.png" sizes="192x192"/><link rel="icon" type="image/png" href="assets/images/device-icons/favicon-96x96.png" sizes="96x96"/><link rel="icon" type="image/png" href="assets/images/device-icons/favicon-16x16.png" sizes="16x16"/><link rel="manifest" href="assets/images/device-icons/manifest.json"/><link rel="shortcut icon" href="assets/images/device-icons/favicon.ico"/><noscript><style>.noscript-error {
          margin: 0;
          padding: 0;
          background-color: #d2d5da;
          text-align: center;
          height: 100vh;
        }

        .noscript-message {
          margin: 300px auto;
          border: 1px solid #e6e9ee;
          padding: 30px;
          display: inline-block;
          background-color: white;
        }</style><div class="noscript-error"><div class="noscript-message">Neo4j Browser <strong>requires</strong> JavaScript to work properly. Please enable it and reload.</div></div></noscript></head><body><div id="mount"></div><script src="ui-libs-7aca2557c69da30574cf.bundle.js"></script><script src="cypher-editor-7aca2557c69da30574cf.bundle.js"></script><script src="vendor-7aca2557c69da30574cf.bundle.js"></script><script src="app-7aca2557c69da30574cf.js"></script></body></html>

@dana_canzano thank you for the suggestion.

Yes, enabling the debug logging with watch() was the key. It revealed that the generic ServiceUnavailable error was masking a BoltSecurityError: [SSLCertVerificationError].

This is the crucial piece of information, especially since my previous Test-NetConnection to the server on port 7687 was successful.

Here is the complete output from my test script with watch("neo4j", out=sys.stdout) enabled:

`C:\Users\jenks\my_test_project.venv\Scripts\python.exe C:\Users\jenks\PycharmProjects\skillforge-core\db_connection_test.py
--- Database Interaction Script Started ---
:white_check_mark: Step 1: 'skills' table check complete.
:white_check_mark: Step 2: 'Docker' skill already exists.

--- Fetching all skills from database ---

  • ID: cd695836-5935-4aff-b943-71f0380b7c0f
    Name: Docker

:white_check_mark: Step 3: Select operation complete.

--- Attempting to connect to Neo4j ---
URI: neo4j+s://50cba505.databases.neo4j.io
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,283 [#0000] _: created, routing address IPv4Address(('{link}', 7687))
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,283 [#0000] _: resolve home database
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,283 [#0000] _: attempting to update routing table from IPv4Address(('{link}', 7687))
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,283 [#0000] _: in: {link}:7687
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,406 [#0000] _: dns resolver out: 34.31.169.230:7687
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,406 [#0000] _: _acquire router connection, database=None, address=ResolvedIPv4Address(('34.31.169.230', 7687))
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,406 [#0000] _: trying to hand out new connection
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,420 [#0000] C: 34.31.169.230:7687
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,473 [#EB85] C: {link}
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,507 [#0000] C: 34.31.169.230:7687
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,507 [#0000] S: 34.31.169.230:7687 BoltSecurityError: [SSLCertVerificationError] 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 1: Operation not permitted)
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,507 [#0000] _: deactivating address ResolvedIPv4Address(('34.31.169.230', 7687))
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,507 [#0000] _: table={}
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,507 [#0000] _: failed to fetch routing info from ResolvedIPv4Address(('34.31.169.230', 7687))
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,507 [#0000] _: deactivating address IPv4Address(('{link}', 7687))
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,507 [#0000] _: table={}
[ERROR ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,507 Unable to retrieve routing information
[DEBUG ] [Thread 18676] [Task None ] 2025-06-30 09:09:39,507 [#0000] _: close
Connection failed: Unable to retrieve routing information
Traceback (most recent call last):
File "C:\Users\jenks\PycharmProjects\skillforge-core\db_connection_test.py", line 96, in main
driver.verify_connectivity()
File "C:\Users\jenks\my_test_project.venv\Lib\site-packages\neo4j_sync\driver.py", line 1082, in verify_connectivity
self._get_server_info(session_config)
File "C:\Users\jenks\my_test_project.venv\Lib\site-packages\neo4j_sync\driver.py", line 1297, in _get_server_info
return session._get_server_info()
File "C:\Users\jenks\my_test_project.venv\Lib\site-packages\neo4j_sync\work\session.py", line 183, in _get_server_info
self._connect(READ_ACCESS, liveness_check_timeout=0)
File "C:\Users\jenks\my_test_project.venv\Lib\site-packages\neo4j_sync\work\session.py", line 136, in _connect
super()._connect(
File "C:\Users\jenks\my_test_project.venv\Lib\site-packages\neo4j_sync\work\workspace.py", line 186, in _connect
target_db = self._get_routing_target_database(
File "C:\Users\jenks\my_test_project.venv\Lib\site-packages\neo4j_sync\work\workspace.py", line 260, in _get_routing_target_database
self._pool.update_routing_table(
File "C:\Users\jenks\my_test_project.venv\Lib\site-packages\neo4j_sync\io_pool.py", line 1011, in update_routing_table
raise ServiceUnavailable("Unable to retrieve routing information")
neo4j.exceptions.ServiceUnavailable: Unable to retrieve routing information`

Given that the underlying error is SSLCertVerificationError, what are the recommended next steps for debugging a potential SSL environment issue on Windows 11?

Thanks again for your help.

@joshcornejo Thank you for jumping in to help!

To answer your questions: my Python test script was running directly on my Windows host, not inside a Docker container. The Docker container in my docker-compose.yml is for a separate PostgreSQL database for another part of the project, so a container-based DNS issue wasn't the cause this time, but it was a very good thought and a common problem to check for.

Your suggestion to test the connection from the command line was also spot on. I had run a similar Test-NetConnection in PowerShell which succeeded, and that was a key step in helping prove the basic network path was working.

With the detailed debug logs, I was finally able to find the true root cause: the connection was failing with an SSLCertVerificationError during the driver's SSL handshake. It looks like it's an environment-specific issue on my machine.

Thanks again for your help in troubleshooting!

1 Like

@jenks.tyler

regarding the SSL error see if Not able to connect from python - #6 by andrei321 provides benefit

@dana_canzano Thank you - this got me what I needed. Connection made. Appreciate the help.

@jenks.tyler great to hear.
Just curious as I dont encounter the error can you explain what was the missing link and given my prior post about python and ssl cert management

Hi @dana_canzano, thank you for following up.

You were right, enabling the debug logs was the key. It immediately showed that the real issue was an SSLCertVerificationError.

The final fix was a two-step process. First, I changed my connection URI to neo4j+ssc, which successfully bypassed the SSL error. That allowed the connection to proceed and reveal a final AuthError, which I then traced to a simple configuration mistake in my local .env file.

Couldn't have solved it without the debug logs pointing me in the right direction. Thanks again!

@jenks.tyler

but +ssc, is not encrypted. It may not be a requirement for your environment