502 Bad Gateway

53 views
Skip to first unread message

Carlos Martínez

unread,
Feb 27, 2018, 12:22:23 PM2/27/18
to Google App Engine
I deployed my django project in GAE and I get the 502 Bad Gateway error on all pages except the main one.
The previous version was working, but is not working since I added API calls for storage (storages.backends.gcloud.GoogleCloudStorage).
I added environment variable GOOGLE_APPLICATION_CREDENTIALS in both settings.py and app.yaml. Log shows this error:

[error] 32#32: *111 upstream prematurely closed connection while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: , request: "GET /accounts/login/ HTTP/1.1", upstream: "http://xxx.xxx.xxx.xxx:8080/accounts/login/", host: "xxxx.appspot.com", referrer: "https://xxxx.appspot.com/"

I posted a question in stackoverflow too and I get no answer. I spent 2 days in this and can't get it working.

George (Cloud Platform Support)

unread,
Feb 27, 2018, 2:52:01 PM2/27/18
to Google App Engine
How long does it take to complete the API call to storage? Your front end might not be configured for asynchronous work. 

The 502 error returned by the nginx process might have various causes: an exception raised by the application or by an internal API call, or by timing issues, if a request takes too long.  

We need copy of your relevant log entries and the portions of your code related to the API calls to storage, to continue this investigation. Meanwhile, checking your app's routing handlers may prove of consequence. 
Reply all
Reply to author
Forward
0 new messages