6

Sorry for asking the nth permutation of this question, but i'm stymied.

I'm running GAE for python2.5 on OS X, and i'm losing all data between reboots. From what I understand from related SO posts, the default location for local datastore file is wiped with each reboot. I have tried changing the location to a central /datastores directory with:

dev_appserver.py --datastore_path=/Users/Me/gae_apps/datastores /Users/Me/gae_apps/app_1

which doesn't generate an error, but when i fire up dev_appserver.py after rebooting, I see this output, and the data is again wiped:

WARNING  2011-07-14 17:50:56,297 urlfetch_stub.py:108] No ssl package found. urlfetch will not be able to validate SSL certificates. 
INFO     2011-07-14 17:50:57,653 appengine_rpc.py:159] Server: appengine.google.com
INFO     2011-07-14 17:50:57,722 appcfg.py:453] Checking for updates to the SDK.
INFO     2011-07-14 17:50:58,448 appcfg.py:470] The SDK is up to date.
WARNING  2011-07-14 17:50:58,448 datastore_file_stub.py:511] Could not read datastore data from /var/folders/ps/psEgjl3fF+C5hecCKN2AW++++TI/-Tmp-/dev_appserver.datastore
INFO     2011-07-14 17:50:58,486 rdbms_sqlite.py:58] Connecting to SQLite database '' with file '/var/folders/ps/psEgjl3fF+C5hecCKN2AW++++TI/-Tmp-/dev_appserver.rdbms'
WARNING  2011-07-14 17:50:58,521 dev_appserver.py:4700] Could not initialize images API; you are likely missing the Python "PIL" module. ImportError: No module named _imaging
INFO     2011-07-14 17:50:58,689 dev_appserver_multiprocess.py:637] Running application portfolio on port 8080: http://localhost:8080

I should mention that i have several apps, all of which sit in separate directories under /Users/Me/gae_apps/

Not sure if this is related to the failure to read dev_appserver.datastore and subsequent switch to SQLite or not.

Any help would be greatly appreciated. thanks!

Jeff C.
  • 97
  • 1
  • 7
  • I've got the same problem and haven't found a fix so I've bountied it. I even lose data sometimes without a system reboot - just stopping the server for a while and then restarting it. --datastore_path doesn't seem to work and I've even tried backing up the files in that folder and replacing them after rebooting. It loads the rdbms file, supposedly, but there's no data. I don't have time to go into this further but it is a pain in the neck. – aptwebapps Jul 22 '11 at 09:54
  • Somewhat mysteriously, my data has stopped disappearing. No idea how long this will last as I don't know what caused it. – aptwebapps Jul 26 '11 at 12:12
  • Try installing the latest gae sdk. As the case here: http://stackoverflow.com/questions/10998936/app-engine-datastore-auto-clears-every-time-project-runs – radztech Aug 27 '12 at 09:12

5 Answers5

2

Doing this "*--blobstore_path=/Users/me/Documents/workspace/app-name/ --datastore_path=/Users/me/Documents/workspace/app-name/datastore.rbm*", is working for me, on OS X.

Ali SAID OMAR
  • 6,404
  • 8
  • 39
  • 56
1

I had this problem in Linux for one of the versions of GAE. What I did then was run dev_appserver.py without specifying datastore_path. I then locate dev_appserver.datastore and/or dev_appserver.rdbms (I forget which now) which was in /tmp in Linux. I then copied both these files to my ~/gae/datastore/.

After that when I ran dev_appserver.py with --datastore_path it worked without any issues.

Not sure if it will work on OS X but its worth a shot.

arunkumar
  • 32,803
  • 4
  • 32
  • 47
  • I tried that it but if I pointed it at the rdbms file it would crash and if I pointed at the other (don't remember the extension) it would error and use the default just long the asker's text dump has it. – aptwebapps Jul 29 '11 at 11:55
0

I have been struggling with this issue for a very long time. This finally worked, thanks to the answer by said-omar.

Simply add this as your flag: --datastore_path=/Users/me/Documents/workspace/app-name/datastore.rbm

..obviously changing everything before "/datastore.rbm" to point to the directory where you want the database stored.

BandfuzzAlex
  • 171
  • 1
  • 1
  • 9
0

Possibly a sledgehammer to crack a nut here but if the patches are no help you can script the AppEngine and force it to use a different path on startup.

Wolfwyrd
  • 15,716
  • 5
  • 47
  • 67
  • That bug is on google-app-engine-django, which I'm not using. – aptwebapps Jul 26 '11 at 12:11
  • My bad, i'll take that part out. Is the scripting part of any use? – Wolfwyrd Jul 26 '11 at 12:13
  • Possibly. The context there is still django on appengine but maybe it would work. I'm in a crunch right now and my data magically stopped disappearing so I don't really have the time right now to try it out. Not to mention I don't want to rock the delicate boat that it seems to be. – aptwebapps Jul 28 '11 at 09:55
0

Have you tried inserting any data in the datastore after starting up the server with the new datastore location? When I don't insert any new data, I get the error you mention: Could not read datastore data from ....

However, when I start up my app, register, and then restart the app, I get no errors, and the new datastore location is used.

Maybe I'm misreading your question and you are inserting data after the restart. In that case, I can't reproduce your issue.

Dan Loewenherz
  • 10,879
  • 7
  • 50
  • 81
  • Well, that error message in the original question arises when you try to specify a custom location for the database and it occurs at startup - not at write time. Currently things are working fine and there is no error message but I am not trying a custom location. Previously, I would start my app, and there would be no data so I don't think I ever started off by trying to write data. This answer and Wolfwyrd's above deserve more investigation, but I don't have the time and don't want to jeopardize my setup. I have a release tomorrow. – aptwebapps Jul 29 '11 at 06:29