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

Setting Quarkus datasource db-kind configuration property by environment variable results in unrecognized configuration key warning #32943

Closed
mzuber opened this issue Apr 27, 2023 · 5 comments
Labels
area/config triage/invalid This doesn't seem right

Comments

@mzuber
Copy link
Contributor

mzuber commented Apr 27, 2023

Describe the bug

Setting the quarkus.datasource.db-kind configuration property via the environment variable QUARKUS_DATASOURCE_DB_KIND as described in the configuration reference results in the following warning at application start up:

2023-04-27 10:49:40,033 WARN  [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "quarkus.datasource.db.kind" 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

No warning message is shown.

Actual behavior

Quarkus works fine, but the above warning message is shown.

How to Reproduce?

Set the quarkus.datasource.db-kind configuration property via the environment variable QUARKUS_DATASOURCE_DB_KIND.

GraalVM version (if different from Java)

GraalVM CE 22.3.1 (build 17.0.6+10-jvmci-22.3-b13)

Quarkus version or git rev

3.0.1.Final

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

Gradle 8.1.1

@mzuber mzuber added the kind/bug Something isn't working label Apr 27, 2023
@mzuber
Copy link
Contributor Author

mzuber commented Apr 27, 2023

Not sure if this is somehow related to #17818.

@geoand
Copy link
Contributor

geoand commented Apr 27, 2023

When are you setting this property?

I am asking because the property is a build time property, meaning that you cannot change it at runtime.

@geoand geoand added the triage/needs-feedback We are waiting for feedback. label Apr 27, 2023
@mzuber
Copy link
Contributor Author

mzuber commented Apr 27, 2023

When are you setting this property?

I am asking because the property is a build time property, meaning that you cannot change it at runtime.

Good point. I'm setting the property before application startup via a local .env file. Interestingly, I didn't had the warning with Quarkus 2.16.

@geoand
Copy link
Contributor

geoand commented Apr 27, 2023

cc @radcortez

@geoand geoand removed the triage/needs-feedback We are waiting for feedback. label Apr 27, 2023
@radcortez
Copy link
Member

You cannot set QUARKUS_DATASOURCE_DB_KIND alone, because of the conversion rules for environment variables. This gets mapped to quarkus.datasource.db.kind (notice the dot instead of the dash in db.kind). When you set a single property like that, we cannot know if separators are dots or dashes.

You must set a quarkus.datasource.db-kind in application.properties (or any other source). This will provide us with some extra information to match what is expected. The value can be empty or something else, since env will override it; we need the property name; for more information check:

https://quarkus.io/guides/config-reference#environment-variables

@radcortez radcortez closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2023
@radcortez radcortez added triage/invalid This doesn't seem right and removed kind/bug Something isn't working labels Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config triage/invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants