-
Notifications
You must be signed in to change notification settings - Fork 44
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
"Error: Invalid Prisma endpoint provided" when using docker-compose to deploy a server alongside prisma server #247
Comments
Hey @n2ctech 👋, Have you tried using |
@maticzav : Because AFAIK, the issue is in |
@divyenduz I suggest we change the |
@maticzav : Most likely no, but if someone relies on this logic for their URL validation, then their application might break. In any case, we should clearly mention this in release notes should we decide to do it. |
Thanks to inlightmedia for his answer on prisma.io In the end I found that you have to add http:// to the beginning of the service name like so: “http://prisma:4466” This worked for me |
Describe the bug
When using
docker-compose
to deploy a server (e.g. Apollo Server or graphql yoga) talking to prisma server, it is not possible to reference the prisma server container by its name because of string validation inprisma-binding
module :/app/node_modules/prisma-binding/dist/Prisma.js:44
throw new Error("Invalid Prisma endpoint provided: " + endpoint);
To Reproduce
Consider a docker-compose file:
the graphql server running in the server container will try initialise the prisma binding like so :
When running
docker-compose up
this will throw an error when the server image is built and starts running :Error: Invalid Prisma endpoint provided: prisma
This is because it expects the prisma endpoint to start with http://
When deploying to a kubernetes cluster I am experiencing the same issue because the ClusterIP service name for my prisma server pod doesn't start with "http://". Hence the server pod can't talk to prisma server inside the cluster because it crashes with the same error.
Expected behavior
I should be able to take advantage of docker-compose networking tooling with prisma (a container can reference another container's IP address using its name).
Referencing the prisma server from another service by its name (e.g. "prisma") should work.
Idem in k8s when referencing prisma by its service name from another pod.
The text was updated successfully, but these errors were encountered: