Google App engine deploy python project 502 bad gateway error

7,188 views
Skip to first unread message

Gary Ng

unread,
Oct 22, 2017, 12:21:51 PM10/22/17
to Google App Engine
I've created a virtualenv in GAE, and setup the Flask project
When I execute "python3 main.py", the default route works fine, but when I execute "gcloud app deploy" and browse the page, 502 Bad Gateway shows.

I try to find the error log by execute "gcloud app logs read"
2017-10-22 08:21:53 default[XXXXXXXXXX]  "GET /" 502
2017-10-22 08:21:54 default[XXXXXXXXXX]  "GET /favicon.ico" 502

Only these message is shown

This is the app.yaml:

    runtime: python
    env: flex
    entrypoint: gunicorn -b :$PORT main:app

    runtime_config:
      python_version: 3

Jordan (Cloud Platform Support)

unread,
Oct 23, 2017, 1:39:51 PM10/23/17
to Google App Engine
Google Groups is meant for general product discussions and not for technical support. The correct place to seek technical support is indeed Stack Overflow as you have already done

Note that '502 Bad Gateway' is returned when your application does not respond to nginx on port 8080. It is recommended to follow the Quickstart tutorial to setup your application handlers correctly in order to properly accept and respond to incoming requests. 

Aaron Butler

unread,
Feb 5, 2020, 8:41:00 AM2/5/20
to Google App Engine
Hi Jordan, 

I would recommend that the quickstart is revisited + updated as the 502 is a common issue caused by your user guide.
In fact there is even medium articles https://medium.com/@BennettGarner/deploying-a-django-application-to-google-app-engine-f9c91a30bd35 where people have attempted to use your product via the guide and also arrive at the 502.
If a large facet of your customer base are hitting this dead end while trying to use your product following your documentation then the fault lays with the product not the developer. 

Mohammad I (Cloud Platform Support)

unread,
Feb 5, 2020, 11:58:51 PM2/5/20
to Google App Engine

Hello Aaron, 


Thank you for your message. I have created an internal issue with App Engine Engineering team to update the document and notified them about your concern.

Aaron Butler

unread,
Feb 6, 2020, 8:58:38 AM2/6/20
to Google App Engine
you're my hero!

Following the current guide cloud sql works via cloud_sql_proxy running the django app local.
Ideally this would be enough to feel like you could deply. 
 
Cloud deployment instructions appear to be missing something. 
Reply all
Reply to author
Forward
0 new messages