Troubleshooting Specific Problems

A collection of tips for how to solve problems that come up from time to time. Each is annotated with who gave the answer, so you can ask them for more help if needed.

What do you do if GoogleAppEngineLauncher dies without letting go of the most coveted port of all, 8080?


$ lsof -i :8080
$ kill -9 <whichever PID you see>

What do you do if you get a "'module' object has no attribute 'xsrf'" error?

james: Stop and restart your app.

What do you do if you get a "[Errno 2] No such file or directory: '/Users/james/Sites/datastore/-Tmp-/dev_appserver.blobstore/dev~khan-academy/D/Dc7adYdDH0e_B3l5YbTuA=='" error?

james: You probably copied a datastore that referenced blobs that don't exist.  Go to your SDK console from your appengine launcher -> Datastore Viewer and delete all __BlobInfo__ entities.

What do you do when remote shell hangs when trying to fetch all when what you are trying to fetch is over 1k entities:

james: The remote shell has a 1k limit.  You can get around this by using: 
def incremental_fetch(query):
    i = 0
    batch_size = 500
    start_key = None
    all_entities = []
    while True:
        print i
        q = deepcopy(query)
        if start_key:
            q.filter("__key__ >", start_key)
        if len(entities):
            start_key = entities[-1].key()
            i += batch_size
    return all_entities

videos = incremental_fetch(Video.all())