quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.69k stars 2.65k forks source link

SRCFG00011: Could not expand value platform.quarkus.native.builder-image in property quarkus.native.builder-image #31420

Closed flaymes closed 1 year ago

flaymes commented 1 year ago

Describe the bug

Create a new quarkus maven project from IDEA. Could not start the project because of "SRCFG00011: Could not expand value platform.quarkus.native.builder-image in property quarkus.native.builder-image"

Expected behavior

No response

Actual behavior

How to Reproduce?

No response

Output of uname -a or ver

Windows 10

Output of java -version

No response

GraalVM version (if different from Java)

GraalVM 17

Quarkus version or git rev

2.16.3.Final

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

No response

Additional information

No response

flaymes commented 1 year ago

Caused by: java.util.NoSuchElementException: SRCFG00011: Could not expand value platform.quarkus.native.builder-image in property quarkus.native.builder-image at io.smallrye.config.ExpressionConfigSourceInterceptor$1.accept(ExpressionConfigSourceInterceptor.java:69) at io.smallrye.config.ExpressionConfigSourceInterceptor$1.accept(ExpressionConfigSourceInterceptor.java:59) at io.smallrye.common.expression.ExpressionNode.emit(ExpressionNode.java:22) at io.smallrye.common.expression.Expression.evaluateException(Expression.java:56) at io.smallrye.common.expression.Expression.evaluate(Expression.java:70) at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:59) at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:38) at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20) at io.smallrye.config.FallbackConfigSourceInterceptor.getValue(FallbackConfigSourceInterceptor.java:24) at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20) at io.smallrye.config.PropertyNamesConfigSourceInterceptor.getValue(PropertyNamesConfigSourceInterceptor.java:17) at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20) at io.smallrye.config.SmallRyeConfig.getConfigValue(SmallRyeConfig.java:323) at io.smallrye.config.SmallRyeConfig.getValue(SmallRyeConfig.java:230) at io.quarkus.deployment.configuration.BuildTimeConfigurationReader$ReadOperation.readConfigValue(BuildTimeConfigurationReader.java:779)

