quarkus: OpenshiftProcessor throws StackOverflowError on 3.0.0.Alpha6

Describe the bug

Since 3.0.0.Alpha6, using quarkus.kubernetes.deploy=true leads to a StackOverflowError, then IllegalStateException: Build:quarkus-github-lottery-2 failed! Failed to fetch the input source.

3.0.0.Alpha5 worked fine.

Expected behavior

No StackOverflowError.

Actual behavior

See https://github.com/quarkusio/quarkus-github-lottery/actions/runs/4428450881/jobs/7767890656

[INFO] [io.quarkus.container.image.openshift.deployment.OpenshiftProcessor] Starting (in-cluster) container image build for jar using: BINARY on server: ***/ in namespace:prod-quarkus-github-lottery.
[INFO] [io.quarkus.container.image.openshift.deployment.OpenshiftProcessor] Applied: ImageStream ubi-quarkus-native-binary-s2i
[INFO] [io.quarkus.container.image.openshift.deployment.OpenshiftProcessor] Applied: ImageStream quarkus-github-lottery
[INFO] [io.quarkus.container.image.openshift.deployment.OpenshiftProcessor] Applied: BuildConfig quarkus-github-lottery
Error:  Unhandled exception
java.lang.StackOverflowError
    at java.lang.ClassLoader.defineClass1 (Native Method)
    at java.lang.ClassLoader.defineClass (ClassLoader.java:1012)
    at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:150)
    at java.net.URLClassLoader.defineClass (URLClassLoader.java:524)
    at java.net.URLClassLoader$1.run (URLClassLoader.java:427)
    at java.net.URLClassLoader$1.run (URLClassLoader.java:421)
    at java.security.AccessController.doPrivileged (AccessController.java:712)
    at java.net.URLClassLoader.findClass (URLClassLoader.java:420)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf (ClassRealm.java:425)
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:42)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239)
    at org.slf4j.impl.SimpleLogger.formatAndLog (SimpleLogger.java:394)
    at org.slf4j.impl.SimpleLogger.error (SimpleLogger.java:612)
    at io.vertx.core.logging.SLF4JLogDelegate.log (SLF4JLogDelegate.java:205)
    at io.vertx.core.logging.SLF4JLogDelegate.log (SLF4JLogDelegate.java:160)
    at io.vertx.core.logging.SLF4JLogDelegate.error (SLF4JLogDelegate.java:77)
    at io.vertx.core.impl.logging.LoggerAdapter.error (LoggerAdapter.java:94)
    at io.vertx.core.impl.ContextBase.reportException (ContextBase.java:201)
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess (FutureImpl.java:144)
    at io.vertx.core.impl.future.FutureBase.emitSuccess (FutureBase.java:60)
    at io.vertx.core.impl.future.FutureImpl.addListener (FutureImpl.java:196)
    at io.vertx.core.impl.future.PromiseImpl.addListener (PromiseImpl.java:23)
    at io.vertx.core.impl.future.FutureImpl.onComplete (FutureImpl.java:164)
    at io.vertx.core.impl.future.PromiseImpl.onComplete (PromiseImpl.java:23)
    at io.fabric8.kubernetes.client.vertx.InputStreamReadStream.readChunk (InputStreamReadStream.java:101)
    at io.fabric8.kubernetes.client.vertx.InputStreamReadStream.lambda$readChunk$3 (InputStreamReadStream.java:107)
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess (FutureImpl.java:141)
    at io.vertx.core.impl.future.FutureBase.emitSuccess (FutureBase.java:60)
    at io.vertx.core.impl.future.FutureImpl.addListener (FutureImpl.java:196)
    at io.vertx.core.impl.future.PromiseImpl.addListener (PromiseImpl.java:23)
    at io.vertx.core.impl.future.FutureImpl.onComplete (FutureImpl.java:164)
    at io.vertx.core.impl.future.PromiseImpl.onComplete (PromiseImpl.java:23)
    at io.fabric8.kubernetes.client.vertx.InputStreamReadStream.readChunk (InputStreamReadStream.java:101)
    at io.fabric8.kubernetes.client.vertx.InputStreamReadStream.lambda$readChunk$3 (InputStreamReadStream.java:107)
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess (FutureImpl.java:141)
    at io.vertx.core.impl.future.FutureBase.emitSuccess (FutureBase.java:60)
    at io.vertx.core.impl.future.FutureImpl.addListener (FutureImpl.java:196)
    at io.vertx.core.impl.future.PromiseImpl.addListener (PromiseImpl.java:23)
    at io.vertx.core.impl.future.FutureImpl.onComplete (FutureImpl.java:164)
    at io.vertx.core.impl.future.PromiseImpl.onComplete (PromiseImpl.java:23)
    at io.fabric8.kubernetes.client.vertx.InputStreamReadStream.readChunk (InputStreamReadStream.java:101)
    at io.fabric8.kubernetes.client.vertx.InputStreamReadStream.lambda$readChunk$3 (InputStreamReadStream.java:107)
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess (FutureImpl.java:141)
    at io.vertx.core.impl.future.FutureBase.emitSuccess (FutureBase.java:60)
    at io.vertx.core.impl.future.FutureImpl.addListener (FutureImpl.java:196)
    at io.vertx.core.impl.future.PromiseImpl.addListener (PromiseImpl.java:23)
    at io.vertx.core.impl.future.FutureImpl.onComplete (FutureImpl.java:164)
    at io.vertx.core.impl.future.PromiseImpl.onComplete (PromiseImpl.java:23)
    at io.fabric8.kubernetes.client.vertx.InputStreamReadStream.readChunk (InputStreamReadStream.java:101)
    at io.fabric8.kubernetes.client.vertx.InputStreamReadStream.lambda$readChunk$3 (InputStreamReadStream.java:107)
