Reputation: 21
I'm trying to run an application in a kubernetes pod that connects to a managed database using Digital Ocean's services. I'm sure the connection string is correct. Running the pod locally on my desktop connects to the database just fine, but when I try to connect from my cloud managed kubernetes instance I get the error ECONNREFUESED
Has anyone ever run into something like this before? (I'm using Prisma and Node.js)
(Both the kubernetes cluster and the postgres database are on Digital Ocean)
Here are the pod logs (I turned on all the prisma logging I could)
prisma:info Starting a postgresql pool with 9 connections.
prisma:info Started http server on http://127.0.0.1:42535
PrismaClientKnownRequestError3 [PrismaClientKnownRequestError]:
Invalid `prisma.user.findUnique()` invocation:
connect ECONNREFUSED ::1:42535
at cb (/app/node_modules/@prisma/client/runtime/index.js:36494:17)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async login (/app/src/gql/Users/resolvers.ts:267:16) {
code: 'ECONNREFUSED',
clientVersion: '2.30.3',
meta: undefined
So, that's what happens when I try to run the "login" mutation, just for an example. Prisma tries to find the user but - it can't connect - and this is the resulting error message.
Again, it's absolutely fine when I run locally in a kubernets pod on my local machine (using docker desktop). I'm sure the user/pass/port is fine because I connect fine with pgAdmin. I'm sure the connection string is correct because it works fine in my local cluster. I'm looking for something - anything - to give a clue why I can't connect from Digital Ocean! I have also tried other database providers with the same result. Error message is always the same, only thing that changes is teh port on the prisma http server. (this is desperation haha). Does anyone have any insight to what could be going on?? What could be different that allows me to connect from docker desktop's kubernetes but prevents it on Digital Ocean's cluster?
Upvotes: 1
Views: 1229
Reputation: 21
Found the "solution". Upgraded to prisma v3. If you can't do that, there's more info here: https://github.com/prisma/prisma/issues/9899
Upvotes: 0