-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
quarkus.test.integration-test-profile
ignored in IT startup error message if startup fails because of ConfigValidationException
#36376
Comments
quarkus.test.integration-test-profile
ignored in IT startup error messagequarkus.test.integration-test-profile
ignored in IT startup error message if startup fails because of ConfigValidationException
I see we have a special case for quarkus/core/runtime/src/main/java/io/quarkus/runtime/ApplicationLifecycleManager.java Lines 190 to 200 in 700e37b
Maybe we need something similar for |
Seems reasonable |
@geoand io.smallrye.config.ConfigValidationException is external exception not from quarkus-core, how to catch it within ApplicationLifecycleManager ? |
@dvsingh9 Right. I think you'd have to find some place in the stack trace where you could catch it and wrap it with a
|
Hello @yrodiere I started investigating this issue but couldn't quite reproduce it. Also when I build my custom quarkus-core project changing |
Hey @MaciejDromin , thanks for having a look. I updated the issue description with a reproducer. Note however that #37401 might have fixed the problem already. I'm not entirely sure, one would have to run the reproducer against a build of Quarkus on the |
@yrodiere Thanks for your reply! I was able to test this with the latest code and the issue still occurs. I created PR fixing this, hope it is good enough :) |
Fix smallrye ConfigValidationException not being handled properly at Quarkus startup
Describe the bug
If I set this:
quarkus.test.integration-test-profile=integrationtest
and for some reason my application fails to start in integration tests, during config resolution, the error message looks like this:
... even though the profile prod is NOT active, as evidenced by the command being executed:
Expected behavior
Actual behavior
How to Reproduce?
Just adding something like this to an application should have done the trick:
Assuming the application also includes this:
But here's a full reproducer:
git clone -b i36376 https://github.com/yrodiere/quarkus-playground.git cd quarkus-playground ./mvnw clean verify -Dnative
When build ends (it'll take a while), see how the logs are inconsistent:
The first line shows
-Dquarkus.profile=integrationtest
but the error showswith profile [prod]
.Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
I think this can only be reproduced if the startup failure happens during config resolution. That would make sense, as in that case I suspect
ConfigUtils.getProfiles()
just returns garbage that doesn't take config into account, so this would not behave properly:quarkus/core/runtime/src/main/java/io/quarkus/runtime/ApplicationLifecycleManager.java
Lines 196 to 199 in 700e37b
The text was updated successfully, but these errors were encountered: