3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GAE/Java8試行(その6:「デプロイ失敗」)

Last updated at Posted at 2018-11-01

お題

久しぶりにGAEにデプロイしようとしたら失敗した。
原因は単純で、設定でGAEアプリを無効化していたからなんだけど、一応、備忘録として残しておく。
mvn appengine:deployで失敗する原因はいろいろ(自分が遭遇したのは今回のケースと中身が空のデプロイ用yamlを書いていた時くらいだけど)でエラーメッセージからは原因がわかりづらいものもあるので、特にハマって解決に時間かけたものは残しておいた方がいいかな。
今回のケースはエラーメッセージ見てすぐにピンとくるレベルだったからよかったけど。。。

GAE試行Index

開発環境

# 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

[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アプリ有効化

たしかに無効化されていたので「設定で有効化」を試みる。

screenshot-console.cloud.google.com-2018-11-01-09-18-08-530.png
screenshot-console.cloud.google.com-2018-11-01-09-21-52-059.png
screenshot-console.cloud.google.com-2018-11-01-09-22-44-523.png

はい、復活。

screenshot-console.cloud.google.com-2018-11-01-09-23-48-078.png

再デプロイ

再度、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アプリ上でもサービスにトラフィック振り分けられる設定になっていることを確認。

screenshot-console.cloud.google.com-2018-11-01-09-28-34-840.png

3
2
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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?