由于以下原因而无法部署到Google App Engine:默认服务(模块)可能无法删除,并且必须包含至少一个版本

时间:2019-10-05 15:08:13

标签: java maven google-app-engine

尝试将我的应用程序部署到应用程序引擎时,出现此错误:

[INFO] GCLOUD: ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: In place deployments of App Engine Flexible Environment over an existing version are not supported. Please use a different version name, or delete the existing version first.

我正在通过以下方式部署应用程序:

 mvn clean package appengine:deploy -P cloud-gcp

只有一个版本:

> gcloud app versions list
SERVICE  VERSION  TRAFFIC_SPLIT  LAST_DEPLOYED              SERVING_STATUS
default  1        1.00           2019-10-05T10:22:54+01:00  SERVING

所以,我无法将其删除:

> gcloud app versions delete 1
ERROR: (gcloud.app.versions.delete) The default service (module) may not be deleted, and must comprise at least one version.

要部署此应用程序,我缺少什么?

我最初是按照本教程配置应用程序的:https://cloud.google.com/appengine/docs/standard/java11/quickstart(我想我不确定)

但是后来我切换到了该数据库,因为它包含我的应用程序需要的数据库配置:https://www.baeldung.com/spring-boot-google-app-engine

我复制的配置为:

        <plugin>
            <groupId>com.google.cloud.tools</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <version>2.1.0</version>
            <configuration>
                <version>1</version>
                <projectId>GCLOUD_CONFIG</projectId>
            </configuration>
        </plugin>

并将该版本更改为2,将错误消息更改为:

[INFO] GCLOUD: ERROR: (gcloud.app.deploy) Error Response: [4] Your deployment has failed to become healthy in the allotted time and therefore was rolled back. If you believe this was an error, try adjusting the 'app_start_timeout_sec' setting in the 'readiness_check' section.

我的问题仍然是,部署应用程序而不必每次都提交新的pom.xml文件并在达到120个已部署版本时必须手动删除版本的理智方式是什么?

1 个答案:

答案 0 :(得分:0)

显然,解决方案是像这样配置它:

        <plugin>
            <groupId>com.google.cloud.tools</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <version>2.1.0</version>
            <configuration>
                <version>recruiter-wtf</version>
                <projectId>GCLOUD_CONFIG</projectId>
            </configuration>
        </plugin>

但是我不确定100%是否正确,因为app is not correctly starting yet