LoginSignup
5
5

More than 5 years have passed since last update.

Google App Engine にて goapp によるデプロイに失敗する場合の対策

Last updated at Posted at 2014-11-25

例えば GAE に go アプリケーションをデプロイするチュートリアルをやっている途中などに
https://cloud.google.com/appengine/docs/go/gettingstarted/uploading

デプロイの際、認証に失敗してしまいます。

2段階認証あり

google アカウントを2段階認証に設定している場合とそうでない場合で、エラーメッセージが変わります。

Use an application-specific password instead of your regular account password.
See ...
However, now the recommended way to log in is using OAuth2. See
...

対策(OAuth)

参考:
https://cloud.google.com/appengine/docs/go/tools/uploadinganapp#Go_Password-less_login_with_OAuth2

goapp deploy --oauth

にてブラウザが起動し、2段階認証のフローが終了すればデプロイされます。

対策(アプリパスワード)

短時間有効なパスワードを生成して、それでログインします。

参考:
http://www.google.com/support/accounts/bin/answer.py?answer=185833

ここから新しいパスワードを作成します。
https://security.google.com/settings/security/apppasswords
名前は何でも良い、、んじゃないですかね。

パスワードが生成されましたのでメモして、

goapp deploy

でメールアドレスはいつもの、パスワードはgmailなどのログインに使う物では無く、生成された方を使います。

2段階認証なし

% goapp deploy .
Email: 
Password for hoge@gmail.com:
Invalid username or password.

ユーザ名が違うよという警告と、gmail 宛に、「ログイン試行をブロックしました」みたいなメールが届くかと思います。

対策(セキュリティを下げる)

安全性の低いアプリのアクセス
https://www.google.com/settings/security/lesssecureapps

を有効にすることで、gmailなどのログインに使うパスワードでログインできます。

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5