-
Notifications
You must be signed in to change notification settings - Fork 147
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
[Bug] parseDatabaseUrl
removes path from URL
#1091
Comments
In case anyone is curious about my setup, the reason I had to use Ingress is because of a limitation on Docker Desktop on Windows, that doesn't forward the ports of the cluster to the host, however, another use case is what I mentioned, instead of a neo4j database available at root https://gist.github.com/luchillo17/68c7496b0d5b0b9cd791c236f5924ad2 |
The driver connection url doesn't support paths. Since the goal of the driver is keeping parity of functionality between different environments and languages, path in the url is not supported. Supporting path can be handy for websockets since its api supported it. However, this feature is not supported by regular sockets. About connection url see: |
That's a bummer, though I do lack context on the other languages like Java & Python, so basically the closest thing would be to expose the DB with an Ingress that uses a subdomain instead of a path like |
Yes, you should use subdomains because they will be resolve via dns. |
It worked perfectly, thanks. |
Nevermind, Browser works fine, but the Driver doesn't, this is what I get from the error when connecting with the driver and Apollo GraphQL
|
This error means the driver is trying to connect to a http server. The |
Makes no sense to me why it works ok when using |
If the driver can connect properly to the port-forwarded |
You can try to curl or telnet |
Hi @luchillo17 I just want to share this draft PR with you as it might be helpful. We are planning to release a new Helm Chart that provides a thin wrapper over the HAProxy helm chart. This will allow standard Kubernetes Ingress to work well with a Neo4j deployment. |
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 intolocalhost: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 intolocalhost:80
which breaks because I expected the web socket request to land inws://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:
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
The text was updated successfully, but these errors were encountered: