我正在实施Quickstart中的步骤。
我确实注意到another question。
我仔细检查了app.yaml中的env_variables
部分是否具有ENDPOINTS_SERVICE_NAME
和ENDPOINTS_SERVICE_VERSION
的正确值。
../_啊/ api / explorer没有在'服务'下显示任何端点。
这是什么错误以及如何解决?
错误日志显示:
(/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/runtime/wsgi.py:263)
Traceback (most recent call last):
File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
File "/base/data/home/apps/s~test-app-129421/20170217t185546.399267289806711006/main.py", line 103, in <module>
api = endpoints.api_server([EchoApi])
File "/base/data/home/apps/s~test-app-129421/20170217t185546.399267289806711006/lib/endpoints/apiserving.py", line 520, in api_server
controller)
File "/base/data/home/apps/s~test-app-129421/20170217t185546.399267289806711006/lib/google/api/control/wsgi.py", line 121, in add_all
a_service = loader.load()
File "/base/data/home/apps/s~test-app-129421/20170217t185546.399267289806711006/lib/google/api/control/service.py", line 110, in load
return self._load_func(**kw)
File "/base/data/home/apps/s~test-app-129421/20170217t185546.399267289806711006/lib/google/api/config/service_config.py", line 78, in fetch_service_config
_log_and_raise(Exception, message_template.format(status_code))
File "/base/data/home/apps/s~test-app-129421/20170217t185546.399267289806711006/lib/google/api/config/service_config.py", line 126, in _log_and_raise
raise exception_class(message)
Exception: Fetching service config failed (status code 404)
答案 0 :(得分:4)
我有相同的异常追踪,除了我的是403.希望对我有同样挫折的其他人有帮助。
javascript: $( "body" ).off();
我终于发现在我的app.yaml中它有来自GIT克隆
javascript: $( "body" ).off("cut copy paste", "**");
Quickstart只指示我替换你的PROJECT-ID。
我还必须用.appspot.com替换.cloud.goog
答案 1 :(得分:3)
我有app myapp
首先展示服务:
D:\projects\barcode\ebk>gcloud service-management configs list --service=myapp.appspot.com
CONFIG_ID SERVICE_NAME
2017-06-29r3 myapp.appspot.com
2017-06-29r2 myapp.appspot.com
2017-06-29r1 myapp.appspot.com
2017-06-29r0 myapp.appspot.com
您可以看到结果中的第一行是2017-06-29r3 myapp.appspot.com
,编辑app.yaml:
env_variables:
# The following values are to be replaced by information from the output of
# 'gcloud service-management deploy swagger.json' command.
ENDPOINTS_SERVICE_NAME: myapp.appspot.com
ENDPOINTS_SERVICE_VERSION: 2017-06-29r3
这对我有用
答案 2 :(得分:1)
如果使用404获取服务配置失败,则gcloud service-management deploy
步骤可能无法按预期工作。我会再次尝试这一步,确保一切都配置正确,并确保命令完成没有错误。
答案 3 :(得分:0)
您只需按照以下步骤操作:
运行以下命令显示服务配置ID:
gcloud endpoints configs list --service=echo-api.endpoints.[PROJECT-ID].cloud.goog
将[PROJECT-ID]替换为您的项目ID。不要包括方括号。
编辑python-docs-samples / appengine / standard / endpoints-frameworks-v2 / echo目录中的app.yaml文件,并在env_variables部分进行以下更改:
env_variables:
# Replace with your endpoints service name.
ENDPOINTS_SERVICE_NAME: "echo-api.endpoints.[PROJECT-ID].cloud.goog"
# Replace with the version Id of your uploaded Endpoints service.
ENDPOINTS_SERVICE_VERSION: "[YOUR-SERVICE-CONFIG-ID]"
将[PROJECT-ID]替换为您的项目ID,并使用您上一步中的服务配置ID替换[YOUR-SERVICE-CONFIG-ID]。不要包括方括号。例如:
env_variables:
# Replace with your endpoints service name.
ENDPOINTS_SERVICE_NAME: "echo-api.endpoints.example-project.cloud.goog"
# Replace with the version Id of your uploaded Endpoints service.
ENDPOINTS_SERVICE_VERSION: "2016-12-14r1"
您只需选择第一个命令中显示的选项之一。
答案 4 :(得分:0)
在使用Cloud Endpoint时,必须确保配置ID与app.yaml中的相同
gcloud endpoints configs list --service=myapp.appspot.com
结果:
CONFIG_ID SERVICE_NAME
2018-08-13r0 myapp.appspot.com
在app.yaml中
ENDPOINTS_SERVICE_VERSION: 2018-08-13r0