'Deployment on Appengine getting Error Response: [13] Unexpected Error
I am trying to deploy simple spring-boot maven application in App Engine. This is my pom.xml file :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0> https://maven.apache.org/xsd/maven-4.0.0.xsd">>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.3</version>
<relativePath />
</parent>
<groupId>com.Ankit</groupId>
<artifactId>Kubernetes</artifactId>
<version>0.0.1- SNAPSHOT</version>
<name>Kubernetes</name>
<description>Demo project for> Kubernetes</description>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-sql-mysql</artifactId>
<version>1.2.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.8.4</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.27</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>2.2.0</version>
<configuration>
<deploy.version>1</deploy.version>
<deploy.projectId>xenon-sentry-338907</deploy.projectId>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<finalName>kubernetes</finalName>
</build>
</project>
application.properties :
spring.jpa.show-sql:true
spring.jpa.hibernate.ddl-auto=create #server.port = 8080
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
instance connection name from the previous step
spring.cloud.gcp.sql.instance-connection-name=
xenon-sentry-338907:us-central1:testsql
spring.cloud.gcp.sql.database-name=mydb2
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.hikari.maximum-pool-size=10
spring.datasource.continue-on-error=true
spring.datasource.initialization-mode=always
spring.jpa.hibernate.use-new-id-generator-mappings=false
spring.cloud.gcp.project-id= xenon-sentry-338907 and
App.yaml file :
runtime: java
env: flex
runtime_config: jdk: openjdk8
env_variables: SPRING_PROFILES_ACTIVE: "gcp,mysql"
handlers:
- url:/.*
script: this field is required, but ignored
manual_scaling:
instances: 2
This is the error: Updating service [default] (this may take several minutes)failed. ERROR: Error Response: [13] An internal error occurred.
I can see the image in container registry but not any instance please help me . I am using java 8 and flex env and using gcloud app deploy command.enter image description here
I have attached Logfiles screenshot for your reference.
Solution 1:[1]
I recommend using the Maven Plugin to deploy:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>2.4.0</version>
</plugin>
And deploy with command:
mvn package appengine:deploy -Dapp.deploy.projectId=PROJECT_ID
If you are deploying a pre-built container, you can use the command:
gcloud app deploy src/main/appengine/app.yaml --image-url gcr.io/YOUR_PROJECT_ID/YOUR_CONTAINER_IMAGE
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Averi Kitsch |
