Search code examples
pythonpython-3.xgoogle-app-engineapp-engine-flexible

Add multiple cloud-sql-instances to beta-settings in Flexi


I'm trying to add 4 separate sql's to the beta_settings subheading in my app.yaml file for Python3 Flexible App Engine. When I add the set of 4 together, separated by commas like so:

beta_settings:
   cloud_sql_instances: X1, X2, X3, X4

I receive:

ERROR: (gcloud.app.deploy) Error Response: [13] An internal error occurred during deployment.

How can I have multiple SQL-instances assigned to the beta-settings?

Thanks :)


Solution

  • After a bit of searching, I discovered that it's not possible to host multiple TCP connections on the same port. Hence, I needed to add a TCP port to each instance like so, with X representing project-id:connection-name:db

    beta_settings:
        cloud_sql_instances: X1=tcp:3306,X2=tcp:3307,...Xn
    

    Note there's no spaces between instances and a unique tcp connection per instance. Mistakes in the app.yaml file sometimes are described as simple ERROR: (gcloud.app.deploy) Error Response: [13] An internal error occurred during deployment. - this can make for tedious and time-consuming debugging so save yourself the time and double-check syntax!

    Good luck!