0

Trying to deploy a Java app to Google Appengine Managed VM. I'm using console gcloud and already prepared WAR file. Plus app.yaml.

Using following command:

gcloud preview app deploy ./build/libs/app.yaml

Right now it fails with:

Building and pushing image for module [default]
-------------------------------------------------------------------------------- DOCKER BUILD OUTPUT --------------------------------------------------------------------------------
Step 0 : FROM gcr.io/google_appengine/jetty9
---> 005014071b64
Step 1 : ADD webapp-webapp.war $JETTY_BASE/webapps/root.war
---> 3e9023930cc8
Removing intermediate container 342e8a2f5750
Successfully built 3e9023930cc8
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Beginning teardown of remote build environment (this may take a few seconds).
Updating module [default]...failed.
ERROR: (gcloud.preview.app.deploy) Error Response: [400] "env" setting is not supported for this deployment.

I see similar error (there) for maven-gcloud-plugin that happens when project is not configured as WAR. But notice that:

  • i'm using plain command line tool gcloud, a latest version
  • and my project is packaged into WAR already

Also i'm using following app.yaml (which i've got from maven plugin sources):

runtime: java
env: 2
api_version: 1
handlers:
  - url: .*
    script: dynamic

So the question, where from this error is coming from (docker image is already prepared at this moment, right?). What it means? And how to fix this?

Update I noticed that it uses FROM gcr.io/google_appengine/jetty9 for VM. But for Appengine it should be FROM gcr.io/google_appengine/jetty9-compat. I've tried to switch to exploded app instead of WAR, and it started using correct Docker base image. But still fails:

Building and pushing image for module [default]
-------------------------------------------------------------------------------- DOCKER BUILD OUTPUT --------------------------------------------------------------------------------
Step 0 : FROM gcr.io/google_appengine/jetty9-compat
---> 2ad8572ef3d8
Step 1 : ADD . /app/
---> b10f4bc6718e
Removing intermediate container 8b149f4baf9c
Successfully built b10f4bc6718e
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Beginning teardown of remote build environment (this may take a few seconds).
Updating module [default]...failed.
ERROR: (gcloud.preview.app.deploy) Error Response: [400] "env" setting is not supported for this deployment.
Community
  • 1
  • 1
Igor Artamonov
  • 35,450
  • 10
  • 82
  • 113

1 Answers1

0

The reason was this line in app.yaml:

env: 2

it was too simple and too obvious to try to deploy w/o this option. Also, every doc, official and unofficial, mentions that you need to have env: 2 option set to deploy your app as Appengine app. That's really strange.

Removing this line also changed base Docker image to gcr.io/google_appengine/java-compat. I guess it means that jetty images, including jetty9-compat, aren't compatible with Appengine apps

Igor Artamonov
  • 35,450
  • 10
  • 82
  • 113