Tuesday, October 13, 2009

Google App Engine File Permission Oddity

I'm posting this in the hope that it may help any poor souls who are struggling with a Python Google App Engine application at the moment. Google App Engine is a web application framework created by Google that allows developers to write Java or Python web based apps and host them on Google infrastructure. I'm working on a project using GAE and ran in to the situation that my application worked perfectly in my local development environment, but running hosted would return a blank page with no error message. Unfortunately there was also nothing in the logs, nor did any of the postings that turned up in my searches seem to help. At any rate, the problem breaks down to two issues:

1. Python scripts must be executable

That is the UNIX executable permission bit needs to be set for the Python script to run. I can't find anywhere in the docs that states this, but it seems to be the case. So Linux or Mac users, make sure you chmod +x your scripts before deploying.

2. Deploying a script with different permissions doesn't change the on server permissions

I ended up having to rename my script file because the permission change wasn't taking effect on the server. Changing the app version made no difference.

Other than the head-meets-desk struggle that the problem described above induced, learning to use Google App Engine has been a thoroughly pleasurable experience, and I look forward to using GAE in ongoing and future projects.