The API call datastore_v3.Put() enable

307 views
Skip to first unread message

Ankit Dwivedi

unread,
May 30, 2022, 7:04:51 AM5/30/22
to Google App Engine
Hi All,

We are facing a issue when trying to use memcache in one of our application and getting below error.

Traceback (most recent call last): File "/layers/google.python.pip/pip/lib/python3.9/site-packages/flask/app.py", line 2077, in wsgi_app response = self.full_dispatch_request() File "/layers/google.python.pip/pip/lib/python3.9/site-packages/flask/app.py", line 1525, in full_dispatch_request rv = self.handle_user_exception(e) File "/layers/google.python.pip/pip/lib/python3.9/site-packages/flask/app.py", line 1523, in full_dispatch_request rv = self.dispatch_request() File "/layers/google.python.pip/pip/lib/python3.9/site-packages/flask/app.py", line 1509, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) File "/srv/main.py", line 32, in root store_visit(ip_addr, usr_agt) File "/srv/main.py", line 16, in store_visit Visit(visitor='{}: {}'.format(remote_addr, user_agent)).put() File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/model.py", line 3538, in _put return self._put_async(**ctx_options).get_result() File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/tasklets.py", line 397, in get_result self.check_success() File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/tasklets.py", line 394, in check_success six.reraise(self._exception.__class__, self._exception, self._traceback) File "/layers/google.python.pip/pip/lib/python3.9/site-packages/six.py", line 719, in reraise raise value File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/tasklets.py", line 441, in _help_tasklet_along value = gen.throw(exc.__class__, exc, tb) File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/context.py", line 850, in put key = yield self._put_batcher.add(entity, options) File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/tasklets.py", line 441, in _help_tasklet_along value = gen.throw(exc.__class__, exc, tb) File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/context.py", line 382, in _put_tasklet keys = yield self._conn.async_put(options, datastore_entities) File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/tasklets.py", line 527, in _on_rpc_completion result = rpc.get_result() File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/api/apiproxy_stub_map.py", line 648, in get_result return self.__get_result_hook(self) File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/datastore/datastore_rpc.py", line 1875, in __put_hook self.check_rpc_success(rpc) File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/datastore/datastore_rpc.py", line 1365, in check_rpc_success rpc.check_success() File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/api/apiproxy_stub_map.py", line 614, in check_success self.__rpc.CheckSuccess() File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/api/apiproxy_rpc.py", line 149, in CheckSuccess raise self.exception File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/runtime/default_api_stub.py", line 276, in _CaptureTrace f(**kwargs) File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/runtime/default_api_stub.py", line 269, in _SendRequest raise self._TranslateToError(parsed_response) File "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/runtime/default_api_stub.py", line 135, in _TranslateToError raise self._ErrorException(exception_type, msg) google.appengine.runtime.apiproxy_errors.FeatureNotEnabledError: The API call datastore_v3.Put() is currently not enabled. -- Additional details from server: App Engine APIs are not enabled, please add app_engine_apis: true to your app.yaml to enable.

We have already given app_engine_apis: true in our app.yaml file but still getting same error.

app.yam file -:
            runtime: python39
            app_engine_apis: true

GCP Sample code for testing we are using - 

Can you please help us to resolve this issue.

Regards,
Rohit Chauhan

Ankit Dwivedi

unread,
May 30, 2022, 1:24:50 PM5/30/22
to Google App Engine
Can anyone help us into this please.

NoCommandLine

unread,
May 30, 2022, 3:33:27 PM5/30/22
to Google App Engine
Try deploying your app with 'gcloud app beta deploy' instead of the normal 'gcloud app deploy'

When 'Bundled API for Python 3' was first released, it was only available in beta and required you to use 'gcloud app beta' commands. If you didn't, you would get the error about enabling 'app_engine_apis' even when you had it enabled. 

The github sample/documentation still has that instruction but the main documentation no longer has it.


  ..... NoCommandLine ......
 https://nocommandline.com
A GUI for Google App Engine

NoCommandLine

unread,
May 30, 2022, 3:37:06 PM5/30/22
to Google App Engine
Correction -  'gcloud beta app deploy

Ankit Dwivedi

unread,
Jun 3, 2022, 3:17:16 AM6/3/22
to Google App Engine
Thanks, Its working with your suggestion.
Reply all
Reply to author
Forward
0 new messages