question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:open
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
alete89commented, Jul 27, 2020
  • Neo4j Version: 4.0.4
  • Docker Image: neo4j:4.0.4
  • Driver Version: ?
  • Operating System: Windows 10

experiencing the same.

running neo4j v4 with latest official docker image. On windows 10 host. using neo4j:// uri scheme, also tried with bolt:// with no success. both my docker-compose.yml looks like this:

neo4j:
    image: neo4j:4.0.4
    environment:
      - NEO4J_AUTH=neo4j/Password
      - NEO4J_dbms_connector_http_advertised__address=localhost:7474
      - NEO4J_dbms_connector_bolt_advertised__address=localhost:7687
    expose:
      - 7474
      - 7687
    ports:
      - 7474:7474
      - 7687:7687
1reaction
es50678commented, May 31, 2020

@oskarhane

I changed:

  • dbms.default_advertised_address to dbms.default_advertised_address=localhost
  • dbms.default_listen_address to dbms.default_listen_address=localhost

I tried with the driver using neo4j://localhost and bolt://localhost.

Unfortunately, neither worked, I’m still receiving:

Neo4jError: Could not perform discovery. No routing servers available. Known routing table: RoutingTable[database=default database, expirationTime=0, currentTime=1589408119298, routers=[], readers=[], writers=[]]

    at captureStacktrace (/mnt/c/Users/Eduardo/wsl/projects/freshit-api/node_modules/neo4j-driver/lib/result.js:263:15)
    at new Result (/mnt/c/Users/Eduardo/wsl/projects/freshit-api/node_modules/neo4j-driver/lib/result.js:68:19)
    at Session._run (/mnt/c/Users/Eduardo/wsl/projects/freshit-api/node_modules/neo4j-driver/lib/session.js:174:14)
    at Session.run (/mnt/c/Users/Eduardo/wsl/projects/freshit-api/node_modules/neo4j-driver/lib/session.js:135:19)
    at Object.<anonymous> (/mnt/c/Users/Eduardo/wsl/projects/freshit-api/index.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'
}

I’m sorry that it took me so long to reply. Thank you all again for helping me out with this ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Still Not Connecting to My Desktop - Neo4j Community
Hi everybody. Today complete 3 months since I first try to connect my Neo4j Desktop instance to a local NestJS project, and it...
Read more >
Solved: Connection failed. Could not connect - Neo4j - 17376
My Problem: I installed Neo4j Desktop, it worked. I ran :play movie graph . I loaded the Movie Graph database and experimented for...
Read more >
Unable to connect to neo4j server on my aws ec2 instance
Hello neo4j community, I am facing problem in connecting neo4j server on my AWS ec2 instance, instance was created successfully .
Read more >
Unable to connect to neo4j from a docker instance - 47362
Where is the neo4j instance?? is this in the same container?? If neo4j is outside, the container can´t see its local server (because...
Read more >
Solved: I am not able to connect to neo4j browser when i l...
Solved: Hi, I am on windows m/c and updated my neo4j desktop to lates a few weeks ago. Now since the update any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found