GAE/Java8試行(その6:「デプロイ失敗」)
お題
久しぶりにGAEにデプロイしようとしたら失敗した。
原因は単純で、設定でGAEアプリを無効化していたからなんだけど、一応、備忘録として残しておく。
mvn appengine:deploy
で失敗する原因はいろいろ(自分が遭遇したのは今回のケースと中身が空のデプロイ用yamlを書いていた時くらいだけど)でエラーメッセージからは原因がわかりづらいものもあるので、特にハマって解決に時間かけたものは残しておいた方がいいかな。
今回のケースはエラーメッセージ見てすぐにピンとくるレベルだったからよかったけど。。。
GAE試行Index
- GAE/Java8試行(その0:「App Engineについて」)
- GAE/Java8試行(その1:「Java8でWebアプリ作ってデプロイ」)
- GAE/Java8試行(その2:「Javaアプリ解説」)
- GAE/Java8試行(その3:「Javaアプリテストコード解説」)
- GAE/Java8試行(その4:「Datastoreへのアクセスロジック」)
- GAE/Java8試行(その5:「ローカル開発用コンソール」)
開発環境
# OS
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="17.10 (Artful Aardvark)"
# Java
$ java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
# IDE
# OS
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="17.10 (Artful Aardvark)"
# Java
$ java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
# IDE
みんな大好きIntelliJ IDEA
本題
デプロイ失敗
$ mvn appengine:deploy
[INFO] Scanning for projects...
[WARNING] The project com.example.sky0621:sky0621:war:1.0-SNAPSHOT uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sky0621 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> appengine-maven-plugin:1.3.2:deploy (default-cli) > package @ sky0621 >>>
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) @ sky0621 ---
[INFO]
・
・
・
[INFO] GCLOUD: Temporary staging for module default directory left in /work/src/java/github.com/sky0621/java-webapi-for-gae-study/sky0621/target/appengine-staging
11 01, 2018 9:07:38 午前 com.google.cloud.tools.appengine.cloudsdk.CloudSdk logCommand
情報: submitting command: /home/koge/download/google-cloud-sdk/bin/gcloud app deploy
[INFO] GCLOUD: ERROR: (gcloud.app.deploy) Unable to deploy to application [【デプロイ先プロジェクトID】] with status [USER_DISABLED]: Deploying to stopped apps is not allowed.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.753 s
[INFO] Finished at: 2018-11-01T09:07:41+09:00
[INFO] Final Memory: 22M/261M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:1.3.2:deploy (default-cli) on project sky0621: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:1.3.2:deploy failed: Non zero exit: 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
$ mvn appengine:deploy
[INFO] Scanning for projects...
[WARNING] The project com.example.sky0621:sky0621:war:1.0-SNAPSHOT uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sky0621 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> appengine-maven-plugin:1.3.2:deploy (default-cli) > package @ sky0621 >>>
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) @ sky0621 ---
[INFO]
・
・
・
[INFO] GCLOUD: Temporary staging for module default directory left in /work/src/java/github.com/sky0621/java-webapi-for-gae-study/sky0621/target/appengine-staging
11 01, 2018 9:07:38 午前 com.google.cloud.tools.appengine.cloudsdk.CloudSdk logCommand
情報: submitting command: /home/koge/download/google-cloud-sdk/bin/gcloud app deploy
[INFO] GCLOUD: ERROR: (gcloud.app.deploy) Unable to deploy to application [【デプロイ先プロジェクトID】] with status [USER_DISABLED]: Deploying to stopped apps is not allowed.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.753 s
[INFO] Finished at: 2018-11-01T09:07:41+09:00
[INFO] Final Memory: 22M/261M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:1.3.2:deploy (default-cli) on project sky0621: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:1.3.2:deploy failed: Non zero exit: 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[INFO] GCLOUD: ERROR: (gcloud.app.deploy) Unable to deploy to application [【デプロイ先プロジェクトID】] with status [USER_DISABLED]: Deploying to stopped apps is not allowed.
ということで、(自分の)設定でGAEにデプロイできない状態になっているとのこと。
GAEアプリ有効化
たしかに無効化されていたので「設定で有効化」を試みる。
はい、復活。
再デプロイ
再度、mvn appengine:deploy
を流すと、↓の通りデプロイ成功。
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.471 s
[INFO] Finished at: 2018-11-01T09:24:51+09:00
[INFO] Final Memory: 22M/261M
[INFO] ------------------------------------------------------------------------
GAEアプリ上でもサービスにトラフィック振り分けられる設定になっていることを確認。
Author And Source
この問題について(GAE/Java8試行(その6:「デプロイ失敗」)), 我々は、より多くの情報をここで見つけました https://qiita.com/sky0621/items/d89c7473fd5207edcfd5著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .