Cannot Connect to Neon Database from Cloud Run

I have a Nest.js backend running with TypeORM that connects to my Neon database. If I run my Nest.js backend locally in production mode, I am able to successfully connect to the Neon database. However, as soon as I deploy it to Cloud Run using Docker containers, it is unable to spin up the server as it cannot connect to the database. Is there some security in Neon that is prohibiting my application from connecting to it within a Google Cloud Run instance?

1 Like

Hey @gabrielmcreynolds, do you mind sharing the error you’re running into?

@Mahmoud The error just says, “Unable to connect to the database. Retrying …”. When I run it on my own computer it is able to successfully connect, however when I run on Cloud Run it can’t connect which makes me think it is something to do with SSL config

@gabrielmcreynolds, did you manage to get this issue fixed? :eyes:

Just to confirm that i use CloudRun with Neon without issue (in Go with lib/pq).

1 Like

same problem here, when running Nest.js from Docker Container it can’t reach the database. Any update for this solution?