Search code examples
google-app-enginegoogle-cloud-datastorepython-2.7eclipse-indigo

My GAE python development datastore is never persisted to a file


I have just started using GAE (Python 2.7 SDK 1.6.4) , I have set up a simple test project using Pydev (latest version) in eclipse (indigo) on Windows XP (SP3).

It all works fine, my app can record data in the datastore and the blobstore and then retrieve it, but when I stop the development server and start it again the data in the datastore is lost. This is not the case for the blobstore which is retaining blobs fine and I can see the blobstore folder that gets created in C:\Temp

I did the sensible thing and look back through old posts and found that most people who have this problem solve it by changing the location of the datastore file, so I used the following parameters;

--datastore_path="${workspace_loc}/myproject/datastore" 
--blobstore_path="${workspace_loc}/myproject/blobstore" 
"${workspace_loc}/myproject/src" 

I moved the blobstore at the same time as you can see.

The blobstore still works, and now the blobstore folder is created in myproject folder as expected. The datastore file is still not created however, and when I stop and restart the development server the data is still lost.

The dev server startup logs include the following entry

WARNING  2012-04-20 10:49:04,513 datastore_file_stub.py:513] Could not 
read datastore data from C:\myworkspace\myproject\datastore 

So I know it is trying to create the datastore in the correct place.

Finally I lifted the whole eclipse workspace folder and copied it to another computer with exactly the same setup except it is running Windows 7 instead of Windows XP.

Everything works fine there - both the datastore file and blobstore folder are now created where I expect them to be.

I have set up eclipse, python, gae, my project and my eclipse launch file in exactly the same way on two computers, it works on one and not the other. Maybe XP is something to do with it but to be honest I think that's unlikely.

The only other clue I have come up with is that a recent change to the GAE development server stopped writing to the datastore file after every change and only flushes on exit, this problem may be closely related to mine;

App Engine local datastore content does not persist

However adding the following to my code did not help at all.

from google.appengine.tools import dev_appserver 
import atexit 
atexit.register(dev_appserver.TearDownStubs) 

So it's not down to incorrect termination sequence either as far as I can tell although it may be that I was just added it in the wrong place (I'm am new to python).

Anyway I am stumped and I would be really grateful for suggestions you guys can come up with.


Solution

  • It's probably http://code.google.com/p/googleappengine/issues/detail?id=7244 and a bug. Hopefully a fix will be available soon.