quarkusio / quarkus

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

Unrecognized configuration key set by DevServices #32591

Closed phillip-kruger closed 1 year ago

phillip-kruger commented 1 year ago

Describe the bug

When starting a application that use the postgress jdbc dev services and an empty application.properties, this warning is printed in the startup log:

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

Expected behavior

Dev Services should not set Unrecognized configuration keys or at least not show the warning

Actual behavior

User are warned about something they can not do anything about

How to Reproduce?

Reproducer: https://github.com/phillip-kruger/devui-example

1) clone the about repo and start the app, you should see the warning in the log

Output of uname -a or ver

Linux pkruger-laptop 6.2.9-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 30 22:31:57 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

OpenJDK 64-Bit Server VM (Red_Hat-17.0.6.0.10-1.fc37) (build 17.0.6+10, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

999-SNAPSHOT

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

Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)

Additional information

As discussed here: https://github.com/quarkusio/quarkus/pull/32563#issuecomment-1505174872

quarkus-bot[bot] commented 1 year ago

/cc @geoand (devservices), @stuartwdouglas (devservices)

phillip-kruger commented 1 year ago

/cc @radcortez , @gsmet

gsmet commented 1 year ago

@radcortez could you have a look at that one? It concerns me a bit.

radcortez commented 1 year ago

Sure

radcortez commented 1 year ago

The issue hero is that quarkus.datasource.jdbc.url is read by the Agroal extension, which is not present in app dependencies, so we get the unknown warning.

The DevServices extension does set that property because you need it for the datasource, but because we don't have one here, we don't have the Agroal extension. With that said, we need to discuss how to handle this case:

gsmet commented 1 year ago

Maybe we should just avoid adding the property if Agroal is not around. I'll have a look if it's easy to do next week.

radcortez commented 1 year ago

It's fine. I can do it.

For reference the property is set here: https://github.com/quarkusio/quarkus/blob/00625d048d12ffa90b94061b19df6043e6467d8c/extensions/datasource/deployment/src/main/java/io/quarkus/datasource/deployment/devservices/DevServicesDatasourceProcessor.java#L315-L319