Skip to content

[Bug] parseDatabaseUrl removes path from URL #1091

Open
@luchillo17

Description

@luchillo17

Bug Report

The parseDatabaseUrl function completely ignores the path, these URLs are stripped from path resulting in the wrong web socket request, this happens when we use Ingress to serve the load balancer from a path deeper than the root:

  • neo4j://localhost/neo4j/bolt gets transformed into localhost:7687, the port change kind of makes sense since the driver assumes the default port, but the path is missing.
  • neo4j://localhost:80/neo4j/bolt gets transformed into localhost:80 which breaks because I expected the web socket request to land in ws://localhost:80/neo4j/bolt.

To be more precise what I'm doing is deploying the neo4j helm chart & then using Ingress to put the load balancer service behind a path in the cluster, it is clear in the function the query is never introduced again into the URL:

image

Please note that query is being passed down but the path isn't.

Location of the function: https://github.com/neo4j/neo4j-javascript-driver/blob/5.0/packages/core/src/internal/url-util.ts#L93-L108

My Environment

image

software name version
OS Windows 10 WSL2 Ubuntu
Web browser Chrome 113.0.5672.129
node.js lts/gallium 16.20.0
npm 8.19.4
yarn 1.22.19
Neo4j Browser neo4j/neo4j-browser#1922
Neo4j -

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions