Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to connect to Aura-hosted database #1082

Closed
neverstew opened this issue Apr 28, 2023 · 2 comments
Closed

Impossible to connect to Aura-hosted database #1082

neverstew opened this issue Apr 28, 2023 · 2 comments
Labels

Comments

@neverstew
Copy link

Bug Report

It's impossible to connect to a Neo4J Aura instance using this driver in a node runtime.

Here's a list of existing issues that reference problems connecting:

This can be reproduced reliably using this minimal reproduction.

This is the error

1682716039651 INFO Routing driver 0 created for server address 2433bcec.databases.neo4j.io:7687
1682716039722 INFO Driver 0 closing
/Users/mattw/dev/personal/talks/mancjs/neo4j-driver-test/node_modules/.pnpm/neo4j-driver-core@5.7.0/node_modules/neo4j-driver-core/lib/error.js:77
        _super.call(this, message, cause != null ? { cause: cause } : undefined) || this;
               ^

Neo4jError: Connection was closed by server
    at new Neo4jError (neo4j-driver-test/node_modules/.pnpm/neo4j-driver-core@5.7.0/node_modules/neo4j-driver-core/lib/error.js:77:16)
    at newError (neo4j-driver-test/node_modules/.pnpm/neo4j-driver-core@5.7.0/node_modules/neo4j-driver-core/lib/error.js:113:12)
    at NodeChannel._handleConnectionTerminated (neo4j-driver-test/node_modules/.pnpm/neo4j-driver-bolt-connection@5.7.0/node_modules/neo4j-driver-bolt-connection/lib/channel/node/node-channel.js:234:56)
    at Socket.emit (node:events:524:35)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  constructor: [Function: Neo4jError] { isRetriable: [Function (anonymous)] },
  code: 'SessionExpired',
  retriable: true
}

Node.js v19.8.1

I have gone down the rabbit hole on this one and it's extremely frustrating! I have managed to trace the problem to prove that it reliably:

  1. calls to start the Bolt handshake, never reaching inside either the resolution or rejection callback functions.
  2. Ends up calling _handleConnectionTerminated with the spurious 'SessionExpired' code.

My Environment

Javascript Runtime Version: 19.8.1
Driver Version: 5.7.0
Neo4j Version and Edition: unknown - created 2023/04/28
Operating System: MacOS 12.4

@neverstew neverstew added the bug label Apr 28, 2023
@bigmontz
Copy link
Contributor

bigmontz commented Jun 9, 2023

@neverstew, can you try with the latest version of the driver?

We had an issue with the 5.7.0 version which is already fixed in 5.7.1, but you can move directly to 5.8.1 if you want.

@neverstew
Copy link
Author

Thanks @bigmontz, just got around to trying it out on 5.8.1 and 5.9.1 and all looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants