Cloud Endpoints를 사용하여 간단한 API를 만들었습니다. Cloud Endpoints는 Google Translate API를 사용하여 일부 번역을하고 Datastore에 캐시 한 다음 결과 목록을 Client에 반환합니다. 문제는 Google Translate API를 사용하여 전화를 걸 때마다 502 잘못된 게이트웨이 오류가 발생한다는 것입니다. 클라우드 콘솔에서 내 끝점을 디버깅했습니다. 응답이 성공적으로 만들어 졌으므로 결과를 클라이언트에 보낼 때 502를 throw해야합니다. 또 다른 이상한 점은 클라우드 콘솔의 모든 로깅 도구에서 502가 표시되지 않는다는 것입니다.Google App Engine + Cloud Endpoints + Google Translate API = 502 잘못된 게이트웨이
저는 유럽 서부에서 우리 중심부로 지역을 변경하려했지만 지금까지는 행운이 없었습니다. 누구에게 아이디어가 있습니까? 여기에 무엇이 잘못 되었을까요?
GAE의 내 cofnig :
runtime: java7
env: standard
threadsafe: true
instance_class: B2
inbound_services:
- warmup
handlers:
- url: '(/.*/)'
application_readable: false
static_files: "__static__\\1index.html"
require_matching_file: true
upload: __NOT_USED__
- url: (/)
application_readable: false
static_files: "__static__\\1index.html"
require_matching_file: true
upload: __NOT_USED__
- url: '(/.*)'
application_readable: false
static_files: "__static__\\1"
require_matching_file: true
upload: __NOT_USED__
- url:/
script: unused
- url: '/.*/'
script: unused
- url: '/_ah/.*'
script: unused
basic_scaling:
idle_timeout: 900s
max_instances: 2
GAE의 구성을 변경하고 다음과 같은 오류 번역 내가 구글에서 얻을 기본적인 스케일링을 제거 :
com.google.cloud.translate.TranslateException: com.google.apphosting.api.ApiProxy$CancelledException: The API call urlfetch.Fetch() was cancelled because the overall HTTP request deadline was reached.
at io.stringx.repository.DatastoreTranslationRepository.translate (DatastoreTranslationRepository.java:53)