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

Unrecognized configuration key set by DevServices #32591

Closed
phillip-kruger opened this issue Apr 12, 2023 · 7 comments · Fixed by #32723
Closed

Unrecognized configuration key set by DevServices #32591

phillip-kruger opened this issue Apr 12, 2023 · 7 comments · Fixed by #32723
Assignees
Labels
area/devservices kind/bug Something isn't working
Milestone

Comments

@phillip-kruger
Copy link
Member

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: #32563 (comment)

@phillip-kruger phillip-kruger added the kind/bug Something isn't working label Apr 12, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Apr 12, 2023

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

@phillip-kruger
Copy link
Member Author

/cc @radcortez , @gsmet

@gsmet
Copy link
Member

gsmet commented Apr 13, 2023

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

@radcortez
Copy link
Member

Sure

@radcortez
Copy link
Member

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:

  • We leave it as is; The warning is correct, but it isn't very clear because the user didn't set the property.

  • Should we start the DB DevService without Agroal? In theory, the user is not going to be able to do anything with the database and Quarkus, but I wouldn't like to limit it because there may be some use cases that we are not aware. Also, if you try to inject a Datasource, you get a Unsatisfied dependency coming from Arc.

  • Should we ignore warnings from properties set by Quarkus? While attractive, not sure if I like this either. Maybe, we need to gather additional information and detail why a property was set by us, so we can output that into warnings. I guess it would also be interesting to tell the user which extension to add in case of unknown properties.

@gsmet
Copy link
Member

gsmet commented Apr 13, 2023

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.

@gsmet gsmet self-assigned this Apr 13, 2023
@radcortez
Copy link
Member

It's fine. I can do it.

For reference the property is set here:

Map<String, String> devDebProperties = new HashMap<>();
for (DevServicesDatasourceConfigurationHandlerBuildItem devDbConfigurationHandlerBuildItem : configHandlers) {
devDebProperties.putAll(devDbConfigurationHandlerBuildItem.getConfigProviderFunction()
.apply(dbName, datasource));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devservices kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants