這已工作多年。今天不工作。無法通過appcfg.py下載數據。 「應用程序默認憑據不可用」錯誤
正在運行appcfg.py download_data --flags...
,並且無法正確授權。
冉gcloud auth login
和回來:
Saved Application Default Credentials.
You are now logged in as [[email protected]].
Your current project is [correct].
但是當我運行appcfg.py download_data ...
我得到這個錯誤:
raise ApplicationDefaultCredentialsError(ADC_HELP_MSG)
oauth2client.client.ApplicationDefaultCredentialsError: The
Application Default Credentials are not available. They are available if
running in Google Compute Engine. Otherwise, the environment variable
GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file
defining the credentials. See
https://developers.google.com/accounts/docs/application-default
credentials for more information.
我更新了谷歌雲SDK,現在得到不同錯誤:
client.py:539 Attempting refresh to obtain initial access_token
client.py:797 Refreshing access_token
Error 302: --- begin server output ---
--- end server output ---
我還設置憑據在終端:
set GOOGLE_APPLICATION_CREDENTIALS "https://www.myurl/credentials.json"
set CLOUDSDK_PYTHON_SITEPACKAGES 1
gcloud config set project "correct_project_name"
我自己也嘗試設置env_variable國旗在命令下,appcfg:
--env_variable=GOOGLE_APPLICATION_CREDENTIALS:"https://www.myurl/credentials.json"
似乎是一個GAE錯誤。從app.yaml的remote_api處理程序中刪除login:admin會將其修復到生產環境中,但不能修復本地開發服務器。 302告訴我該應用試圖重定向,可能是Google登錄頁面。從未看到提示要求輸入電子郵件和密碼。
handlers:
- url: /remote_api
script: google.appengine.ext.remote_api.handler.application
#login: admin <-- removing admin fixes it in production
secure: always
在開發服務器,刪除管理員登錄的產量如下:
client.py:797 Refreshing access_token
Error 401: --- begin server output ---
You must be logged in as an administrator to access this.
--- end server output ---
的確在--oauth2工作流程谷歌改變些什麼呢?我似乎被授權,但下載在auth步驟崩潰。
謝謝。