I have an error in my datastore that stops me from viewing it via the console. I want to delete the whole datastore and start again.
The following works on the development server:
db.delete(db.Query(keys_only=True))
When I run the same on the remote sever I get the following error (and the datastore is not cleared)
illegal key.path.element.type: __Stat_PropertyType_PropertyName_Kind__
Traceback (most recent call last):
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1511, in __call__
rv = self.handle_exception(request, response, e)
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1505, in __call__
rv = self.router.dispatch(request, response)
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
return route.handler_adapter(request, response)
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1077, in __call__
return handler.dispatch()
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 547, in dispatch
return self.handle_exception(e, self.app.debug)
File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 545, in dispatch
return method(*args, **kwargs)
File "/base/data/home/apps/s~34thquote/1.360465535514332795/core/handlers/quotes.py", line 72, in get
db.delete(db.Query(keys_only=True))
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 1610, in delete
delete_async(models, **kwargs).get_result()
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/datastore/datastore_rpc.py", line 815, in get_result
result = rpc.get_result()
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 604, in get_result
return self.__get_result_hook(self)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/datastore/datastore_rpc.py", line 1653, in __delete_hook
self.check_rpc_success(rpc)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/datastore/datastore_rpc.py", line 1216, in check_rpc_success
raise _ToDatastoreError(err)
BadRequestError: illegal key.path.element.type: __Stat_PropertyType_PropertyName_Kind__
If you want to delete all the entities of a certain kind (or all kinds), the easiest way is to use datastore_admin, which is enabled in your live application’s admin console.