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?
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) q.order("__key__") entities=q.fetch(batch_size) if len(entities): all_entities.extend(entities) start_key = entities[-1].key() i += batch_size else: break return all_entities
videos = incremental_fetch(Video.all())
What do you do if `make serve` tries to start multiple kake servers, fails, and yells at you about logging being a NoneType:
sergei: Check the kake logs at khan/webapp/genfiles/kake-server.log. If you see "nohup: Can't detach from console: No such file or directory", you are probably using tmux on OSX.
Install reattach-to-user-namespace (available via `port` and `brew`).
Now you can `reattach-to-user-namespace make serve` and see no errors!
If that worked, you can add the following to your ~/.tmux.conf to be able to `make serve` normally.
set-option -g default-command "reattach-to-user-namespace -l bash"