1

我已經使用雲端點創建了一個簡單的API,它使用Google Translate API進行了一些翻譯,將它們緩存在數據存儲中,並將結果列表返回給客戶端。 問題是,我每次打電話時,都會使用Google Translate API,我收到502錯誤的網關錯誤。 我一直在從雲端控制檯調試我的端點,並且響應已成功創建,所以在將結果發送回客戶端時必須引發502。另一個奇怪的問題是,我沒有在雲控制檯的任何日誌工具上看到502。Google App Engine + Cloud Endpoints + Google Translate API = 502 Bad Gateway

我試圖改變從歐洲西部到美國中部地區,但目前還沒有運氣。 有沒有人有任何想法,這裏可能是錯誤的?

我的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) 

回答

相關問題