-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Container marked as initialized before admin password is populated #133
Comments
Thanks for reporting the issue. |
I have filled a request in Keycloak repo asking for a (semi) official implementation for what you described. |
@ZIRAKrezovic Pls. try #136 - this should solve the issue. |
Hi, it looks like it may fix the issue for the described use-case. But I may have seen some times where the log message for dev mode is logged before admin user is created - again quite hard to reproduce. |
The last solution I'll try if this one fails will be to ship a pre-initialized H2 database with admin user and mount it as a file - but then again this is out of scope of this project. |
TBH, I haven't seen this ever. 🤷♂️ |
1 similar comment
TBH, I haven't seen this ever. 🤷♂️ |
We had the same problem and this waiting strategy fixed that, thanks 👍 |
And to debunk myself, I have started 10 keycloak containers on the same machine and all 10 of them were initialized correctly - with the log message about dev mode being last
Thanks for the promt fix @dasniko. |
Describe the bug
I have a problem where container is marked as ready and KeycloakClient starts calling it before admin user has been created.
This is quite random and (probably) depends on system load. The current probe looks for HTTP port, which becomes available before the admin is initialized, resulting in 401 when calling any ADMIN API.
Version
3.3.0
Expected behavior
I would like a guarantee that I can use admin user immediately after "start" command returns.
Actual behavior
5 out of 10 times, calling admin API with provided admin user results in 401 as admin gets created a bit later (several milliseconds to two seconds difference)
How to Reproduce?
A simplest reproducer was to start two Keycloak container instances. I have multiple @SpringBootTest-s in my app, each runs in different Java container so each of them spawns their own Keycloak container. I can try and get a reproducer in plain java if you need it.
Relevant log output
Anything else?
No response
The text was updated successfully, but these errors were encountered: