Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jib sometimes has errors that rely on org.apache.commons.lang3.function.Suppliers.nul() without this method #44884

Open
cdmikechen opened this issue Dec 3, 2024 · 5 comments
Labels
area/container-image kind/bug Something isn't working triage/needs-feedback We are waiting for feedback.

Comments

@cdmikechen
Copy link

cdmikechen commented Dec 3, 2024

Describe the bug

When jib builds docker with my own image, an error message is displayed:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  35.514 s
[INFO] Finished at: 2024-12-03T15:20:13+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.15.1:build (default) on project datasource-rdbms: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] 	[error]: Build step io.quarkus.container.image.jib.deployment.JibProcessor#buildFromJar threw an exception: java.lang.RuntimeException: Unable to create container image
[ERROR] 	at io.quarkus.container.image.jib.deployment.JibProcessor.containerize(JibProcessor.java:273)
[ERROR] 	at io.quarkus.container.image.jib.deployment.JibProcessor.buildFromJar(JibProcessor.java:200)
[ERROR] 	at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
[ERROR] 	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
[ERROR] 	at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
[ERROR] 	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
[ERROR] 	at java.base/java.lang.Thread.run(Thread.java:833)
[ERROR] 	at org.jboss.threads.JBossThread.run(JBossThread.java:483)
[ERROR] Caused by: java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: 'java.util.function.Supplier org.apache.commons.lang3.function.Suppliers.nul()'
[ERROR] 	at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:594)
[ERROR] 	at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:553)
[ERROR] 	at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:91)
[ERROR] 	at com.google.cloud.tools.jib.builder.steps.PushLayerStep.call(PushLayerStep.java:78)
[ERROR] 	at com.google.cloud.tools.jib.builder.steps.PushLayerStep.call(PushLayerStep.java:33)
[ERROR] 	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
[ERROR] 	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:76)
[ERROR] 	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
[ERROR] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[ERROR] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[ERROR] 	at java.base/java.lang.Thread.run(Thread.java:833)
[ERROR] Caused by: java.lang.NoSuchMethodError: 'java.util.function.Supplier org.apache.commons.lang3.function.Suppliers.nul()'
[ERROR] 	at org.apache.commons.lang3.SystemProperties.getProperty(SystemProperties.java:755)
[ERROR] 	at org.apache.commons.lang3.SystemProperties.getOsName(SystemProperties.java:718)
[ERROR] 	at org.apache.commons.compress.archivers.tar.TarArchiveEntry.normalizeFileName(TarArchiveEntry.java:231)
[ERROR] 	at org.apache.commons.compress.archivers.tar.TarArchiveEntry.<init>(TarArchiveEntry.java:580)
[ERROR] 	at com.google.cloud.tools.jib.image.ReproducibleLayerBuilder.build(ReproducibleLayerBuilder.java:169)
[ERROR] 	at com.google.cloud.tools.jib.builder.steps.BuildAndCacheApplicationLayerStep.call(BuildAndCacheApplicationLayerStep.java:107)
[ERROR] 	at com.google.cloud.tools.jib.builder.steps.BuildAndCacheApplicationLayerStep.call(BuildAndCacheApplicationLayerStep.java:38)
[ERROR] 	... 6 more
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Expected behavior

When custom images are not used, the images can be created and pushed to the harbor.

Actual behavior

When we were searching for the problem, we found that jib community had similar problems. The possible cause was the package conflict between quarkus and jib-core: GoogleContainerTools/jib#4235

We have tried to downgrade the relevant version, which can temporarily solve this problem, but we hope the community can consider whether to downgrade jib or downgrade commons-compress(I don't know if there is a conflict problem with other dependencies of quarkus, so hope to verify the community).

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-compress</artifactId>
            <version>1.26.0</version>
        </dependency>

How to Reproduce?

custom dockerfile

FROM registry.access.redhat.com/ubi8/openjdk-17:1.16
USER root
RUN sed -i '/^jdk.tls.disabledAlgorithms=/s/, TLSv1.1//' /usr/lib/jvm/java-17/conf/security/java.security
RUN sed -i '/^jdk.tls.disabledAlgorithms=/s/, TLSv1//' /usr/lib/jvm/java-17/conf/security/java.security
RUN sed -i '/^jdk.tls.disabledAlgorithms=/s/, TLSv1.1//' /etc/crypto-policies/back-ends/java.config
RUN sed -i '/^jdk.tls.disabledAlgorithms=/s/, TLSv1//' /etc/crypto-policies/back-ends/java.config

Output of uname -a or ver

MacOS 14.5

Output of java -version

OpenJDK Runtime Environment GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06)

Quarkus version or git rev

3.15.1

Build tool (ie. output of mvnw --version or gradlew --version)

mvn install -DskipTests=true \ -Dquarkus.container-image.insecure=true \ -Dquarkus.container-image.registry=harbor.xxx.com:5443 \ -Dquarkus.container-image.username=xxx \ -Dquarkus.container-image.password=xxx \ -Dquarkus.container-image.build=true \ -Dquarkus.container-image.push=true \ -Dquarkus.container-image.group=xxx \ -Dquarkus.container-image.name=xxx \ -Dquarkus.container-image.tag=xxx \ -DsendCredentialsOverHttp=true

Additional information

No response

@cdmikechen cdmikechen added the kind/bug Something isn't working label Dec 3, 2024
Copy link

quarkus-bot bot commented Dec 3, 2024

/cc @geoand (jib)

@geoand
Copy link
Contributor

geoand commented Dec 3, 2024

Unfortunately we need version 1.27 of commons-compress.

See:

<commons-compress.version>1.27.1</commons-compress.version> <!-- Please check with Java Operator SDK / Fabric8 team before updating -->

in our BOM.

@cdmikechen
Copy link
Author

@geoand
Thanks for your quick reply~
Is there a way for quarkus to compile with 1.26.0 and deploy with 1.27.0, please?
Although only I have encountered this problem at present, I think it is better to have a solution to this dependency conflict.

@geoand
Copy link
Contributor

geoand commented Dec 3, 2024

Can you test if there problem exists with Quarkus 3.17?

@geoand geoand added the triage/needs-feedback We are waiting for feedback. label Dec 3, 2024
@gsmet
Copy link
Member

gsmet commented Dec 9, 2024

What I'm not sure I understand is:

[ERROR] Caused by: java.lang.NoSuchMethodError: 'java.util.function.Supplier org.apache.commons.lang3.function.Suppliers.nul()'
[ERROR] 	at org.apache.commons.lang3.SystemProperties.getProperty(SystemProperties.java:755)
[ERROR] 	at org.apache.commons.lang3.SystemProperties.getOsName(SystemProperties.java:718)

Meaning it's a Commons Lang3 method calling another Commons Lang3 method and somehow things are not consistent. It's a bit puzzling.

Any chance you could prepare a small reproducer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/container-image kind/bug Something isn't working triage/needs-feedback We are waiting for feedback.
Projects
None yet
Development

No branches or pull requests

3 participants