问题
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