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.

Cannot Query: "Could not perform discovery. No routing servers available."

See original GitHub issue

Details

  • Neo4j version: Community 3.5.13
  • Neo4j Mode: Single instance
  • Driver version: Nodejs driver 4.0.1
  • Operating system: Debian 9

My code:

const config = {
  "neo4j": {
    "url": "neo4j://localhost",
    "authUser": "neo4j",
    "authKey": "adminPassword"
  }
}
const neo4j = require("neo4j-driver");
const driver = neo4j.driver(
  config.neo4j.url,
  neo4j.auth.basic(config.neo4j.authUser, config.neo4j.authKey)
);

session
  .run(`CREATE (user:User { username: "@bestulo" })`)
  .then(r => {
    console.log("r: ", r);
    session.close();
    driver.close();
  })
  .catch(console.error);

The error:

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

    at captureStacktrace (/home/nim/projects/node/doggo/node_modules/neo4j-driver/lib/result.js:263:15)
    at new Result (/home/nim/projects/node/doggo/node_modules/neo4j-driver/lib/result.js:68:19)
    at Session._run (/home/nim/projects/node/doggo/node_modules/neo4j-driver/lib/session.js:172:14)
    at Session.run (/home/nim/projects/node/doggo/node_modules/neo4j-driver/lib/session.js:135:19)
    at Object.<anonymous> (/home/nim/projects/node/doggo/index.js:24:4)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:877:12) code: 'ServiceUnavailable', name: 'Neo4jError' }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

11reactions
gjmwoodscommented, Dec 24, 2019

Hi @Bestulo, Thanks for the issue and for providing all the details.

The issue is compatibility between the neo4j:// scheme and v3 of the server. neo4j:// was introduced in v4 as a service level abstraction URI and replacement for bolt+routing://. Since routing is not needed for a single instance, v3 of the server doesn’t return this routing information.

There are a couple of ways to fix this:

  1. You can use the bolt:// scheme.
  2. Upgrading the server to v4

We will make this compatibility issue clearer in the documentation for v4.

Cheers Greg

3reactions
gjmwoodscommented, Mar 2, 2022

@dryhurst I see that you were successful in reaching out in the nest-neo4j repo for this issue: https://github.com/adam-cowley/nest-neo4j/issues/9. Please let us know, by openning a separate ticket, if you need further help.

@timurgen Please open a separate ticket on the repository with all the requested information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'Could not perform discovery. No routing servers available ...
This error arises mainly from the client (internet) browser used to connect to the AuraDB Instance. Internet browser applications like Google ...
Read more >
node.js - Routing issue in neo4j 4.0 with multiple databases
But When I tried to run a query using graphql playground, graphql server gives the following error. "Could not perform discovery. No routing...
Read more >
neo4jrb/neo4j - Gitter
Neo4j::Driver::Exceptions::ServiceUnavailableException : Could not perform discovery. No routing servers available. Heinrich Klobuczek. @klobuczek.
Read more >
Neo4j Javascript Driver / socrano - Observable
Whole Query. allNodeOriginal = Neo4jError: Could not perform discovery. No routing servers available. Known routing table: RoutingTable[database=default ...
Read more >
Stuck on Fetching Databases : r/Neo4j - Reddit
DBMS query error : Could not perform discovery. No routing servers available. Known routing table: RoutingTable[database=default database, ...
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