springboot应用程序试图连接部署在gcp appengine上的google云存储时崩溃[在本地计算机上运行良好]

oxalkeyp  于 2021-07-23  发布在  Java
关注(0)|答案(0)|浏览(219)

springboot应用程序试图连接部署在gcp appengine上的google云存储时崩溃[在本地计算机上运行良好]
//代码上传文件源代码。

Storage storage = StorageOptions.getDefaultInstance().getService();
Bucket bucket = storage.get(storageConfiguration.getBucketProfileImage());
bucket.create(userEmail, profileImage.getBytes());

//////控制台错误

{
textPayload: "[start] 2021/02/17 19:44:38.961815 Quitting on terminated signal"
insertId: "602d7226000eb26df75b4c10"
resource: {2}
timestamp: "2021-02-17T19:44:38.963181Z"
labels: {1}
logName: "projects/dmdlegtek/logs/%2Fvar%2Flog%2Fgoogle_init.log"
receiveTimestamp: "2021-02-17T19:44:38.967156246Z"
}
{
textPayload: "[start] 2021/02/17 19:44:38.962343 Start program failed: failed to detect app after start: ForAppStart(): [aborted, context canceled. subject:"app/invalid" Timeout:30m0s, attempts:119817 aborted, context canceled. subject:"app/valid" Timeout:30m0s, attempts:119816]"
insertId: "602d7226000eb3e20d9df5ea"
resource: {2}
timestamp: "2021-02-17T19:44:38.963554Z"
labels: {1}
logName: "projects/dmdlegtek/logs/%2Fvar%2Flog%2Fgoogle_init.log"
receiveTimestamp: "2021-02-17T19:44:39.300910002Z"
}
protoPayload: {24}
insertId: "602d7264000809655cdc3243"
httpRequest: {1}
resource: {2}
timestamp: "2021-02-17T19:44:52.978541Z"
severity: "ERROR"
labels: {1}
logName: "projects/dmdlegtek/logs/appengine.googleapis.com%2Frequest_log"
operation: {4}
trace: "projects/dmdlegtek/traces/9ba214ee8ea774abb299fc99a4e969d5"
receiveTimestamp: "2021-02-17T19:45:40.533294344Z"
traceSampled: true
}

在此处输入图像描述
使用ide或cli在本地运行时 mvn clean package spring-boot:run 在application.yml和google cloud application\u default\u credentials.json$home/.config/gcloud的正确值下,该服务工作正常,能够连接cloudsql和google cloud存储桶中的postgres并执行操作。
但是当同一个应用部署在appengine和google云vm示例上时(都是通过docker和server运行的) mvn clean pacakge spring-boot:run 它根本没有React。
检查部署在aws ec2机器上也和它的工作很好(都与docker和mvnSpring)-boot:run)..
该服务的核心功能是连接到cloudstorage并在bucket上运行某些put和get操作,它使用spring-boot gcp库作为https://github.com/spring-cloud/spring-cloud-gcp/tree/master/spring-cloud-gcp-samples/spring-cloud-gcp-storage-resource-sample
其余的spring引导服务我们没有使用云存储,并且可以很好地使用appengine。
所有的服务都在使用cloudsqlpostgres,而且也可以很好地使用它。
奇怪的是,它什么都不响应,请求只是等到超时。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题