Connecting to SQL (Postgresql) instance from Go in Google Run, get "database is closed"

88 views
Skip to first unread message

Steve West

unread,
Jun 3, 2019, 10:39:22 PM6/3/19
to golang-nuts
Hi,
I have a simple Go program in Cloud Run that uses the Postgres SQL driver "github.com/lib/pq" to connect to a Cloud SQL Postgresql instance in the same Google Project. I have enabled the security by setting "Apps in this project: All authorized". The database and the Cloud Run service are in the same project.  I have used the Instance Connection Name as the connection string, however at runtime in Google Run I see the following error:

 http: panic serving 169.254.8.129:25475: sql: database is closed

Is there any further security settings to be made in order for the service to connect to the database?

Thanks.


Reply all
Reply to author
Forward
0 new messages