I have set up a development environment with docker on an ubuntu v23.04 base image. I have installed neo4j v5.9 and neo4j-driver for NodeJs v5.9.2.
After starting the docker image, I can access the neo4j browser via:
http://be.waterways.local:7474/browser/
Here I get the message: You are connected as user neo4j
to neo4j://be.waterways.local:7687
. I have also set up the movie database.
In my NodeJs server I try to connect to the neo4j db server:
const user = 'neo4j';
const password = 'neo4j';
const url = 'neo4j://be.waterways.local:7687';
const driver = neo4j.driver(url, neo4j.auth.basic(user, password));
const serverInfo = await driver.getServerInfo();
I get the following error:
Error executing Neo4j query: Neo4jError: Could not perform discovery. No routing servers available. Known routing table: RoutingTable[database=default database, expirationTime=0, currentTime=1687888112016, routers=[], readers=[], writers=[]]
at new Neo4jError (/app/node_modules/neo4j-driver-core/lib/error.js:77:16)
at newError (/app/node_modules/neo4j-driver-core/lib/error.js:113:12)
at RoutingConnectionProvider.<anonymous> (/app/node_modules/neo4j-driver-bolt-connection/lib/connection-provider/connection-provider-routing.js:698:68)
at step (/app/node_modules/neo4j-driver-bolt-connection/lib/connection-provider/connection-provider-routing.js:100:23)
at Object.next (/app/node_modules/neo4j-driver-bolt-connection/lib/connection-provider/connection-provider-routing.js:81:53)
at /app/node_modules/neo4j-driver-bolt-connection/lib/connection-provider/connection-provider-routing.js:75:71
at new Promise (<anonymous>)
at __awaiter (/app/node_modules/neo4j-driver-bolt-connection/lib/connection-provider/connection-provider-routing.js:71:12)
at RoutingConnectionProvider._applyRoutingTableIfPossible (/app/node_modules/neo4j-driver-bolt-connection/lib/connection-provider/connection-provider-routing.js:692:16)
at RoutingConnectionProvider.<anonymous> (/app/node_modules/neo4j-driver-bolt-connection/lib/connection-provider/connection-provider-routing.js:502:55) {
constructor: [Function: Neo4jError] { isRetriable: [Function (anonymous)] },
code: 'ServiceUnavailable',
retriable: true,
[cause]: Neo4jError: Failed to connect to server. Please ensure that your database is listening on the correct host and port and that you have compatible encryption settings both on Neo4j server and driver. Note that the default encryption setting has changed in Neo4j 4.0. Caused by: connect ECONNREFUSED 127.0.0.1:7687
at new Neo4jError (/app/node_modules/neo4j-driver-core/lib/error.js:77:16)
at newError (/app/node_modules/neo4j-driver-core/lib/error.js:113:12)
at NodeChannel._handleConnectionError (/app/node_modules/neo4j-driver-bolt-connection/lib/channel/node/node-channel.js:227:56)
at Socket.emit (node:events:511:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
constructor: [Function: Neo4jError] { isRetriable: [Function (anonymous)] },
code: 'SessionExpired',
retriable: true
}
}
If I use the url: 'bolt://be.waterways.local:7687' to connect, I only get the
"Failed to connect to server..." error:
Error executing Neo4j query: Neo4jError: Failed to connect to server. Please ensure that your database is listening on the correct host and port and that you have compatible encryption settings both on Neo4j server and driver. Note that the default encryption setting has changed in Neo4j 4.0. Caused by: connect ECONNREFUSED 127.0.0.1:7687
at new Neo4jError (/app/node_modules/neo4j-driver-core/lib/error.js:77:16)
at newError (/app/node_modules/neo4j-driver-core/lib/error.js:113:12)
at NodeChannel._handleConnectionError (/app/node_modules/neo4j-driver-bolt-connection/lib/channel/node/node-channel.js:227:56)
at Socket.emit (node:events:511:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
constructor: [Function: Neo4jError] { isRetriable: [Function (anonymous)] },
code: 'ServiceUnavailable',
retriable: true
}
Please advise as I have been stuck with this for too long now. Thank you.