在Google App Engine上使用download_data时无法进行身份验证

时间:2016-12-06 17:15:37

标签: google-app-engine google-cloud-datastore app-engine-ndb google-app-engine-python

尝试使用appcfg.py download_data下载我的所有应用数据,如下所示:

(venv)awp$ ../google_appengine/appcfg.py download_data --application=s~app-name --url=http://app-name.appspot.com/_ah/remote_api --filename=dev-datastore/data.csv 

我已经加入了app.yaml:

builtins:
- remote_api: on

还尝试使用服务帐户凭据,但得到了相同的例外,我已经检查了我的电子邮件和密码是否正确以及应用程序名称。我已经在云仪表板上的IAM窗格中授予了自己所有可能的权限,但仍然没有爱...

(venv)awp$ GOOGLE_APPLICATION_CREDENTIALS=../app-name-51362728f4a9.json ../google_appengine/appcfg.py download_data --authenticate_service_account --application=s~app-name --url=http://app-name.appspot.com/_ah/remote_api --filename=dev-datastore/data.csv --noisy
04:46 PM Downloading data records.
[INFO    ] Logging to bulkloader-log-20161206.164650
[INFO    ] Throttling transfers:
[INFO    ] Bandwidth: 250000 bytes/second
[INFO    ] HTTP connections: 8/second
[INFO    ] Entities inserted/fetched/modified: 20/second
[INFO    ] Batch Size: 10
[INFO    ] Opening database: bulkloader-progress-20161206.164650.sql3
[INFO    ] Opening database: bulkloader-results-20161206.164650.sql3
[DEBUG   ] [WorkerThread-0] WorkerThread: started
[DEBUG   ] [WorkerThread-1] WorkerThread: started
[DEBUG   ] [WorkerThread-2] WorkerThread: started
[DEBUG   ] [WorkerThread-3] WorkerThread: started
[DEBUG   ] [WorkerThread-4] WorkerThread: started
[DEBUG   ] [WorkerThread-5] WorkerThread: started
[DEBUG   ] [WorkerThread-6] WorkerThread: started
[DEBUG   ] [WorkerThread-7] WorkerThread: started
[DEBUG   ] [WorkerThread-8] WorkerThread: started
[DEBUG   ] [WorkerThread-9] WorkerThread: started
[DEBUG   ] Configuring remote_api. url_path = /_ah/remote_api, servername = app-name.appspot.com
[DEBUG   ] Bulkloader using app_id: s~app-name
[INFO    ] Connecting to app-name.appspot.com/_ah/remote_api
Please enter login credentials for app-name.appspot.com
Email: anthony@app-name.com
Password for anthony@app-name.com: 
[ERROR   ] Exception during authentication
Traceback (most recent call last):
  File "/Users/Ant/Documents/google_appengine/google/appengine/tools/bulkloader.py", line 3466, in Run
    self.request_manager.Authenticate()
  File "/Users/Ant/Documents/google_appengine/google/appengine/tools/bulkloader.py", line 1329, in Authenticate
    remote_api_stub.MaybeInvokeAuthentication()
  File "/Users/Ant/Documents/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 889, in MaybeInvokeAuthentication
    datastore_stub._server.Send(datastore_stub._path, payload=None)
  File "/Users/Ant/Documents/google_appengine/google/appengine/tools/appengine_rpc.py", line 441, in Send
    self._Authenticate()
  File "/Users/Ant/Documents/google_appengine/google/appengine/tools/appengine_rpc.py", line 582, in _Authenticate
    super(HttpRpcServer, self)._Authenticate()
  File "/Users/Ant/Documents/google_appengine/google/appengine/tools/appengine_rpc.py", line 313, in _Authenticate
    auth_token = self._GetAuthToken(credentials[0], credentials[1])
  File "/Users/Ant/Documents/google_appengine/google/appengine/tools/appengine_rpc.py", line 252, in _GetAuthToken
    response = self.opener.open(req)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found
[ERROR   ] Authentication Failed: Incorrect credentials or unsupported authentication type (e.g. OpenId).

任何帮助将不胜感激!谢谢

1 个答案:

答案 0 :(得分:1)

尝试将凭据导出到凭证文件。

export GOOGLE_APPLICATION_CREDENTIALS=./app-name-51362728f4a9.json