I have a Google App Engine app written in Node.js which connects to a Cloud SQL Postgres instance under the same GCP project. Previously I was using the standard environment and it worked fine, but when I switch to a flex environment, the SQL connection no longer works.
My app.yaml
:
runtime: nodejs
env: flex
manual_scaling:
instances: 1
beta_settings:
cloud_sql_instances: mopho-217900:us-central1:mopho
I'm connecting to the DB through Knex with hostname /cloudsql/mopho-217900:us-central1:mopho
. This gives me the following error:
Error: connect ENOENT /cloudsql/mopho-217900:us-central1:mopho/.s.PGSQL.5432
The username/password/database I'm providing are all valid, and continue to work if I switch back to the standard environment. It only fails when I switch to the flexible environment.