2

I am trying to change runtime of my application to enable log level filtering in Stackdriver( see: How do I map my java app logging events to corresponding cloud logging event levels in GCP Felexible non-compat App Engine?)

In app.yaml, when I change runtime to java-compat, I receive following error:

[INFO] GCLOUD: Building and pushing image for service [default]
[INFO] GCLOUD: ERROR: (gcloud.app.deploy) Your application does not satisfy all of the requirements for a runtime of type [java-compat].  Please correct the errors and try again.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.321 s
[INFO] Finished at: 2017-06-01T11:20:27+03:00
[INFO] Final Memory: 27M/407M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy (default-cli) on project bookshelf-5: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy failed: Non zero exit: 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy (default-cli) on project bookshelf-5: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy failed: Non zero exit: 1
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy failed: Non zero exit: 1
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more
Caused by: com.google.cloud.tools.appengine.api.AppEngineException: Non zero exit: 1
        at com.google.cloud.tools.appengine.cloudsdk.process.NonZeroExceptionExitListener.onExit(NonZeroExceptionExitListener.java:30)
        at com.google.cloud.tools.appengine.cloudsdk.internal.process.DefaultProcessRunner.syncRun(DefaultProcessRunner.java:211)
        at com.google.cloud.tools.appengine.cloudsdk.internal.process.DefaultProcessRunner.run(DefaultProcessRunner.java:137)
        at com.google.cloud.tools.appengine.cloudsdk.CloudSdk.runGcloudCommand(CloudSdk.java:193)
        at com.google.cloud.tools.appengine.cloudsdk.CloudSdk.runAppCommandInWorkingDirectory(CloudSdk.java:136)
        at com.google.cloud.tools.appengine.cloudsdk.CloudSdkAppEngineDeployment.deploy(CloudSdkAppEngineDeployment.java:90)
        at com.google.cloud.tools.maven.DeployMojo.execute(DeployMojo.java:107)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
        ... 20 more

Following is my app.yaml file:

# [START runtime]
runtime: java-compat
env:    flex

handlers:
- url: /.*
  script: this field is required, but ignored

# [START env_variables]
env_variables:    # Logging options
  JAVA_OPTS: >-
    -D.level=INFO
# [END env_variables]
# [END runtime]

runtime_config:   # Optional
  jdk: openjdk8
  server: jetty9

The error log does not indicate what exactly is missing.

How should I update the application so that it is compatible with java-compat runtime.

Halil
  • 1,795
  • 1
  • 24
  • 39
  • Hi, I am working on figuring this one out today... as I am having the same exact problem. Just to confirm, you were not able to figure this out yet, correct? – Jason Washo Jun 14 '17 at 13:48
  • One other note from the Google documentation: The Java 7 / Jetty 9 compat runtime (java-compat) and the Java 8 / Jetty 9 compat runtime (jetty9-compat) runtimes were deprecated on November 15th, 2016, and are not supported in the flexible environment. – Jason Washo Jun 14 '17 at 17:22
  • I couldn't figure this out. Actually my primary problem is stackdriver cannot filter logs based on log level. – Halil Jun 14 '17 at 21:12
  • 1
    Do you have other Maven plugins defined in the pom? Try removing them, and rely fully on the appengine-maven-plugin. We were able to get through this error by doing that. – Jason Washo Jun 15 '17 at 00:03

2 Answers2

0

I had same error message. In my case, I found my Application was disabled in App Engine Config menu. I was able to fix the problem by just clicking enable button.

koyo
  • 1
0

The "java-compat" runtime for App Engine Flexible has been deprecated and may no longer be used.

If you are trying to migrate from the Standard environment to the Flexible environment you can read about the difference in available services here.

To make your app.yaml compatible with the Flexible environment, be sure to use the configuration outlined in Configuring your App with app.yaml.

Yannick MG
  • 786
  • 9
  • 19