No such file or directory

127 views
Skip to first unread message

Chris

unread,
Nov 7, 2008, 12:45:16 AM11/7/08
to Google App Engine
I'm saving my local datastore to the same folder as my application
code (instead of the default /tmp since this is periodically deleted).
When I try to use the .put() method on a model object, I keep getting
this error:

Traceback (most recent call last):
File "/home/chris/google_appengine/google/appengine/ext/webapp/
__init__.py", line 501, in __call__
handler.post(*groups)
File "/home/chris/myapp/views.py", line 102, in post
entity.put()
File "/home/chris/google_appengine/google/appengine/ext/db/
__init__.py", line 618, in put
return datastore.Put(self._entity)
File "/home/chris/google_appengine/google/appengine/api/
datastore.py", line 160, in Put
apiproxy_stub_map.MakeSyncCall('datastore_v3', 'Put', req, resp)
File "/home/chris/google_appengine/google/appengine/api/
apiproxy_stub_map.py", line 46, in MakeSyncCall
stub.MakeSyncCall(service, call, request, response)
File "/home/chris/google_appengine/google/appengine/api/
datastore_file_stub.py", line 305, in MakeSyncCall
(getattr(self, "_Dynamic_" + call))(request, response)
File "/home/chris/google_appengine/google/appengine/api/
datastore_file_stub.py", line 353, in _Dynamic_Put
self.__WriteDatastore()
File "/home/chris/google_appengine/google/appengine/api/
datastore_file_stub.py", line 239, in __WriteDatastore
self.__WritePickled(encoded, self.__datastore_file)
File "/home/chris/google_appengine/google/appengine/api/
datastore_file_stub.py", line 291, in __WritePickled
os.rename(tmpfile.name, filename)
OSError: [Errno 2] No such file or directory

Why is this happening and how do I fix it? This doesn't happen when I
keep the datastore in /tmp, but then the datastore periodically gets
deleted...since it's in /tmp.

Chris

unread,
Nov 7, 2008, 1:23:46 AM11/7/08
to Google App Engine
This seems to be a bug in app engine, with the way datastore_path is
interpreted. Specifically, some code treats datastore_path as relative
while other code treats it as absolute.

I think this can be fixed by changing line 207 in /google/appengine/
tools/dev_appserver_main.py from:

option_dict[ARG_DATASTORE_PATH] = value

to:
option_dict[ARG_DATASTORE_PATH] = os.path.abspath(value)

Chris

Jeff S

unread,
Nov 7, 2008, 1:25:08 PM11/7/08
to Google App Engine
Hi Chris,

Thank you for tracking that down. Would you mind filing a "Review
request" in our SDK issue tracker with your patch:
http://code.google.com/p/googleappengine/issues/list Before we can
accept your patch, you'll need to sign a Contributor License Agreement
(CLA).

Individual CLA: http://code.google.com/legal/individual-cla-v1.0.html
Corporate CLA: http://code.google.com/legal/corporate-cla-v1.0.html

Thanks again,

Jeff

Marzia Niccolai

unread,
Nov 7, 2008, 3:15:20 PM11/7/08
to google-a...@googlegroups.com
Hi Chris,

If you are interested in having this change be considered for implementation in to the SDK, you should sign a CLA and submit the patch in the issue tracker.

Details can be found here:
http://groups.google.com/group/google-appengine/web/how-to-submit-a-patch-to-the-sdk

-Marzia
Reply all
Reply to author
Forward
0 new messages