8000 Unexpected Runtime Selection in GAE Standard – Instances Randomly Using EE8 (Jetty 12 + Java 21) Instead of Java 17 (Jetty 9) · Issue #358 · GoogleCloudPlatform/appengine-java-standard · GitHub
[go: up one dir, main page]

Skip to content
Unexpected Runtime Selection in GAE Standard – Instances Randomly Using EE8 (Jetty 12 + Java 21) Instead of Java 17 (Jetty 9) #358
@vivekbhatnagar

Description

@vivekbhatnagar

One of our application, deployed on Google App Engine (GAE) Standard Environment, is explicitly designed to run on Java 17 with Jetty 9. However, we have observed inconsistent behavior where some instances are randomly being assigned to an EE8 runtime profile (Jetty 12 + Java 21) instead of Java 17 with Jetty 9.
This unexpected transition to Jetty 12 causes multipart request handling failures, leading to the following error:

java.lang.IllegalStateException: No multipart config for servlet
    at org.eclipse.jetty.ee8.nested.Request.getParts(Request.java:1714)
    at org.eclipse.jetty.ee8.nested.Request.getParts(Request.java:1698)
    at org.eclipse.jetty.ee8.nested.Request.getPart(Request.java:1689)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:517)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:584)
    at org.eclipse.jetty.ee8.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1151)
    at org.eclipse.jetty.ee8.servlet.ServletHolder.handle(ServletHolder.java:640)

Observed Behavior in Logs:
When instances use the EE8 profile (Jetty 12 + Java 21), multipart requests fail. The log messages for such instances include:

INFO: Using runtime classpath: /base/java_runtime/runtime-impl-jetty12.jar
Feb 25, 2025 3:08:02 PM com.google.apphosting.runtime.ClassPathUtils initForJava11OrAbove
INFO: AppEngine is using EE8 profile.

On the other hand, when instances run on Java 17 (Jetty 9), multipart handling works correctly. The working instances log the following:

INFO: Using runtime classpath: /base/java_runtime/runtime-impl-jetty9.jar

Key Issues:

  • Random Runtime Selection: Despite our app being configured for Java 17, some instances randomly switch to EE8 (Java 21 + Jetty 12) without any changes in our configuration.
  • Multipart Handling Breaks in Jetty 12: Since our app was developed for Jetty 9, the multipart servlet configuration is not working correctly under Jetty 12.

Questions

  • Why is GAE Standard randomly choosing the EE8 profile (Jetty 12 + Java 21) for some instances instead of Java 17 (Jetty 9)?
  • Is there an explicit way to enforce Java 17 (Jetty 9) and prevent GAE from switching to Jetty 12?

(appengine-web.xml)

<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <sessions-enabled>true</sessions-enabled>
    <runtime>java17</runtime>
    <app-engine-apis>true</app-engine-apis>
    <instance-class>F2</instance-class>
    <automatic-scaling>
        <target-cpu-utilization>0.95</target-cpu-utilization>
        <max-pending-latency>8s</max-pending-latency>
    </automatic-scaling>
    <staging>
        <enable-jar-classes>true</enable-jar-classes>
    </staging>
</appengine-web-app>

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0