2

Is there any way to properly troubleshoot GAE 500 server errors? I know I can check from console.developers.google.com -> Monitoring -> logs, but they do not tell much. Only same thing that I can get from the browser network response 500 internal server error.

What I am looking for is the similar log to apache.log or php.log that would actually print a stacktrace of an error or an exception that happened in app.

1
  • These answers are out of date now.. (some three years later). Look for the Error Reporting panel in the google cloud platform dashboard. Feb 9, 2018 at 9:43

2 Answers 2

9

The previous answers are out of date now (some three years later). Look for the Error Reporting panel in the google cloud platform dashboard.

You will get a stack trace to the problem in your code (if the problem is in your code and I suppose you probably need to be logging errors to std err). A stack trace should help you debug a 500 error. Here's a stack trace that I just received ...

ImportError: No module named flask_assistant

at <module> (/base/data/home/apps/f~XXXX/20180209t180735.407529010683953771/main.py:31)
at LoadObject (/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/python27_lib/versions/1/google/appengine/runtime/wsgi.py:85)
at _LoadHandler (/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/python27_lib/versions/1/google/appengine/runtime/wsgi.py:299)
at Handle (/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/python27_lib/versions/1/google/appengine/runtime/wsgi.py:240)

That's how to get a stack trace in the event of a 500 error.

1
  • Yes. I read this answer but never followed it for some reason. Go in App engine dashboard and look for client errors, server errors. It will tell you. In my case I was referencing js and css files (that did not exist) in my html file. works fine on localhost, but errors on GAE
    – Aseem
    Sep 15, 2019 at 17:55
4

There's unfortunately no straightforward answer to this.

Normally, a 500 is something about which you cannot do much, as it's an error internal to the Google servers. The most we suggest is to have an exponential backoff to your requests, so that our infrastructure can "correct" the issue itself (which it usually does, and does pretty quickly).

Sometimes, some errors will throw 500 for specific behaviors (like sending a wrong format of file or a wrong variable type to a specific product). In these case, the error should be clearer. If it isn't, try to gather as much info as possible and then post it on our Issue Tracker that this error could be phrased with more info than "500"

1
  • Thanks for you answer Patrice, even though its not the one I was hoping to get. Appreciate also the tips. Oct 7, 2015 at 6:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .