500 Server Error

846 views
Skip to first unread message

Rishi Patni

unread,
Jun 23, 2021, 3:24:01 AM6/23/21
to Google App Engine
Problem I have encountered:  

I'm deploying my node.js web app at App Engine standard environment

Issue - My code is working on port8080 but after deployment I got 500 Server Error

***Displayed error message on browser***

Error: Server Error
The server encountered an error and could not complete your request.
Please try again in 30 seconds.

***************************************

What I was expected to happen:

As code is working fine at port 8080 so I was expecting to see my app code running after app deployment same as it is running on port 8080


NOTE I have not received any !!!Critical !!!Alert or !!!Emergency in LOGS

***Error in Browser Console***
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
******************************


*----- Other information ----*


NOTE: I'm using node v12.20.0


My package.json

{
  "name": "ecomm12",
  "version": "1.0.0",
  "description": "ecommerce training and services",
  "main": "app.js",
  "engines": {
    "node": "12.x.x"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "nodemon app.js",
    "start-server": "node app.js"
  },
  "author": "R",
  "license": "ISC",
  "devDependencies": {
    "nodemon": "^2.0.7"
  },
  "dependencies": {
    "body-parser": "^1.19.0",
    "ejs": "^3.1.6",
    "express": "^4.17.1",
    "mongodb": "^3.6.9"
  }
}


is it ok to use 12.x.x package.json?
as im using nodemon is it ok to use "start": "nodemon app.js",?

Noting is there in Logs Explorer (!!!Critical !!!Alert or !!!Emergency) then how to solve this issue?

John Iacovacci

unread,
Jun 24, 2021, 9:30:33 AM6/24/21
to google-a...@googlegroups.com
App engine is very unforgiving and 500 is a generic error unfortunately Google does not have very good descriptive error reporting. I normally change code to a successful version (keep removing until something works) or use stackoverflow to debug.

--
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-appengi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/54c00553-99ee-4162-a7c8-eb391103cbffn%40googlegroups.com.

Sergi (Google Cloud Platform Support)

unread,
Jun 25, 2021, 10:26:42 AM6/25/21
to Google App Engine

Hello,

To find the root cause of this issue, if we can find the logs for this error will be helpful. 

In this documentation [1] there is a sample query that you could try to check for logs error with status 500 [2]. Alternatively you could also try running ‘gcloud app logs read’ [3] to see if you get any logs.

[1] https://cloud.google.com/logging/docs/view/query-library#gae-filters

[2]

resource.type="gae_app" AND

log_id("appengine.googleapis.com/request_log") AND

httpRequest.status>=500

[3] https://cloud.google.com/sdk/gcloud/reference/app/logs/read

Reply all
Reply to author
Forward
0 new messages