Akhil Kv
Akhil Kv

Reputation: 169

unable to connect cloud sql from app engine

I am new to GCP. I created a cloud-SQL instance (PostgreSQL 14) and tried to connect to it from the app engine.

I am using the following code on github. https://github.com/GoogleCloudPlatform/python-docs-samples/tree/9d4343d0845d6e20e0b08d1242c38aaaf0d9c075/appengine/standard_python3/cloudsql

main_postgres.py-> as my main file

I updated the connection information in the app.yaml file according to the instance and database I created. I did not make any other changes to the main_postgres.py file.

I deployed app engine in the directory with main_postgres.py After deploying when I go to the link it says : enter image description here

I am not able to figure out where I am going wrong. any help is appreciated. thanks!

Upvotes: 1

Views: 223

Answers (2)

Robert G
Robert G

Reputation: 2065

I managed to replicate the github link you provided. I solved it by renaming the main_postgres.py file to main.py. Here's the screenshot of the output link: enter image description here

Upvotes: 1

Vishal Bulbule
Vishal Bulbule

Reputation: 307

This issue dont seems related to DB but your application configuration. check errors by running this in cloud shell when you hit appengine url.

gcloud app logs tail

Upvotes: 0

Related Questions