flaymes commented 1 year ago

   <properties>
        <compiler-plugin.version>3.10.1</compiler-plugin.version>
        <maven.compiler.release>17</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
        <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
        <quarkus.platform.version>2.16.3.Final</quarkus.platform.version>
        <skipITs>true</skipITs>
        <surefire-plugin.version>3.0.0-M7</surefire-plugin.version>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>${quarkus.platform.artifact-id}</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-resteasy-reactive-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-config-yaml</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-resteasy-reactive</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5</artifactId>
            <scope>test</scope>
        </dependency>```
flaymes commented 1 year ago

When I add platform.quarkus.native.builder-image properties in application.yml,then the project could be startd.

greeting:
  message: "hello"

platform:
    quarkus:
      native:
        builder-image: false
geoand commented 1 year ago

@gastaldi I keep on forgetting how we address this :(. Can we weigh in here?

gastaldi commented 1 year ago

I don't think we support that property. You need to remove the platform. in the YAML

gastaldi commented 1 year ago

@geoand there is a @ConfigGroup class to handle this afaik

geoand commented 1 year ago

This error comes from some misconfiguration of the platform, but I can't remember. Maybe @aloubyansky remembers

aloubyansky commented 1 year ago

Is it failing when launching from an IDE? Does it work from the command line? Any more details? The pom snippet looks ok.

Dieken commented 1 year ago
quarkus create app -P io.quarkus.platform:quarkus-bom:2.16.6.Final demo

cd demo

./mvnw compile quarkus:dev

....
Listening for transport dt_socket at address: 5005
2023-04-20 16:49:57,633 INFO  [io.qua.dep.dev.IsolatedDevModeMain] (main) Attempting to start live reload endpoint to recover from previous Quarkus startup failure
2023-04-20 16:49:57,997 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: io.quarkus.runtime.configuration.ConfigurationException: SRCFG00011: Could not expand value platform.quarkus.native.builder-image in property quarkus.native.builder-image
        at io.quarkus.deployment.configuration.BuildTimeConfigurationReader$ReadOperation.readConfigValue(BuildTimeConfigurationReader.java:784)
        at io.quarkus.deployment.configuration.BuildTimeConfigurationReader$ReadOperation.readConfigGroup(BuildTimeConfigurationReader.java:722)
        at io.quarkus.deployment.configuration.BuildTimeConfigurationReader$ReadOperation.run(BuildTimeConfigurationReader.java:361)
        at io.quarkus.deployment.configuration.BuildTimeConfigurationReader.lambda$readConfiguration$0(BuildTimeConfigurationReader.java:322)
        at io.smallrye.config.SecretKeys.doUnlocked(SecretKeys.java:29)
        at io.quarkus.deployment.configuration.BuildTimeConfigurationReader.readConfiguration(BuildTimeConfigurationReader.java:322)
        at io.quarkus.deployment.ExtensionLoader.loadStepsFrom(ExtensionLoader.java:195)
        at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:107)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:331)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:252)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:60)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:86)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:447)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:59)
        at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:149)
        at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:104)
        at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:131)
        at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:62)
Caused by: java.util.NoSuchElementException: SRCFG00011: Could not expand value platform.quarkus.native.builder-image in property quarkus.native.builder-image
        at io.smallrye.config.ExpressionConfigSourceInterceptor$1.accept(ExpressionConfigSourceInterceptor.java:69)
        at io.smallrye.config.ExpressionConfigSourceInterceptor$1.accept(ExpressionConfigSourceInterceptor.java:59)
        at io.smallrye.common.expression.ExpressionNode.emit(ExpressionNode.java:22)
        at io.smallrye.common.expression.Expression.evaluateException(Expression.java:56)
        at io.smallrye.common.expression.Expression.evaluate(Expression.java:70)
        at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:59)
        at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:38)
        at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
        at io.smallrye.config.FallbackConfigSourceInterceptor.getValue(FallbackConfigSourceInterceptor.java:24)
        at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
        at io.smallrye.config.PropertyNamesConfigSourceInterceptor.getValue(PropertyNamesConfigSourceInterceptor.java:17)
        at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
        at io.smallrye.config.SmallRyeConfig.getConfigValue(SmallRyeConfig.java:323)
        at io.smallrye.config.SmallRyeConfig.getValue(SmallRyeConfig.java:230)
        at io.quarkus.deployment.configuration.BuildTimeConfigurationReader$ReadOperation.readConfigValue(BuildTimeConfigurationReader.java:779)
        ... 17 more
geoand commented 1 year ago

The snippet above works just fine for me

Dieken commented 1 year ago

This is caused by bad maven mirror, the mirror returns wrong HTML content instead of Java properties:

Example:

https://repo.huaweicloud.com/repository/maven/io/quarkus/platform/quarkus-bom-quarkus-platform-properties/2.15.3.Final/quarkus-bom-quarkus-platform-properties-2.15.3.Final.properties

geoand commented 1 year ago

Interesting. I don't think we can do anything on our side, WDYT @aloubyansky @maxandersen ?

aloubyansky commented 1 year ago

It doesn't match the content we published. It should be reported to the organization maintaining the mirror you are using.

Dieken commented 1 year ago

I guess @zengpeng2018 was bitten by same cause, this issue can be closed.

I already reported the issue to Huawei cloud, not sure when they will fix that.

gastaldi commented 1 year ago

I wonder if building with mvn -C (mvn --strict-checksums) would help in this case?

aloubyansky commented 1 year ago

quarkus.native.builder-image could also be added to the application configuration as a workaround.

aloubyansky commented 1 year ago

But the fact that the mirror is offering corrupted content is concerning.

DipRabadiya commented 5 months ago

Listening for transport dt_socket at address: 5005 2024-05-09 16:22:49,709 INFO [io.qua.dep.dev.IsolatedDevModeMain] (main) Attempting to start live reload endpoint to recover from previous Quarkus startup failure 2024-05-09 16:22:50,485 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.ChainBuildException: Multiple producers of item class io.quarkus.security.spi.DefaultSecurityCheckBuildItem (io.quarkus.resteasy.reactive.common.deployment.ResteasyReactiveCommonProcessor#setUpDenyAllJaxRs)
at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:337) at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:254) at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:60) at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:112) at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:433) at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:55) at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:138) at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:93) at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:131) at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:62) Caused by: io.quarkus.builder.ChainBuildException: Multiple producers of item class io.quarkus.security.spi.DefaultSecurityCheckBuildItem (io.quarkus.resteasy.reactive.common.deployment.ResteasyReactiveCommonProcessor#setUpDenyAllJaxRs) Caused by: java.lang.Throwable: This is the location of the conflicting producer (io.quarkus.resteasy.deployment.ResteasyBuiltinsProcessor#setUpDenyAllJaxRs). Use -Dquarkus.builder.log-conflict-cause=true to see the full stacktrace. Anyone solve