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

Warning log "Unrecognized configuration key" on native build occurs for known properties #29660

Closed
joggeli34 opened this issue Dec 3, 2022 · 6 comments · Fixed by #29778
Closed
Assignees
Labels
area/config kind/bug Something isn't working
Milestone

Comments

@joggeli34
Copy link
Contributor

joggeli34 commented Dec 3, 2022

Describe the bug

When starting a native-build quarkus application we get some of the following warnings:

Unrecognized configuration key "yyy.images.duration" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo

The mentioned properties are used in the application with @ConfigProperty or in an interface with @ConfigMapping.
The properties are also read correctly and applied as configured. So it is more about the warning-logging that is wrong.

I tried to create a reproducer, but there it works without a problem, so I currently have no clue when this happen and when not.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

Java 17.0.5

GraalVM version (if different from Java)

Mandrel 22.3.0

Quarkus version or git rev

2.14.2.Final

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

No response

Additional information

No response

@joggeli34 joggeli34 added the kind/bug Something isn't working label Dec 3, 2022
@gsmet
Copy link
Member

gsmet commented Dec 5, 2022

Could you provide a simple reproducer? Thanks!

@gsmet gsmet added the triage/needs-reproducer We are waiting for a reproducer. label Dec 5, 2022
@joggeli34
Copy link
Contributor Author

I tried to create a reproducer, but there it works without a problem, so I currently have no clue when this happen and when not.
I will give it another try tomorrow, perhapse I find a dependency or something that causes the problem.

@joggeli34
Copy link
Contributor Author

After some testing I found out following:

We are having a custom extension which has a configuration like this:

@ConfigRoot(prefix = "yyy", name = "mqtt.connection", phase = ConfigPhase.RUN_TIME)
public class MqttConnectionConfiguration {
    @ConfigItem(name = "url")
    public String brokerUrl;
}

The yyy here stands for our company name, so we have also additional configuration in the projects directly starting with yyy like in the example from this issue:

yyy.images.duration=2s

The above warning is shown for all properties starting with yyy inside the properties. The warning appears at the start of a native application and during the build process of the jar.

So it seems that we can't have properties starting with the same name as the prefix in a dependent extension. This makes perfect sense for the default "quarkus"-prefix, but I'm not sure if this should also be checked for other prefixes?

If this is works as designed, we can close the issue (probably add a doc somewhere?).

@joggeli34
Copy link
Contributor Author

Related to: #9791 (comment)

@gsmet
Copy link
Member

gsmet commented Dec 6, 2022

@radcortez not sure if you have all the relevant information for this one but it's probably best if you ask for additional info yourself.

@radcortez
Copy link
Member

I'll have a look.

@radcortez radcortez self-assigned this Dec 7, 2022
@radcortez radcortez removed the triage/needs-reproducer We are waiting for a reproducer. label Dec 7, 2022
@quarkus-bot quarkus-bot bot added this to the 2.17 - main milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants