GoogleContainerTools / jib

🏗 Build container images for your Java applications.
Apache License 2.0
13.71k stars 1.44k forks source link

Jib Ubuntu and MacOS Continuous Builds are failing #4211

Closed mpeddada1 closed 8 months ago

mpeddada1 commented 8 months ago

As observed by @zhumin8, the jib-ubuntu and jib-macos continious tests have been consistently failing.

The failure appears to originate from the jib-cli integration tests, particularly:

com.google.cloud.tools.jib.cli.WarCommandTest > testWar_jetty FAILED
    java.lang.AssertionError: expected:<Hello world> but was:<null>
        at org.junit.Assert.fail(Assert.java:89)
        at org.junit.Assert.failNotEquals(Assert.java:835)
        at org.junit.Assert.assertEquals(Assert.java:120)
        at org.junit.Assert.assertEquals(Assert.java:146)
        at com.google.cloud.tools.jib.api.HttpRequestTester.verifyBody(HttpRequestTester.java:35)
        at com.google.cloud.tools.jib.cli.WarCommandTest.testWar_jetty(WarCommandTest.java:99)

Test Fusion Link

mpeddada1 commented 8 months ago

More observations: These checks started failing on Feb 2, 2024, starting with this PR

chanseokoh commented 8 months ago

IIRC, the Jetty tests were already failing when I tried to file the PR.

mpeddada1 commented 8 months ago

Hm I see, that is good to know. Thanks for the input @chanseokoh. Will try running these locally to see what may have changed.

mpeddada1 commented 8 months ago

Observations:

- Running docker image with jetty 10.0.8 base image with `docker run -p8080:8080 exploded-war` results in:

java.lang.NoClassDefFoundError: jakarta/servlet/http/HttpServlet at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174) at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:555) at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:458) at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451) at org.eclipse.jetty.webapp.WebAppClassLoader.foundClass(WebAppClassLoader.java:594) at org.eclipse.jetty.webapp.WebAppClassLoader.loadAsResource(WebAppClassLoader.java:567) at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:502) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at org.eclipse.jetty.util.Loader.loadClass(Loader.java:59) at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:97)

- Running the docker image with `jetty:latest` results in the following logs (with both jakarta.servlet:jakarta.servlet-api:5.0.0 and jakarta.servlet:jakarta.servlet-api:6.0.0). Note the deployment logic missing from the logs:

2024-03-19 02:03:10.216:INFO :oejs.Server:main: jetty-12.0.7; built: 2024-02-29T21:19:41.771Z; git: c89aca8fd34083befd79f328a3b8b6ffff04347e; jvm 21.0.2+13-LTS 2024-03-19 02:03:10.319:INFO :oejs.AbstractConnector:main: Started ServerConnector@49e53c76{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} 2024-03-19 02:03:10.365:INFO :oejs.Server:main: Started oejs.Server@50a638b5{STARTING}[12.0.7,sto=5000] @1908ms



Jetty 12 release notes: https://github.com/jetty/jetty.project/releases/tag/jetty-12.0.0
mpeddada1 commented 8 months ago

According to https://eclipse.dev/jetty/documentation/jetty-12/operations-guide/index.html, in order to deploy the web app, we need: java -jar $JETTY_HOME/start.jar --add-modules=ee10-deploy. Setting this as the entrypoint worked locally.