maven 应用程序引擎“非零退出:应用程序部署时出现“1”错误

vwkv1x7d  于 2023-04-05  发布在  Maven
关注(0)|答案(1)|浏览(192)

我试图在Google应用程序引擎上部署新版本的应用程序,但我收到此错误:

com.google.cloud.tools.appengine.operations.cloudsdk.process.ProcessHandlerException: com.google.cloud.tools.appengine.AppEngineException: Non zero exit: 1

我正在从git中克隆repo,并尝试使用以下命令部署应用程序:“gcloud app deploy”在文件app.yaml的位置(应该正确配置)。
我也尝试通过命令部署aplicatony B mvn:
“mvn package appengine:deploy -Dapp.deploy.projectId=projektID”

但它会给予我同样的错误。
它已经是一个现有的应用程序,所以我不需要创建一个新的应用程序,或者我应该吗?你能帮助我,或者至少给予我一些建议吗?

全栈跟踪:

[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:2.2.0:deploy (default-cli) on project demo: App Engine application deployment failed: com.google.cloud.tools.appengine.operations.cloudsdk.process.ProcessHandlerException: com.google.cloud.tools.appengine.AppEngineException: Non zero exit: 1
        -> [Help 1]
            org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:2.2.0:deploy (default-cli) on project demo: App Engine application deployment failed
                at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
                at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
                at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
                at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
                at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
                at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
                at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
                at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
                at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
                at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
                at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
                at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
                at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
                at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
                at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
                at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke (Method.java:566)
                at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
                at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
                at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
                at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
            Caused by: org.apache.maven.plugin.MojoExecutionException: App Engine application deployment failed
                at com.google.cloud.tools.maven.deploy.AppDeployer.deploy (AppDeployer.java:59)
        at com.google.cloud.tools.maven.deploy.DeployMojo.execute (DeployMojo.java:35)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:566)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    Caused by: com.google.cloud.tools.appengine.AppEngineException: com.google.cloud.tools.appengine.operations.cloudsdk.process.ProcessHandlerException: com.google.cloud.tools.appengine.AppEngineException: Non zero exit: 1
        at com.google.cloud.tools.appengine.operations.Deployment.deploy (Deployment.java:98)
        at com.google.cloud.tools.maven.deploy.AppDeployer.deploy (AppDeployer.java:57)
        at com.google.cloud.tools.maven.deploy.DeployMojo.execute (DeployMojo.java:35)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:566)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    Caused by: com.google.cloud.tools.appengine.operations.cloudsdk.process.ProcessHandlerException: com.google.cloud.tools.appengine.AppEngineException: Non zero exit: 1
        at com.google.cloud.tools.appengine.operations.cloudsdk.process.LegacyProcessHandler.handleProcess (LegacyProcessHandler.java:87)
        at com.google.cloud.tools.appengine.operations.GcloudRunner.run (GcloudRunner.java:110)
        at com.google.cloud.tools.appengine.operations.Deployment.deploy (Deployment.java:96)at com.google.cloud.tools.maven.deploy.AppDeployer.deploy (AppDeployer.java:57)
    at com.google.cloud.tools.maven.deploy.DeployMojo.execute (DeployMojo.java:35)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: com.google.cloud.tools.appengine.AppEngineException: Non zero exit: 1
    at com.google.cloud.tools.appengine.operations.cloudsdk.process.NonZeroExceptionExitListener.onExit (NonZeroExceptionExitListener.java:28)
    at com.google.cloud.tools.appengine.operations.cloudsdk.process.LegacyProcessHandler.syncRun (LegacyProcessHandler.java:144)
    at com.google.cloud.tools.appengine.operations.cloudsdk.process.LegacyProcessHandler.handleProcess (LegacyProcessHandler.java:83)
    at com.google.cloud.tools.appengine.operations.GcloudRunner.run (GcloudRunner.java:110)
    at com.google.cloud.tools.appengine.operations.Deployment.deploy (Deployment.java:96)
    at com.google.cloud.tools.maven.deploy.AppDeployer.deploy (AppDeployer.java:57)
    at com.google.cloud.tools.maven.deploy.DeployMojo.execute (DeployMojo.java:35)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
gkn4icbw

gkn4icbw1#

要了解更多关于错误发生的原因,请运行mvn appengine:deploy -e -X(-X记录调试信息,-e记录堆栈跟踪)。
在我的案例中,我遇到了多个问题。第一个很容易弄清楚:

[INFO] GCLOUD: ERROR: (gcloud.app.deploy) You do not currently have an active account selected.
[INFO] GCLOUD: Please run:
[INFO] GCLOUD:
[INFO] GCLOUD:   $ gcloud auth login
[INFO] GCLOUD:
[INFO] GCLOUD: to obtain new credentials.

在下一次运行中,我得到了:

[INFO] GCLOUD: ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build ... status: FAILURE
[INFO] GCLOUD: did not find any jar files with a Main-Class manifest entry
[INFO] GCLOUD: Full build logs: https://console.cloud.google.com/cloud-build/builds;region=europe-west1/...?project=...

检查构建日志:

Step #2 - "build": Failure: (ID: 838926df) did not find any jar files with a Main-Class manifest entry
Step #2 - "build": --------------------------------------------------------------------------------
Step #2 - "build": Running "mv -f /builder/outputs/output-6393296178649966364 /builder/outputs/output"
Step #2 - "build": Done "mv -f /builder/outputs/output-6393296178649966364 /builder/o..." (46.762072ms)
Step #2 - "build": ERROR: failed to build: exit status 1
Finished Step #2 - "build"
ERROR
ERROR: build step 2 "eu.gcr.io/gae-runtimes/buildpacks/google-gae-18/java/builder:java_20230320_RC00" failed: step exited with non-zero status: 51

导致Failure: (ID: 838926df) did not find any jar files with a Main-Class manifest entry
我的意思是为了进行故障排除,在deploy命令中添加-X,这通常会给予您一些额外的线索,告诉您到底是哪里出了问题。

相关问题