My Datastore is lost when I re-start the development server

121 views
Skip to first unread message

Jeff Gager

unread,
Apr 20, 2012, 7:33:01 AM4/20/12
to Google App Engine
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, I can persist data in the datastore and 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, see this
http://stackoverflow.com/questions/10060172/gae-sdk-1-6-4-dev-appserver-datastore-flush

adding the following to my code did not help at all however

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.

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

Tom Hanks

unread,
Apr 20, 2012, 7:46:46 AM4/20/12
to google-a...@googlegroups.com
It seems like we did the same research on this issue.

I had the same problem except with Windows 7 and my development environment is PyCharm 2.5. The only way I could get the development app server to successfully persist to disk is by invoking it from the command line and sending a keyboard interrupt to the console when I was finished. I could not reproduce this issue using Linux (Ubuntu 11.10 64bit) or Mac OS X 10.7.

This is a case where I literally solved my problem by not using Windows. 

I realize that isn't an option for everyone, so I would try manually handling the start-up and shutdown of the dev app server. 

Robert Schuppenies

unread,
Apr 20, 2012, 10:14:18 AM4/20/12
to Google App Engine
It's probably http://code.google.com/p/googleappengine/issues/detail?id=7244 which is a bug. Can you try the new SDK once we release 1.6.5 and see if that fixed the issue? FWIW, it's probably best to add your feedback to the bug then to consolidate..

thanks,
robert


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Sameer Lodha

unread,
Apr 21, 2012, 1:27:31 AM4/21/12
to google-a...@googlegroups.com
Another possible issue is that you might have changed the App ID in the app.yaml file. 

Scott McCoach

unread,
May 24, 2012, 9:57:09 AM5/24/12
to Google App Engine
Easiest fix I've found (on Windows 7) is contained in the issue
referenced by Robert http://code.google.com/p/googleappengine/issues/detail?id=7244
at the very bottom of the thread.

Upgrade to 1.6.6 and use localhost/_ah/quit to terminate the dev
server. Local datastore changes persist!

On Apr 20, 10:14 am, Robert Schuppenies <schu...@google.com> wrote:
> It's probablyhttp://code.google.com/p/googleappengine/issues/detail?id=7244
> which
> is a bug. Can you try the new SDK once we release 1.6.5 and see if that
> fixed the issue? FWIW, it's probably best to add your feedback to the bug
> then to consolidate..
>
> thanks,
> robert
>
> On Fri Apr 20 04:33:01 GMT-700 2012, Jeff Gager <jeffga...@gmail.com>
> >http://stackoverflow.com/questions/10060172/gae-sdk-1-6-4-dev-appserv...<https://www.google.com/url?sa=D&q=http://stackoverflow.com/questions/...>
Reply all
Reply to author
Forward
0 new messages