Google App Engine: "Error: Server Error" but nothing in the logs
I deployed an app to Google App Engine. When I navigate to it, I get this:
Error: Server Error
The server encountered an error and could not complete your request.
If the problem persist开发者_开发问答s, please report your problem and mention this error message and the query that caused it.
All the pages do this. appcfg.py upload_data
doesn't work either. I'm not sure why. Am I doing something wrong here?
As an aside, it feels like sometimes I spend more time wrestling with GAE than I do actually writing code. (Although it's possible that my frustration is entirely my own fault.)
If you build your application abject (assuming you're using the webapp microframework that comes with App Engine, since you haven't mentioned that crucial detail;-) in the following way...:
application = webapp.WSGIApplication(url_to_handlers, debug=True)
the debug=True
means you should be seeing a traceback in the browser for your exceptions, making debugging far easier. (The url_to_handlers
is a list of pairs (url, handler)
, and of course I'm assuming you've imported webapp
appropriately, etc etc).
Just about every framework has debugging facilities that are at least equivalent (or better, e.g. showing a page in which by suitable clicking you can expand nested frames and examine each frame's local variables) so this should not be hard to do whatever other framework you may be using (and it's advisable until you feel your app is really solid -- after that, once you open it up beyond a small alpha-test layer of friends, you probably don't want to bother your users with full tracebacks... though I've seen many web pages do that, in all kinds of different languages and frameworks, it's still not the best user experience;-).
Most any exception that occurs only when deploying to production but isn't reproduced in the local SDK in strict mode means a weakness in the SDK, btw, and it's a good idea (once you know exactly what happened) to post a bug in the SDK's tracker. (Some things that may reasonably considered exceptions to this general rule include timeout problems, since the exact performance and workload of the deployment servers at any given time are of course essentially impossible to reproduce with any accuracy on your local SDK, so the SDK basically doesn't even try;-).
精彩评论