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
NoSuchFileException with ${kc.home.dir} on Windows #23217
Comments
@Pepo48 Can you please look into this when you get a chance? |
We're also experiencing this since Keycloak 22.0.3. It used to work in Keycloak 22.0.1 |
Hello everyone, first of all, thanks for the reports. Jfyi, I can confirm that issue first appeared in 22.0.2. |
* added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
I narrowed the problem to this PR/commit. The changes made there suggest that this may be a bug on a Quarkus/SmallRye side (most likely in VertxHttpRecorder.java in quarkus.vertx.http.runtime, according to my brief investigation), since what Keycloak does is that it just consumes (newer) There is already a follow up #21871 to allow to process multiple certificates/keys at once (just to be on a par Quarkus's behaviour). What we could do at this point is to provide an additional validation, like I similarly did with Keycloak Keystore path/password properties for a similar reason. I'll send a PR with the proposed in a minute. |
* added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
* added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
* added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
* added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
* added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
* added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
* added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
* added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
* added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
* added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
* NoSuchFileException with ${kc.home.dir} on Windows * added a path validation for https cert and key files in HttpPropertyMappers Closes #23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> * NoSuchFileException with ${kc.home.dir} on Windows * added a path validation for https cert and key files in HttpPropertyMappers Closes #23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> * NoSuchFileException with ${kc.home.dir} on Windows * added a path validation for https cert and key files in HttpPropertyMappers Closes #23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> --------- Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
* NoSuchFileException with ${kc.home.dir} on Windows * added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> * NoSuchFileException with ${kc.home.dir} on Windows * added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> * NoSuchFileException with ${kc.home.dir} on Windows * added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> --------- Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
* NoSuchFileException with ${kc.home.dir} on Windows * added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> * NoSuchFileException with ${kc.home.dir} on Windows * added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> * NoSuchFileException with ${kc.home.dir} on Windows * added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> --------- Signed-off-by: Peter Zaoral <pzaoral@redhat.com> Signed-off-by: Kamontat Chantrachirathumrong <14089557+kamontat@users.noreply.github.com>
* NoSuchFileException with ${kc.home.dir} on Windows * added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> * NoSuchFileException with ${kc.home.dir} on Windows * added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> * NoSuchFileException with ${kc.home.dir} on Windows * added a path validation for https cert and key files in HttpPropertyMappers Closes keycloak#23217 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> --------- Signed-off-by: Peter Zaoral <pzaoral@redhat.com> Signed-off-by: ShefeeqPM <86718986+ShefeeqPM@users.noreply.github.com>
Before reporting an issue
Area
dist/quarkus
Describe the bug
Under Windows, I use
keycloak.config
withThis works in v21 but no longer in v22.
When with
kc.bat --verbose start
I get sth likeWhen I replace the config path with an absolute path containing only / then it works.
E.g.
D:/Dir1/Dir2/Dir3/cert/cert.pem
.Version
22.0.3
Expected behavior
The old configuration should work as it did till v21.
Actual behavior
I get a NoSuchFileException instead. Except when I use the workaround: absolute paths with \ replaced by /.
I think,
${kc.home.dir}
may return\
separators and this doesn't seem to work with the file load logic.Either that logic has changed or the
${kc.home.dir}
did use/
in the past instead of\
.How to Reproduce?
Use Windows and try a https-certificate-file configuration similar to mine, containing
${kc.home.dir}
.Anything else?
It may be similar like #17413.
The text was updated successfully, but these errors were encountered: