2017-10-13 6 views
0

탐색기 '_ah/api/explorer'를 통해 API에 액세스하는 중 오류가 발생하거나 앱에서 API가 호출되면 오류가 발생합니다.클라우드 프레임 워크 끝점 api를 호출하는 중 오류가 발생했습니다.

다음은 app.yaml 및 api 구현의 관련 조각입니다.

stackoverflow에 대한 다른 질문으로 인해 gatewayv1openapi.json을 업로드 한 후 엔드 포인트 구성이 배포되지 않았지만 gatewayv1openapi.json 업로드 후 이벤트가 발생하는 경우에도 비슷한 오류가 발생합니다.

내가 api 코드 또는 app.yaml에서 변경할 필요가있는 것이 있습니까? 한가지 더 중요한 것은 동일한 코드베이스 (app.yaml의 ixp-test 대신 다른 프로젝트 ID 만 사용)를 다른 이전 프로젝트에 업로드 했으므로 제대로 작동한다는 것입니다. 새로 생성 된 프로젝트에서이 오류가 발생합니다./V1/호출? ALT = JSON

없이 스케줄러 스레드, scheduler.run() 보고서 (...)에 의해 호출됩니다 (/ 기본/데이터/홈

/_ah/API/게이트웨이 /apps/s~ixp-test/20171013t215957.404774686885375478/server/lib/endpoints_management/control/client.py:235) 추적 (최근 호출 마지막) : 파일 "/ base/data/home/apps/s ~self._thread.start() 파일 "/ base/data/home/runtimes/python27_experiment/python27_lib/server/lib/endpoints_management/control/client.py", 줄 231 시작시 ixp-test/20171013t215957.404774686885375478/버전/1/google/appengine/api/background_thread/background_thread.py ", lin e 108, 시작시 start_new_background_thread (self. 스트랩()) start_new_background_thread 인상 ERROR_MAPerror.application_error 에 파일 "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/api/background_thread/background_thread.py"라인 (87), FrontendsNotSupported . . . (/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/runtime/wsgi.py:263) 추적 (가장 최근 통화 마지막) : 파일 "/ base/data/home/런타임에/python27_experiment/python27_lib/버전/1/google/appengine/runtime/wsgi.py ", 줄 240, 핸들 처리기 = _config_handle.add_wsgi_middleware (self._LoadHandler()) 파일"/ base/data/home/runtimes /python27_experiment/python27_lib/versions/1/google/appengine/runtime/wsgi.py ", 줄 299, _LoadHandler 핸들러, 경로, 오류 = LoadObject (self._handler) 파일"/ base/data/home/runtimes/python27_experiment/python27_lib/버전/1/google/appengine/runtime/wsgi.py ", 줄 96, LoadObject에 __import (누적 경로) 파일 "/base/data/home/apps/s~ixp-test/20171013t215957.404774686885375478/server/main.py", 줄 18, api = endpoints.api_server ([GatewayApi]) 파일 "/ base/data /home/apps/s~ixp-test/20171013t215957.404774686885375478/server/lib/endpoints/apiserving.py "514 행의 api_server 컨트롤러 파일"/ base/data/home/apps/s ~ ixp- test/20171013t215957.404774686885375478/server/lib/endpoints_management/control/wsgi.py ", 줄 126, add_all a_service = loader.load() 파일"/ base/data/home/apps/s ~ ixp-test/로드 11135,로드반환합니다. self._load_func (** kw) 파일 "/ base/data/home/apps/s ~ ixp-test/20171013t215957.404774686885375478/server/lib/endpoints_management/control/service.py" 20171013t215957.404774686885375478/server/lib/endpoints_management/con fetch_service_config_log_and_raise (Exception, message_template.format (status_code)) 파일 "/ base/data/home/apps/s ~ ixp-test/20171013t215957에서 그림/service_config.py"줄 79404774686885375478/서버/lib 디렉토리/endpoints_management/설정 _log_and_raise 인상 exception_class에서/service_config.py ", 라인 127 (메시지) 예외 : 가져 오기 서비스 설정 실패 (상태 코드 403) 아래

가 관련 설정

입니다

애플리케이션 제목을

runtime: python27 
api_version: 1 
threadsafe: false 
automatic_scaling: 
    max_idle_instances: 0 


env_variables: 
    ENDPOINTS_SERVICE_NAME: ixp-test.appspot.com 
    ENDPOINTS_SERVICE_VERSION: 2017-08-13r0 

API

@endpoints.api(name='gateway', version='v1') 
class GatewayApi(remote.Service): 
    @endpoints.method(
     GatewayRequest, 
     GatewayResponse, 
     path='invoke', 
     http_method='POST', 
     name='invoke') 
    def invoke(self, request): 
     pass 
    @endpoints.method(
     GatewayRequest, 
     GatewayResponse, 
     path='invokeSecure', 
     http_method='POST', 
     name='invokeSecure', 
     scopes=[endpoints.EMAIL_SCOPE]) 
    def invoke_secure(self, request): 
     pass 

답변

1

gatewayv1openapi.json의 서비스 이름이 app.yaml의 서비스 이름과 일치하지 않는 경우에 발생할 수 있습니다. 그걸 다시 확인해 줄 수 있니?

+0

에서

예 그들은 경기를 할. – rizTaak

0

해결 방법 : 문제가 업데이트되지 않아서 발생했습니다.

ENDPOINTS_SERVICE_VERSION: 2017-08-13r0 

작동중인 이전 배포 프로젝트의 값으로 인해 오류가 발생했습니다. getting started tutorial

gcloud service-management deploy echov1openapi.json 
Service Configuration [2017-02-13-r2] uploaded for service [example-project.appspot.com]