6

最近、gcloud ライブラリを 118.0.0 から 132.0.0 に更新したところ、すぐに remote_api_shell が機能しなくなりました。gcloud を介してアプリケーションのデフォルトの資格情報を設定し、サービス アカウントと環境変数を使用するために、再ログインのいくつかの順列を実行しました。すべての順列が失敗し、同じエラー メッセージが表示されました。

    Traceback (most recent call last):
  File "/Users/mbostwick/google-cloud-sdk/bin/remote_api_shell.py", line 133, in <module>
    run_file(__file__, globals())
  File "/Users/mbostwick/google-cloud-sdk/bin/remote_api_shell.py", line 129, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 160, in <module>
    main(sys.argv)
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 156, in main
    oauth2=True)
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 74, in remote_api_shell
    secure=secure, app_id=appid)
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 769, in ConfigureRemoteApiForOAuth
    rpc_server_factory=rpc_server_factory)
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 839, in ConfigureRemoteApi
    app_id = GetRemoteAppIdFromServer(server, path, rtok)
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 569, in GetRemoteAppIdFromServer
    response = server.Send(path, payload=None, **urlargs)
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/tools/appengine_rpc_httplib2.py", line 259, in Send
    NeedAuth()
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/tools/appengine_rpc_httplib2.py", line 235, in NeedAuth
    RaiseHttpError(url, response_info, response, 'Too many auth attempts.')
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/tools/appengine_rpc_httplib2.py", line 85, in RaiseHttpError
    raise urllib2.HTTPError(url, response_info.status, msg, response_info, stream)
urllib2.HTTPError: HTTP Error 401: Unauthorized Too many auth attempts.

131.0.0 と 130.0.0 を元に戻した後、118.0.0 に戻り、再ログインしたところ、すべて正常に機能しました。

現時点ではリリース サイクルの途中であるため、gcloud の更新後に実行中のアプリケーションを更新しませんでした。それが問題だった可能性がありますが、何か助けていただければ幸いです。ありがとう!

4

1 に答える 1

12

TL;DR : これは gcloud バージョン 134 で修正されました

元の答え: 実行

gcloud auth application-default login --scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/userinfo.email

これで、リモート シェルが再び機能するはずです。

詳細: これは 128.0.0 の更新とコマンドの変更によって壊れたと思いますgcloud auth login。古いトークンには次のスコープがあります (Google の tokeninfo エンドポイントによる)。

https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/appengine.admin https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/plus.me

gcloud auth application-default loginオプションなしの新しいトークンには、次のものしかありません。

https://www.googleapis.com/auth/cloud-platform

これはに文書化されていますgcloud auth application-default login --help

バージョン 134の詳細: 要求されるスコープは次のとおりです。

https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/cloud-platform

https://groups.google.com/d/msg/google-appengine/ptc-76K6Kk4/9qr4601BBgAJでディスカッションを参照してください

于 2016-11-08T18:27:17.930 に答える