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

java.util.NoSuchElementException: SRCFG00011: Could not expand value platform.quarkus.native.builder-image in property quarkus.native.builder-image #45472

Open
Inithron opened this issue Jan 9, 2025 · 6 comments
Labels
area/container-image kind/bug Something isn't working triage/needs-reproducer We are waiting for a reproducer.

Comments

@Inithron
Copy link

Inithron commented Jan 9, 2025

Describe the bug

After the update of Quarkus from 3.15.1 to 3.17.6 following error occurs when building an image:

 * What went wrong:
 Execution failed for task ':application-name:quarkusAppPartsBuild'.
 > There was a failure while executing work items
    > A failure occurred while executing io.quarkus.gradle.tasks.worker.BuildWorker
       > Configuration validation failed:
         	java.util.NoSuchElementException: SRCFG00011: Could not expand value platform.quarkus.native.builder-image in property quarkus.native.builder-image

There was no change in the code. Only the update of Quarkus.
I did some research and found this issue: #19139. But we are already using implementation enforcedPlatform('io.quarkus.platform:quarkus-bom:3.17.6')
We are using the io.quarkus:quarkus-container-image-jib extension with following configuration:

quarkus.container-image.build=true
quarkus.container-image.push=true
quarkus.container-image.registry=reqestyUrl
quarkus.container-image.group=imageName
quarkus.container-image.username=username
quarkus.container-image.password=password

We don't create native images.

There is a workaround: When we set the following property: quarkus.native.builder-image=mandrel, then the images can be build again.

Expected behavior

  1. When no native images are build, it should not be necessary to set properties which are needed only for building native images.
  2. 'mandrel' is the default value for quarkus.native.builder-image. So it should not be necessary to set the default value.

Actual behavior

Without the mentioned workaround we are no more able to build images.

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

17

Quarkus version or git rev

3.17.6

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

Gradle 8.12

Additional information

Caused by: io.smallrye.config.ConfigValidationException: Configuration validation failed:
 	java.util.NoSuchElementException: SRCFG00011: Could not expand value platform.quarkus.native.builder-image in property quarkus.native.builder-image
 	at io.smallrye.config.SmallRyeConfig.buildMappings(SmallRyeConfig.java:139)
 	at io.smallrye.config.SmallRyeConfig.<init>(SmallRyeConfig.java:93)
 	at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:767)
 	at io.quarkus.deployment.configuration.BuildTimeConfigurationReader.initConfiguration(BuildTimeConfigurationReader.java:412)
 	at io.quarkus.deployment.ExtensionLoader.loadStepsFrom(ExtensionLoader.java:141)
 	at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:107)
 	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:351)
 	at io.quarkus.runner.bootstrap.AugmentActionImpl.createProductionApplication(AugmentActionImpl.java:178)
 	at io.quarkus.gradle.tasks.worker.BuildWorker.execute(BuildWorker.java:62)
 	at app//org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
 	at app//org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:54)
 	at app//org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:48)
 	at app//org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)
 	at app//org.gradle.workers.internal.AbstractClassLoaderWorker.executeInClassLoader(AbstractClassLoaderWorker.java:48)
 	at app//org.gradle.workers.internal.IsolatedClassloaderWorker.run(IsolatedClassloaderWorker.java:49)
 	at app//org.gradle.workers.internal.IsolatedClassloaderWorker.run(IsolatedClassloaderWorker.java:30)
 	at app//org.gradle.workers.internal.WorkerDaemonServer.run(WorkerDaemonServer.java:109)
 	at app//org.gradle.workers.internal.WorkerDaemonServer.run(WorkerDaemonServer.java:78)
 	at app//org.gradle.process.internal.worker.request.WorkerAction$1.call(WorkerAction.java:159)
 	at app//org.gradle.process.internal.worker.child.WorkerLogEventListener.withWorkerLoggingProtocol(WorkerLogEventListener.java:41)
 	at app//org.gradle.process.internal.worker.request.WorkerAction.lambda$run$1(WorkerAction.java:156)
 	at app//org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:85)
 	at app//org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:148)
 	at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 	at [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 	at [email protected]/java.lang.reflect.Method.invoke(Unknown Source)
 	at app//org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
 	at app//org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
 	at app//org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
 	at app//org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
 	at app//org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
 	at app//org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
 	at app//org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:48)
 	... 3 more
@Inithron Inithron added the kind/bug Something isn't working label Jan 9, 2025
Copy link

quarkus-bot bot commented Jan 9, 2025

/cc @geoand (jib)

@geoand
Copy link
Contributor

geoand commented Jan 9, 2025

@radcortez do you remember what caused similar issues in the past?

@radcortez
Copy link
Member

If I remember correctly, the property was missing for Gradle, because it was being set somewhere else (not included in Gradle):

this.config = ConfigUtils.emptyConfigBuilder()
.forClassLoader(toUrlClassloader(builder.sourceDirectories))
.withSources(new PropertiesConfigSource(builder.forcedProperties, "forcedProperties", 600))
.withSources(new PropertiesConfigSource(asStringMap(builder.taskProperties), "taskProperties", 500))
.addSystemSources()
.withSources(new PropertiesConfigSource(builder.buildProperties, "quarkusBuildProperties", 290))
.withSources(new PropertiesConfigSource(asStringMap(builder.projectProperties), "projectProperties", 280))
.withSources(new YamlConfigSourceLoader.InFileSystem())
.withSources(new YamlConfigSourceLoader.InClassPath())
.addPropertiesSources()
// todo: this is due to ApplicationModel#getPlatformProperties not being included in the effective config
.withSources(new PropertiesConfigSource(Map.of("platform.quarkus.native.builder-image", "<<ignored>>"),
"NativeConfig#builderImage", 0))
.withDefaultValues(builder.defaultProperties)
.withProfile(builder.profile)
.withMapping(PackageConfig.class)
.withMapping(NativeConfig.class)
.withInterceptors(ConfigCompatibility.FrontEnd.instance(), ConfigCompatibility.BackEnd.instance())
.build();

@Inithron can you please provide a reproducer? Thank you.

@radcortez radcortez added the triage/needs-reproducer We are waiting for a reproducer. label Jan 9, 2025
@Inithron
Copy link
Author

Inithron commented Jan 9, 2025

reproducer-for-45472.zip
Here is a "reproducer". Unfortunately I could reproduce the issue only with the very first execution of the assemble task, and a second time switching the base image from ubi8 to ubi9. But in all other executions the issue does no more occur. Even deleting the Gradle home directory did not help. The only case where I can reproduce the issue with each execution is on our build server. But I don't know why or what is the difference. Any ideas what else I can do to reproduce the issue locally?

@Inithron
Copy link
Author

Inithron commented Jan 9, 2025

reproducer-for-45472_2.zip
I tried out several things and after disabling the Gradle daemon (org.gradle.daemon=false) the behavior is now different. The first execution of ./gadlew.bat assemble is now passing, but all subsequent executions of the assemble task lead now to the mentioned issue.

@rteabeault
Copy link

rteabeault commented Jan 9, 2025

We are also seeing this after upgrading to Quarkus 3.17.x. Also using Gradle.
I can also confirm the behavior about reproducing. Setting --no-daemon causes it to fail every build after the first build.

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-reproducer We are waiting for a reproducer.
Projects
None yet
Development

No branches or pull requests

4 participants