Error: Server error Google app engine with express and nodejs

和自甴很熟 提交于 2019-12-24 17:19:45

问题


Im using GAE for my nodejs express backend. It worked earlier, but suddenly I keep getting

Error: Server error. The server encountered an error and could not complete your request.

Please try again in 30 seconds.

My error logs is like this :

default[20181129t203637] "GET / HTTP/1.1" 500

default[20181129t203637] "GET /favicon.ico HTTP/1.1" 500

default[20181129t203637] "GET /favicon.ico HTTP/1.1" 500

default[20181129t203637] "GET /favicon.ico HTTP/1.1" 500

I tried adding favicon.ico to my public folder and install npm serve-favicon for the favicon.ico but same error still persist. I thought it was a limit but I tried changing accounts, changing different express project, the same error still comes out.

my app.yaml file :

runtime :nodejs8

instance_class: F4_1G

Also have cron.yaml file but I haven't run the cron job yet.

There is nothing wrong with my project when it s run locally. Is there any way to fix this?


回答1:


This is probably because you don't have active instances ready to handle requests, which causes them to time out while App Engine loads your code into a fresh instance. You can mitigate this by reducing the time it takes to load your code or by implementing warmup requests to keep your instances alive when there isn't any traffic.



来源:https://stackoverflow.com/questions/53540612/error-server-error-google-app-engine-with-express-and-nodejs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!