1
votes

I have a simple Google App Engine web app that runs fine in my local development environment (including being able to post to the datastore), but when deployed to Google App Engine I get the following error messages in the console.

Note that the second traceback is abridged - above it is a call to the put method of the datastore.Client() instance.

I have tried re-deploying and have tried googling the error messages but no luck so far. Is there somewhere I need to tell GAE that my app should have permission to the datastore?

Any pointers much appreciated.

Traceback (most recent call last):
  File "/env/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 57, in error_remapped_callable
    return callable_(*args, **kwargs)
  File "/env/lib/python3.7/site-packages/grpc/_channel.py", line 923, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "/env/lib/python3.7/site-packages/grpc/_channel.py", line 826, in _end_unary_response_blocking
    raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
  File "/layers/google.python.pip/pip/google/cloud/datastore/client.py", line 565, in put
    self.put_multi(entities=[entity], retry=retry, timeout=timeout)
  File "/layers/google.python.pip/pip/google/cloud/datastore/client.py", line 605, in put_multi
    current.commit(retry=retry, timeout=timeout)
  File "/layers/google.python.pip/pip/google/cloud/datastore/batch.py", line 293, in commit
    self._commit(retry=retry, timeout=timeout)
  File "/layers/google.python.pip/pip/google/cloud/datastore/batch.py", line 257, in _commit
    commit_response_pb = self._client._datastore_api.commit(
  File "/layers/google.python.pip/pip/google/cloud/datastore_v1/gapic/datastore_client.py", line 645, in commit
    return self._inner_api_calls["commit"](
  File "/layers/google.python.pip/pip/google/api_core/gapic_v1/method.py", line 145, in __call__
    return wrapped_func(*args, **kwargs)
  File "/layers/google.python.pip/pip/google/api_core/retry.py", line 281, in retry_wrapped_func
    return retry_target(
  File "/layers/google.python.pip/pip/google/api_core/retry.py", line 184, in retry_target
    return target()
  File "/layers/google.python.pip/pip/google/api_core/timeout.py", line 214, in func_with_timeout
    return func(*args, **kwargs)
  File "/layers/google.python.pip/pip/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable
    six.raise_from(exceptions.from_grpc_error(exc), exc)
  File "<string>", line 3, in raise_from
google.api_core.exceptions.PermissionDenied: 403 Missing or insufficient permissions.
1

1 Answers

1
votes

Your account that runs the app (probably your App Engine service account) should have the required permissions for the Datastore. Please give roles/datastore.user as described here