Google App Engine RPC 写入数据存储时出错

Google App Engine RPC error writing to datastore

我有一个简单的 Google App Engine 网络应用程序,它在我的本地开发环境中运行良好(包括能够 post 到数据存储区),但是当部署到 Google App Engine 我在控制台中收到以下错误消息。

请注意,第二个回溯被删节了——上面是对 datastore.Client() 实例的 put 方法的调用。

我已经尝试重新部署并尝试使用谷歌搜索错误消息,但到目前为止没有成功。有什么地方我需要告诉 GAE 我的应用程序应该有数据存储的权限吗?

非常感谢任何指点。

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.

您运行该应用程序的帐户(可能是您的 App Engine 服务帐户)应该具有数据存储所需的权限。请按说明给roles/datastore.userhere