[... removed lots of stack elements, but I think you got the idea...]
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess (FutureImpl.java:141)
    at io.vertx.core.impl.future.FutureBase.emitSuccess (FutureBase.java:60)
    at io.vertx.core.impl.future.FutureImpl.addListener (FutureImpl.java:196)
    at io.vertx.core.impl.future.PromiseImpl.addListener (PromiseImpl.java:23)
    at io.vertx.core.impl.future.FutureImpl.onComplete (FutureImpl.java:164)
    at io.vertx.core.impl.future.PromiseImpl.onComplete (PromiseImpl.java:23)
    at io.fabric8.kubernetes.client.vertx.InputStreamReadStream.readChunk (InputStreamReadStream.java:101)
    at io.fabric8.kubernetes.client.vertx.InputStreamReadStream.lambda$readChunk$3 (InputStreamReadStream.java:107)
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess (FutureImpl.java:141)
    at io.vertx.core.impl.future.FutureBase.emitSuccess (FutureBase.java:60)
    at io.vertx.core.impl.future.FutureImpl.addListener (FutureImpl.java:196)
    at io.vertx.core.impl.future.PromiseImpl.addListener (PromiseImpl.java:23)
    at io.vertx.core.impl.future.FutureImpl.onComplete (FutureImpl.java:164)
    at io.vertx.core.impl.future.PromiseImpl.onComplete (PromiseImpl.java:23)
    at io.fabric8.kubernetes.client.vertx.InputStreamReadStream.readChunk (InputStreamReadStream.java:101)
    at io.fabric8.kubernetes.client.vertx.InputStreamReadStream.lambda$readChunk$3 (InputStreamReadStream.java:107)
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess (FutureImpl.java:141)
    at io.vertx.core.impl.future.FutureBase.emitSuccess (FutureBase.java:60)
    at io.vertx.core.impl.future.FutureImpl.addListener (FutureImpl.java:196)
    at io.vertx.core.impl.future.PromiseImpl.addListener (PromiseImpl.java:23)
Error:  Failed to upload archive file for the build: quarkus-github-lottery
Error:  Please check cluster events via `oc get events` to see what could have possibly gone wrong
Error:  Connection was closed
Warning:  [io.quarkus.container.image.openshift.deployment.OpenshiftProcessor] An exception: 'Can't instantiate binary build, due to error reading/writing stream. Can be caused if the output stream was closed by the server.See if something's wrong in recent events in Cluster = Scheduled quarkus-github-lottery-2-build.174ca432388bb828 Successfully assigned prod-quarkus-github-lottery/quarkus-github-lottery-2-build to ip-10-0-142-232.us-west-2.compute.internal by ip-10-0-182-138
BuildStarted quarkus-github-lottery-2.174ca4330fc17990 Build prod-quarkus-github-lottery/quarkus-github-lottery-2 is now running
AddedInterface quarkus-github-lottery-2-build.174ca432d17684bb Add eth0 [10.128.2.221/23] from openshift-sdn
Pulled quarkus-github-lottery-2-build.174ca432d3162e2c Container image "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:0e7936be00b487aac810f6c519a0cec1341b3f8065a23b969730f96c1a5c5dd0" already present on machine
Created quarkus-github-lottery-2-build.174ca432dfefdb34 Created container git-clone
Started quarkus-github-lottery-2-build.174ca432e1860a9e Started container git-clone
 ' occurred while instantiating the build, however the build has been started.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  13:42 min
