Hello Harmit

Thanks for your response and i have tried various options and some of them 
are by referring to the doc links you have shared.  Unfortunately i am 
still getting the same error but not sure where i am going wrong.  So i 
thought i will share some more detailed information of what are the options 
i tried ....

I understand from the documentation the App must listen on 8080 port. So i 
can confirm that i have certainly modified the App to listen on 8080 port 
and also please refer to the downloaded logs (attached to this message) 
reflecting the same.  But still i am getting the same error and in 
particular i am getting the error status of 502 for the following...

a)  requestURL of "/" which has response size of 552 
b) request URL of "/favicon.ico" which has response size of 552

 i have fixed this error of "/favicon.ico" error and it doesn't come on my 
local machine, as i have placed a "favicon.ico" file in my app root folder. 
 But not sure why this comes up only on GAE FLex.

Also one  more thing i noticed is a WARNING in the Stack driver logs such 
as.... " *Warning: connect.session() MemoryStore is not designed for a 
production environment, as it will leak memory, and will not scale past a 
single process*."

So i thought this might be indirectly causing the issue as i have not setup 
the store for "express-session", so i have fixed this by using 
"session-file-store" npm package and now my express-session code looks like 
below...

app.use(expSession({
  store: new FileStore,
  genid:(req) => {
    return uuid();
  },
  secret: 'keyboard cat',
  resave: false,
  saveUninitialized: true
}))
Again i can confirm that the above modification working perfectly fine on 
my local machine by creating the session files in its default folder of 
"/sessions" in application.

Also based on some of the online documentation, i have tried both the 
following app.yaml configuraitons...


*app.yaml configuration 1 -->*# [START gae_flex_quickstart_yaml]
runtime: nodejs
env: flex
manual_scaling:
  instances: 1  
resources:
   memory_gb: 4
# [END gae_flex_quickstart_yaml]

*app.yaml configuration 2 -->*
# [START gae_flex_quickstart_yaml]
runtime: nodejs
env: flex
manual_scaling:
  instances: 1  
resources:
  cpu: 1
   memory_gb: 0.5
  disk_size_gb: 10

But still no luck and i am still getting the same error.  I think i have 
tried every possible option including restarting my browser and clearing 
cache etc  still no luck.

SO i thought i share you the recent stack driver logs (attached to this 
message) so that you can see what could be wrong that i am missing out. 

I am pretty much done with actual coding of the application and i am eager 
to demonstrate  the POC to few of my promising business stake holders, but 
i am just stuck with this "502 bad gateway" error... and i am not sure what 
is happening.

Thanks once again for your help and cooperation to guide me and i am really 
hoping that the new information i have shared in this message along with 
the Stackdriver logs will give bit more insight for you to help resolve this

Thanks in advance

 
# [END gae_flex_quickstart_yaml]




So i thought this may be another

On Thursday, 4 July 2019 15:55:33 UTC+1, Harmit Rishi (Cloud Platform 
Support) wrote:
>
> Hello, 
>
> Thank you for using Google Groups!
>
> From what I understand, you are getting a "*502*: *BAD_GATEWAY*" error 
> message when you try to deploy your application onto Google App Engine 
> flexible. Additionally, your code base has been working on your local 
> environment and this issue is only seen when trying to implement cloud 
> technology. The good news is that I was able to find some troubleshooting 
> documentation for this type of server error. Although, you may notice the 
> links provided below point to the Cloud Endpoints documentation but the 
> troubleshooting steps pertain to App Engine flexible so it would be worth 
> while to checkout. 
>
> Based on my research, flexible environment may take a few minutes to 
> successfully respond to requests. Typically, when you encounter *5.x.x* 
> (*502, 
> 503, etc*) it is recommended to wait a minute and try the request 
> again. You may find more information about these errors specific to App 
> Engine flexible environment here 
> <https://cloud.google.com/endpoints/docs/openapi/troubleshoot-response-errors#gae_errors>
> . 
>
> However, most of the time the error code *502* with "*BAD_GATEWAY*" 
> indicates that GAE terminated the application because it *ran out of 
> memory*. By default, GAE: flex only has 1GB of memory and only 600MB is 
> available for the application container. The following documentation here 
> <https://cloud.google.com/endpoints/docs/openapi/troubleshoot-response-errors#error_message_bad_gateway>
>  describes 
> steps on how to troubleshoot this type of error (You will have to most 
> likely investigate your Stackdriver logs 
> <https://console.cloud.google.com/logs/viewer?_ga=2.65662126.-184740045.1554408906&_gac=1.241446198.1561606538.EAIaIQobChMIt4CCwd2I4wIVEbvsCh2sQgAHEAAYASAAEgKTJ_D_BwE>
> ). 
>
> I hope this helps!
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/954ad850-a12b-4053-a1e4-6803ed5aa31f%40googlegroups.com.

Attachment: gae_app_module_id_default__logs__2019-07-05T08-58.json
Description: application/json

  • [google-appe... Sai M
    • [google... 'Harmit Rishi (Cloud Platform Support)' via Google App Engine
      • [go... Sai M
        • ... 'Sami Islam' via Google App Engine

Reply via email to