云数据存储模拟器在 Android 测试站中使用时返回 503 'Service Unavailable'



我正在尝试使用Android测试站。我下载了Android测试站CLI并运行./mtt start,但UI没有启动。然后我运行docker exec -it mtt cat /data/log/server/current以获取docker之外的日志。这是日志

[2020-08-12 17:34:13 +0800] [721] [INFO] Listening at: http://0.0.0.0:8086 (721)
[2020-08-12 17:34:13 +0800] [721] [INFO] Using worker: sync
[2020-08-12 17:34:13 +0800] [736] [INFO] Booting worker with pid: 736
/usr/local/lib/python3.6/dist-packages/unicategories_tools/cache.py:37: UserWarning: Unicode unicategories database is outdated. Please reinstall unicategories module to regenerate it.
'Incompatible unicategories database. '
* Running on http://0.0.0.0:8085/ (Press CTRL+C to quit)
WARNING:root:/usr/lib/google-cloud-sdk/platform/google_appengine/lib/cacerts/urlfetch_cacerts.txt missing; without this urlfetch will not be able to validate SSL certificates.
INFO:root:Skipping SDK update check.
WARNING:root:An exception has been encountered when attempting to use Application Default Credentials: File /tmp/keyfile/key.json (pointed by GOOGLE_APPLICATION_CREDENTIALS environment variable) does not exist!. Falling back on dummy AppIdentityServiceStub.
INFO:root:Starting Cloud Datastore emulator at: http://localhost:8087
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 502, in _launch
else 'SCATTERED'))
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/cloud_emulators/cloud_emulator_manager.py", line 123, in Launch
emulator_cmd=self._cmd, start_options=options, silent=silent)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/cloud_emulators/datastore/datastore_emulator.py", line 134, in __init__
if not self._WaitForStartup(deadline):
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/cloud_emulators/datastore/datastore_emulator.py", line 158, in _WaitForStartup
response, _ = self._http.request(self._host)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/__init__.py", line 1626, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/__init__.py", line 1368, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/__init__.py", line 1288, in _conn_request
conn.connect()
File "/usr/lib/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/__init__.py", line 938, in connect
self.sock.connect((self.host, self.port) + sa[2:])
File "/usr/lib/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/socks.py", line 415, in connect
self.__negotiatehttp(destpair[0], destpair[1])
File "/usr/lib/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/socks.py", line 381, in __negotiatehttp
raise HTTPError((statuscode, statusline[2]))
HTTPError: (503, 'Service Unavailable')
INFO:root:Starting API server at: http://127.0.0.1:8083
INFO:root:Starting gRPC API server at: http://localhost:44289
INFO:root:Applying all pending transactions and saving the datastore
INFO:root:Saving search indexes

云数据存储模拟器似乎返回503"服务不可用"。但我确信Cloud Datastore Emulator是通过top命令运行的。

在python脚本中添加一些日志,我得到了启动Cloud Datastore Emulator的命令,它是

'/usr/lib/google-cloud-sdk/platform/cloud-datastore-emulator/cloud_datastore_emulator', 'start', '--testing', '--regenerate_indexes=false', '--auto_id_policy=SCATTERED', '--port=8007', '--store_on_disk=true', '--store_index_configuration_on_disk=true', '--index_file=/mtt/index.yaml', '--storage_file=/tmp/mtt/datastore.db', '--require_indexes', '/tmp/tmpwvDVWT'

这个命令有什么问题吗?有人能告诉我们为什么会出现503错误吗?

更新:

我找到了原因。我在.doker/config.json中添加了no_proxy设置,它就工作了!如果您有类似的问题,只需将noProxy设置为";localhost,127.0.0.1,metadata.google.internal"将解决它。

相关内容

  • 没有找到相关文章