[INFO] Finished at: 2023-03-15T16:26:40Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal io.quarkus:quarkus-maven-plugin:3.0.0.Alpha6:build (default) on project quarkus-github-lottery: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
Error: [ERROR] 	[error]: Build step io.quarkus.container.image.openshift.deployment.OpenshiftProcessor#openshiftBuildFromNative threw an exception: java.lang.IllegalStateException: Build:quarkus-github-lottery-2 failed! Failed to fetch the input source.
Error:  	at io.quarkus.container.image.openshift.deployment.OpenshiftProcessor.openshiftBuild(OpenshiftProcessor.java:484)
Error:  	at io.quarkus.container.image.openshift.deployment.OpenshiftProcessor.lambda$openshiftBuild$10(OpenshiftProcessor.java:424)
Error:  	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
Error:  	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
Error:  	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
Error:  	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
Error:  	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
Error:  	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
Error:  	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
Error:  	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
Error:  	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
Error:  	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
Error:  	at io.quarkus.container.image.openshift.deployment.OpenshiftProcessor.openshiftBuild(OpenshiftProcessor.java:424)
Error:  	at io.quarkus.container.image.openshift.deployment.OpenshiftProcessor.createContainerImage(OpenshiftProcessor.java:388)
Error:  	at io.quarkus.container.image.openshift.deployment.OpenshiftProcessor.openshiftBuildFromNative(OpenshiftProcessor.java:352)
Error:  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Error:  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
Error:  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Error:  	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
Error:  	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:909)
Error:  	at io.quarkus.builder.BuildContext.run(BuildContext.java:282)
Error:  	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
Error:  	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
Error:  	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
Error:  	at java.base/java.lang.Thread.run(Thread.java:833)
Error:  	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
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
Error: Process completed with exit code 1.

How to Reproduce?

I don’t have a reproducer but here is the project: https://github.com/quarkusio/quarkus-github-lottery/

Command:

mvn clean package -Dquarkus.kubernetes.deploy=true -Dquarkus.native.container-build=true -Dnative -Drevision=${{ github.sha }}

See https://github.com/quarkusio/quarkus-github-lottery/blob/4a0f8d6655025fffa099396854de89d2fc3c1d73/.github/workflows/deploy.yml#L36-L43

Configuration:

quarkus.application.name=quarkus-github-lottery
quarkus.application.version=${buildNumber:999-SNAPSHOT}

quarkus.qute.suffixes=md
quarkus.qute.content-types."md"=text/markdown

%test.quarkus.scheduler.enabled=false
%test.quarkus.log.category."io.quarkus.github.lottery".level=DEBUG

%dev.quarkus.scheduler.enabled=false
%dev.quarkus.log.category."io.quarkus.github.lottery".level=DEBUG

%prod.quarkus.openshift.labels."app"=quarkus-github-lottery
# renew the SSL certificate automatically
%prod.quarkus.openshift.annotations."kubernetes.io/tls-acme"=true
%prod.quarkus.openshift.env.configmaps=quarkus-github-lottery-config
%prod.quarkus.openshift.env.secrets=quarkus-github-lottery-secrets

See https://github.com/quarkusio/quarkus-github-lottery/blob/4a0f8d6655025fffa099396854de89d2fc3c1d73/src/main/resources/application.properties

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

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

No response

Additional information

I was affected by #31476 on Alpha4, not sure if this is related.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 20 (16 by maintainers)

Most upvoted comments

@manusa @gsmet the commit should be trivial to cherry-pick indeed

Thank you, @vietj!

Let me try to create the PR by cherry-picking Julien’s commit

@manusa no worries, you shouldn’t even have read this thread, go back to your PTO!