prisma-heroku
prisma-heroku copied to clipboard
Database connection issues
Hi, thank you for writing this up!
I've been following this in order to deploy to Heroku and found some issues when connecting to the database. These are the issues I'm seeing.
When the server starts I get:
SEVERE: Connection error:
org.postgresql.util.PSQLException: FATAL: permission denied for database "postgres"
Detail: User does not have CONNECT privilege.
This is very weird, because I passing a database name which is not postgres
. And then later I start getting the error:
SEVERE: Connection error:
org.postgresql.util.PSQLException: FATAL: too many connections for role "nfcsdwxwnplgnf"
This second error makes more sense, because it informs the correct user I am using to connect. But since Heroku Postgres database has a connection cap for 20, there is not much I can do to solve this. Is there a way to set Prisma connection pool max connections?
With my deployment I am able to run prisma deploy
and see that my tables were created. But I can't query the Graphql API because of the connection errors.
@marano Sorry for being absent here. Did you manage to fix the issue?
@dpetrick Hey Dominic, thank you for your response. I decided not to use prisma at the time because it seemed too resource greed. Beside the too many connections issues I was also getting out of memory errors on the server.
For the database too many connections issue it seems that now you can specify the pool size via an environment variable.
I'm having the same issue
Hello, I'm having same issue too.
I am having the same issue. Any update on this issue?
I am reopening this issue since so many people are getting stuck with it.
Any updates on this? Having this issue too, where/when is the prisma deploy executed? That seems to be the problem...
Thanks in advance!
I seemed to have solved that issue with heroku pg:reset
@trufa Could you please told us your steps, please? I did the pg:reset comand but no luck
Thank you!
I'm having this issue as well.
Because this has completely broken my web app, but my data was not important because I'm in alpha, I completely recreated from scratch the entire prisma server, database, and service on heroku. I thought for sure this would fix the problem. It didn't. I still see the "User does not have CONNECT privilege" error below. Please help.
Running bash on ⬢ desolate-dusk-32165... up, run.9920 (Hobby)
Apr 12, 2019 6:23:18 PM org.postgresql.core.v3.ConnectionFactoryImpl log
WARNING: SQLException occurred while connecting to ec2-23-23-80-20.compute-1.amazonaws.com:5432
org.postgresql.util.PSQLException: FATAL: permission denied for database "postgres"
Detail: User does not have CONNECT privilege.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2566)
at org.postgresql.core.v3.QueryExecutorImpl.
I was able to get it working, though there is likely a better way than everything I went through, essentially starting over from scratch with Heroku. https://www.prisma.io/forum/t/fatal-permission-denied-for-database-postgres/6677/2
Don't think it's a bulletproof solution, but I seemed to solve this issue by running a deploy on the database.
Importantly: the issue doesn't seem to be one of using incorrect credentials / using incorrect environment variables. I could get into the database using Postico & the exact same credentials (triple-checked against the ones Prisma was given as env vars). The problem only relented after deploying, in my case.
I'm getting this issue again today after running a deleteMany___s mutation to delete a large number of objects. Every single query now fails with:
WARNING: SQLException occurred while connecting to ec2-50-19-127-115.compute-1.amazonaws.com:5432 org.postgresql.util.PSQLException: FATAL: permission denied for database "postgres" Detail: User does not have CONNECT privilege.
Any update? I've been getting the same errors and have spent hours trying to figure it out. I don't want to recreate everything from scratch :/
FYI: This repository is just an example and I don't think there is anyone really looking into it. We need this issue to be raised at the prisma repository or at their Slack channels.