-
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 CLI finds and uses rogue application.properties files and crashes #19549
Comments
/cc @ebullient, @maxandersen, @quarkusio/devtools |
we'll have to mock around with the config sources and their levels. No idea if feasible but if we could just have it ignore application.properties and just use quarkus-cli.properties (or similar) instead and there wouldn't be conflicts. |
Ideally, we need to skip the registration of such sources. We could probably find some clever way to ignore the values coming from the sources, but the case where you have a non-readable file will always crash the application. I believe we have two options:
Also, what about dependencies that may have required configuration in |
+100 on skipping registration. That is by far the cleanest. build time reading of application.properties is fine. It is specifically runtime processing of said sources that should be disable-able. So if that means that there is the ability to (later in the build) remove those config sources (to avoid a chicken/egg problem), that would work. |
From what I can tell, on the CLI code, we don't have many options to influence how Quarkus is going to behave, because it just calls I guess that one easy option is to add a build-time configuration property that can be used by the CLI module and allows you to control how these sources are registered. |
Not completely fixed yet. #20385 add a way to be able to fix it. @ebullient will take care of the rest :) |
looking at #20385 why is this connected to picocli in any shape or form ? @ebullient @radcortez ? One should be able to configure/set this up for any kind of Quarkus no matter if you use picocli or not ...maybe the code can do that but just seeing that the commit adds config build steps to picocli extension which to me sounds very wrong? |
If you feel strongly that it applies more generally, fine, but IMO, the picocli extension is the most likely to need this out of the gate (where it might not be as common elsewhere). I don't see a problem with it (nor do I see it as very wrong), but I don't have a problem with it being generalized either. |
Picocli is not necessary to use @quarkusmain so seems like it should be possible without being tied to picocli imo. |
We discussed in the PR to provide a way to register the specific builders to customize how the Config is used. I can add the support for it in a separate PR. |
Where are we on this? It's marked for 2.6 but I don't see it fully fixed, right? |
No, I thought @ebullient was going to do it. @ebullient do you want me to do it? |
I have hands/brain tied up.. if you can, yes! |
No worries, I'll pick this up. |
Describe the bug
I recently installed the Quarkus CLI and upon first execution of
quarkus version
it spit out tons of warnings and I had no idea why (I was not in any project directory, rather was in my home directory where I never put projects). Turns out I had a rogueapplication.properties
in the directory (with no other project-related files) and it loaded and parsed it as part of the CLI runtime.If that file is a binary (e.g. by renaming a .zip file to
application.properties
) then Quarkus CLI crashes.Expected behavior
No warnings on first execution, in a directory with no project.
Actual behavior
With a valid properties file:
With a binary named
application.properties
:How to Reproduce?
application.properties
curl -Ls https://sh.jbang.dev | bash -s - app install --fresh --force quarkus@quarkusio
quarkus version
Output of
uname -a
orver
Darwin jfalkner-OSX 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64
Output of
java -version
GraalVM version (if different from Java)
N/A
Quarkus version or git rev
Client Version 2.1.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Quarkus CLI
Additional information
I'm concerned it may be possible to do something nasty with a cleverly-designed
application.properties
.The text was updated successfully, but these errors were encountered: