Google AppEngine application endpoints error: service configuration settings failed (status code 404)

I follow the steps in Quickstart .

I noticed one more question . I double-checked that the env_variables section in app.yaml has the correct values ​​for ENDPOINTS_SERVICE_NAME and ENDPOINTS_SERVICE_VERSION .

../_ ah / api / explorer does not show the endpoint in the Services section.

What is this error and how to fix it?

The error log shows:

  (/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) 
+5
source share
4 answers

I had the same Exception trace, except mine was 403. Hope is useful to others who have had the same disappointment.

Exception: Fetching service config failed (status code 403)

I finally found that in my app.yaml it was from a git clone

ENDPOINTS_SERVICE_NAME: echo-api.endpoints.[YOUR-PROJECT-ID].cloud.goog

And Quickstart just directed me to replace YOUR-PROJECT-ID.

I also had to replace .cloud.goog with .appspot.com

+4
source

If the service configuration selection failed using 404, the gcloud service-management deploy step probably did not work as gcloud service-management deploy . I would try this step again, making sure everything is configured correctly, and make sure that the command ends without errors.

+1
source

I have a call to myapp application

First show services:

 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 

You can see that the first line as a result of 2017-06-29r3 myapp.appspot.com , edit 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 

It works for me

+1
source

You just need to follow these steps:

  • Display the service configuration identifier by running the following command:

     gcloud service-management configs list --service=echo-api.endpoints.[PROJECT-ID].cloud.goog 
  • Replace [PROJECT-ID] with your project ID. Do not include square brackets.

  • Edit the app.yaml file in the python-docs-samples / appengine / standard / endpoints-frameworks-v2 / echo directory and make the following changes to the env_vablesables section:

     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]" 
  • Replace [PROJECT-ID] with the project identifier and [YOUR-SERVICE-CONFIG-ID] with the service configuration identifier in the previous step. Do not include square brackets. For instance:

     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" 

You just need to choose one of the options shown in the first command.

0
source

Source: https://habr.com/ru/post/1264371/


All Articles