2015-10-23 18 views
0

這已工作多年。今天不工作。無法通過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步驟崩潰。

謝謝。

回答

1

似乎是GoogleAppEngineLauncher-1.9.27中的一個錯誤,它不允許登錄提示。當恢復到1.9.26時,它工作。有趣的是,我的gcloud部件仍然有27年1月9日版本:

>$ gcloud version 

Google Cloud SDK 0.9.83 

alpha 2015.10.08 
app 2015.10.16 
app-engine-python 1.9.27 
beta 2015.10.08 
core 2015.10.16 
core-nix 2015.09.03 
gcloud 2015.10.16 

臨時的解決辦法:去https://console.developers.google.com/storage/browser/appengine-sdks/featured/獲得版本26年1月9日

提交錯誤報告:https://code.google.com/p/google-cloud-sdk/issues/detail?id=340

相關問題