Oir*_*pok 1 java google-app-engine spring spring-boot google-cloud-platform
我尝试将 spring java 11 应用程序部署到 B2 实例上的 GCP 应用程序引擎,它部署但立即崩溃,并出现以下奇异错误:
textPayload: "[start] 2021/06/20 18:09:58.614416 Start program failed: termination triggered by nginx exit"
Run Code Online (Sandbox Code Playgroud)
于是我在F实例上再次尝试,效果非常好。App Engine B实例不支持Java之类的吗?我正在阅读文档,看起来它应该可以工作。我再次尝试使用 B 实例仅更改我的 app.yaml 文件,它再次崩溃并抛出相同的错误。是否有一些关于 F 和 B 实例之间差异的不成文文档?
仅供参考,以防万一,这是我在尝试 F 和 B 实例时的 app.yaml:
B实例:
runtime: java11
env: standard
instance_class: B2
service: hello-there
basic_scaling:
max_instances: 2
idle_timeout: 10m
Run Code Online (Sandbox Code Playgroud)
F实例:
runtime: java11
env: standard
instance_class: F4
service: hello-there
automatic_scaling:
max_instances: 1
Run Code Online (Sandbox Code Playgroud)
I did more attempts and i captured the tail log here:
2021-06-20 01:52:08 ho-api[1]
2021-06-20 01:52:08 ho-api[1] . ____ _ __ _ _
2021-06-20 01:52:08 ho-api[1] /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
2021-06-20 01:52:08 ho-api[1] ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
2021-06-20 01:52:08 ho-api[1] \\/ ___)| |_)| | | | | || (_| | ) ) ) )
2021-06-20 01:52:08 ho-api[1] ' |____| .__|_| |_|_| |_\__, | / / / /
2021-06-20 01:52:08 ho-api[1] =========|_|==============|___/=/_/_/_/
2021-06-20 01:52:08 ho-api[1] :: Spring Boot :: (v2.4.1)
2021-06-20 01:52:08 ho-api[1]
2021-06-20 01:52:08 ho-api[1] 2021-06-20 01:52:08.180 INFO 11 -.
Run Code Online (Sandbox Code Playgroud)
。。。。。。
: Started Hello in 10.229 seconds (JVM running for 11.56)
Default
2021-06-20 15:09:58.513 ADT
I0620 18:09:46.223078 20 jvmti_agent.cc:159] Java debuglet initialization started
Default
2021-06-20 15:09:58.521 ADT
I0620 18:09:46.224159 20 jvmti_agent.cc:193] Java debuglet initialization completed
Default
2021-06-20 15:09:58.521 ADT
I0620 18:09:46.370362 20 jvmti_agent.cc:204] Java VM started
Default
2021-06-20 15:09:58.521 ADT
I0620 18:09:46.395424 20 jvmti_agent.cc:214] JvmtiAgent::JvmtiOnVMInit initialization time: 25084 microseconds
Default
2021-06-20 15:09:58.522 ADT
I0620 18:09:46.396665 29 jvmti_agent_thread.cc:95] Agent thread started: CloudDebugger_main_worker_thread
Default
2021-06-20 15:09:58.522 ADT
I0620 18:09:46.400967 29 jvm_internals.cc:370] Loading internals from /opt/cdbg/cdbg_java_agent_internals.jar
Default
2021-06-20 15:09:58.522 ADT
I0620 18:09:46.558127 29 jvmti_agent.cc:365] Initializing Cloud Debugger Java agent version: 2.27
Default
2021-06-20 15:09:58.522 ADT
I0620 18:09:46.559283 29 jni_logger.cc:31] Initializing ClassPathLookup, default classpath: true, extra classpath: []
Default
2021-06-20 15:09:58.522 ADT
I0620 18:09:46.576998 29 jni_logger.cc:31] Total size of indexed resources database: 3679 bytes
Default
2021-06-20 15:09:58.522 ADT
I0620 18:09:46.582134 29 jvm_internals.cc:131] ClassPathLookup constructor time: 23965 microseconds
Default
2021-06-20 15:09:58.522 ADT
I0620 18:09:46.582628 29 yaml_data_visibility_config_reader.cc:67] debugger-blocklist.yaml was not found. Using default settings.
Default
2021-06-20 15:09:58.523 ADT
I0620 18:09:48.015766 29 jni_logger.cc:31] Debuggee gcp:378392885568:15c098d156eb62e2, agentId 60ce1323-0000-2bc4-944e-582429bcf920, registered: {"debuggee":{"id":"gcp:378392885568:15c098d156eb62e2","project":"378392885568","uniquifier":"DA39A3EE5E6B4B0D3255BFEF95601890AFD80709","description":"owl-system-ho-api-1-435996213358003587","agentVersion":"google.com/java-gcp/@2","sourceContexts":[{"git":{"url":"https://github.com/owl-fullDev/HOapi.git","revisionId":"373d818bb1c2436ac0ba0689712a621f33c748e8"}}],"labels":{"version":"1","module":"ho-api","minorversion":"435996213358003587","blocklistsource":"none"}},"agentId":"60ce1323-0000-2bc4-944e-582429bcf920"}, agent version: 2.27
Default
2021-06-20 15:09:58.523 ADT
I0620 18:09:48.015808 29 jvmti_agent.cc:437] Attaching Java debuglet
Default
2021-06-20 15:09:58.523 ADT
I0620 18:09:48.018111 29 rate_limit.cc:137] CPU count: 2
Default
2021-06-20 15:09:58.523 ADT
I0620 18:09:48.018128 29 rate_limit.cc:145] Adjusted CPU count: 1
Default
2021-06-20 15:09:58.523 ADT
I0620 18:09:48.018142 29 debugger.cc:100] Initializing Java debuglet
Default
2021-06-20 15:09:58.523 ADT
I0620 18:09:48.030673 29 debugger.cc:109] Debugger::Initialize initialization time: 13 ms
Default
2021-06-20 15:09:58.524 ADT
I0620 18:09:58.406167 58 jvmti_agent.cc:222] Java VM termination
Default
2021-06-20 15:09:58.524 ADT
I0620 18:09:58.407428 29 jvmti_agent_thread.cc:99] Agent thread exited: CloudDebugger_main_worker_thread
Default
2021-06-20 15:09:58.524 ADT
I0620 18:09:58.415417 58 worker.cc:113] Debugger threads terminated
Default
2021-06-20 15:09:58.524 ADT
I0620 18:09:58.415448 58 jvmti_agent.cc:236] JvmtiAgent::JvmtiOnVMDeath cleanup time: 9298 microseconds
Default
2021-06-20 15:09:58.615 ADT
[start] 2021/06/20 18:09:58.614416 Start program failed: termination triggered by nginx exit
Run Code Online (Sandbox Code Playgroud)
重新阅读应用程序引擎文档后,我在生命周期深处发现了以下行。
启动 每个服务实例都是为了响应启动请求而创建的,该请求是对 /_ah/start 的空 HTTP GET 请求。
应用程序需要响应 HTTP 代码 200,只有这样应用程序引擎才会允许应用程序继续运行,如果返回 200 以外的任何内容,它将杀死应用程序。我的应用程序需要一个 auth 标头,因此它返回 401,这导致应用程序引擎终止该实例。这仅适用于 B 实例,不适用于 F 实例。因此,解决方案是将默认端点列入身份验证白名单。
| 归档时间: |
|
| 查看次数: |
296 次 |
| 最近记录: |