[QUESTION] Unable to connect to Neo4j Desktop graph instance
See original GitHub issue- Neo4j version: 4.0.1 Enterprise (via Neo4j Desktop 1.2.7)
- Neo4j Mode: Single Instance(?)
- Driver Version: 4.0.2
- Operating System: Windows 10 Pro 10.0.19041 N/A Build 19041
index.js
const neo4j = require('neo4j-driver');
const driver = neo4j.driver('neo4j://localhost', neo4j.auth.basic('neo4j', 'root'));
driver.session().run('CREATE (:Category {name: "verification" })')
.then((results) => {
console.log(results);
}).catch((errors) => {
console.log(errors);
});
I’m starting my Neo4j instance from Neo4j Desktop. The following is the log output when the instance starts:
2020-04-27 22:03:59.409+0000 INFO ======== Neo4j 4.0.1 ========
2020-04-27 22:03:59.418+0000 INFO Starting...
2020-04-27 22:04:09.086+0000 INFO Sending metrics to CSV file at C:\Users\Eduardo\.Neo4jDesktop\neo4jDatabases\database-d61afe34-ba8a-4563-95ba-28a5c3fda71b\installation-4.0.1\metrics
2020-04-27 22:04:09.132+0000 INFO Bolt enabled on localhost:7687.
2020-04-27 22:04:09.133+0000 INFO Started.
2020-04-27 22:04:09.662+0000 INFO Server thread metrics have been registered successfully
2020-04-27 22:04:11.557+0000 INFO Remote interface available at http://localhost:7474/
Expected behavior
Running node index.js
should result in:
{
records: [],
summary: ResultSummary {
query: {
text: 'CREATE (:Category {name: "verification" })',
parameters: {}
},
queryType: 'w',
counters: QueryStatistics { _stats: [Object], _systemUpdates: 0 },
updateStatistics: QueryStatistics { _stats: [Object], _systemUpdates: 0 },
plan: false,
profile: false,
notifications: [],
server: ServerInfo { address: '0.0.0.0:7687', version: 'Neo4j/4.0.1' },
resultConsumedAfter: Integer { low: 0, high: 0 },
resultAvailableAfter: Integer { low: 174, high: 0 },
database: { name: 'neo4j' }
}
}
Actual behavior
Running node index.js
should results in:
Neo4jError: Could not perform discovery. No routing servers available. Known routing table: RoutingTable[database=default database, expirationTime=0, currentTime=1588025071685, routers=[], readers=[], writers=[]]
at captureStacktrace (/mnt/c/Users/Eduardo/wsl/projects/test/node_modules/neo4j-driver/lib/result.js:263:15)
at new Result (/mnt/c/Users/Eduardo/wsl/projects/test/node_modules/neo4j-driver/lib/result.js:68:19)
at Session._run (/mnt/c/Users/Eduardo/wsl/projects/test/node_modules/neo4j-driver/lib/session.js:174:14)
at Session.run (/mnt/c/Users/Eduardo/wsl/projects/test/node_modules/neo4j-driver/lib/session.js:135:19)
at Object.<anonymous> (/mnt/c/Users/Eduardo/wsl/projects/test/test.js:5:18)
at Module._compile (internal/modules/cjs/loader.js:1156:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
code: 'ServiceUnavailable',
name: 'Neo4jError'
}
Workaround
- Neo4j Version: 4.0.1
- Docker Image: neo4j:4.0.4
- Driver Version: 4.0.2
- Operating System: Windows 10
Currently, I’m getting around this by running neo4j in a docker container.
I use the following to start up the docker container:
docker run -p 7474:7474 -p 7687:7687 --env NEO4J_AUTH=neo4j/root neo4j:4.0.1
This is the same version and username/password used in the Neo4j Desktop instance.
The only difference I can see is that it’s running in docker.
The following is the log from starting up the docker instance:
Changed password for user 'neo4j'.
Directories in use:
home: /var/lib/neo4j
config: /var/lib/neo4j/conf
logs: /logs
plugins: /var/lib/neo4j/plugins
import: /var/lib/neo4j/import
data: /var/lib/neo4j/data
certificates: /var/lib/neo4j/certificates
run: /var/lib/neo4j/run
Starting Neo4j.
2020-04-27 22:01:31.727+0000 INFO ======== Neo4j 4.0.1 ========
2020-04-27 22:01:31.740+0000 INFO Starting...
2020-04-27 22:01:39.771+0000 INFO Bolt enabled on 0.0.0.0:7687.
2020-04-27 22:01:39.772+0000 INFO Started.
2020-04-27 22:01:41.577+0000 INFO Remote interface available at http://0.0.0.0:7474/
Has anyone else ran into this? Can you help point me in the right direction?
I intend to continue using the docker instance instead of Neo4j Desktop, I’m just curious as to what the difference is that’s causing my issue.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (2 by maintainers)
experiencing the same.
running neo4j v4 with latest official docker image. On windows 10 host. using
neo4j://
uri scheme, also tried withbolt://
with no success. both my docker-compose.yml looks like this:@oskarhane
I changed:
dbms.default_advertised_address
todbms.default_advertised_address=localhost
dbms.default_listen_address
todbms.default_listen_address=localhost
I tried with the driver using
neo4j://localhost
andbolt://localhost
.Unfortunately, neither worked, I’m still receiving:
I’m sorry that it took me so long to reply. Thank you all again for helping me out with this ❤️