我有一个运行Ubuntu 15.10和docker 1.10.1的Google Compute Engine实例。当我尝试从实例上的gcloud-python访问Google Datastore时,一切正常。当我尝试从基于python:3.5
的docker容器内访问它时,我总是得到503错误。这是完整的堆栈跟踪:
>>> unit = client.get(key)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/site-packages/gcloud/datastore/client.py", line 262, in get
deferred=deferred)
File "/usr/local/lib/python3.5/site-packages/gcloud/datastore/client.py", line 303, in get_multi
transaction_id=transaction and transaction.id,
File "/usr/local/lib/python3.5/site-packages/gcloud/datastore/client.py", line 136, in _extended_lookup
transaction_id=transaction_id,
File "/usr/local/lib/python3.5/site-packages/gcloud/datastore/connection.py", line 200, in lookup
_datastore_pb2.LookupResponse)
File "/usr/local/lib/python3.5/site-packages/gcloud/datastore/connection.py", line 118, in _rpc
data=request_pb.SerializeToString())
File "/usr/local/lib/python3.5/site-packages/gcloud/datastore/connection.py", line 95, in _request
raise make_exception(headers, content, use_json=False)
gcloud.exceptions.ServiceUnavailable: 503 Backend Error
有人可以告诉我这里会发生什么吗?
答案 0 :(得分:1)
对我来说,通过启用&#34; Google Cloud Datastore API(v1beta2)&#34;解决了这个问题。这不应与&#34; Google Cloud Datastore API&#34;混淆。为此,您可以转到API Manager概述,搜索&#34;数据存储&#34;选择&#34; Google Cloud Datastore API(v1beta2)&#34;然后点击&#34;启用&#34;按钮。