Skip to content Skip to sidebar Skip to footer

Blank Page But No Error - Python Appengine

I'm receiving intermittent blank pages on my appengine python website. Typically these come when a new process is started or when I flush the cache. There is a single white page se

Solution 1:

Regarding the blank page issue, debugging that might be a bit involved unless you can narrow down the problem to a particular piece of your code or the GAE stack.

Appstats is a tool for GAE that hooks into each web request (as WSGI middleware) and records performance, debugging, and some other information from requests, aggregating them in an administrative interface which you can access through your GAE admin site. It's a nice way of seeing tracebacks for errors, and monitoring your site for errors (which show up as yellow boxed "E" line items in the request listing once you've installed appstats).

First, you should set up Appstats by following the directions at:

http://code.google.com/appengine/docs/python/tools/appstats.html

...which will tell you loads of useful information about every request, especially ones with errors, including a Python traceback containing what went wrong and where in the call stack, just like you're used to when debugging errors with your code locally using the Google App Engine Launcher or even just Python CLI or iPython.

Then, next time you see a blank page, hop over to your admin page or to appstats, log in, and you'll have a traceback that will tell you where in your code something broke.

Most likely, this is just something returning prematurely or an unhandled edge case somewhere in your code, but it could just as easily be cosmic rays until you have appstats to look at your request logs and debug the error.

Once you've installed Appstats and reproduced the problem, paste the traceback above, (remember to remove any user information such as passwords that may be in the traceback), and I'll revise this response to match.

Solution 2:

i just resolved this after lots of frustration.

i had renamed my script handler to 'site.py', renaming it back to 'main.py' resolved everything.

My best guess is that the stock python 'site' module was dominant on the classpath over my site.py. if someone knows more, please leave a comment here.

Solution 3:

Make sure your python indentation is consistent. For instance, either use tabs or 4 spaces or 2 spaces... don't mix them within the same function. This solved it for me! Which is annoying since a tab and 4 spaces look exactly the same to a human.

Post a Comment for "Blank Page But No Error - Python Appengine"