Hi,
I teach a software development class where students progressively build a web application in Django, and eventually deploy it to Google App Engine. This is the second year we do this sequence of homeworks and, last year, we were able to successfully deploy the apps by essentially following the official "Running Django on the App Engine standard environment" instructions.
When updating the homework this year, we were able to complete all the steps but, when we got to the very end (after setting up the database and deploying the app), we keep getting the following error:
connection to server on socket "/cloudsql/rabble-borja:us-central1:rabble/.s.PGSQL.5432" failed: Connection refused Is the server running locally and accepting connections on that socket?
Furthermore, the Cloud SQL logs show the following:
Cloud SQL connection failed. config invalidated after TLS handshake failed, error = certificate had CN "", expected "rabble-borja:rabble"
Please note that the app works correctly when we run it locally and use Cloud SQL Auth Proxy to connect to the database. We're able to initialize the database, upload a fixture with some test data, and run the app without any issues. So, the database itself is definitely running, has the correct data and user, etc. The issue seems to be specifically when the app deployed on GAE tries to connect to the database.
We've tried several things to debug this issue:
Any suggestions on what could be going on?