KeyCloak can not open Admin-Web-UI with the new V2 Runtime

obstkompostPRO

10 months ago

Hello everyone,

When I updated the runtime of my KeyCloak instance to the new Runtime V2, I noticed that I could no longer access the Admin Web UI. It gets stuck at the loading circle "Loading the Admin UI". I didn't notice anything suspicious in the KeyCloak logs.

In the network console you can see that a call is leading to a 403.
(I don't know how this could be related to the runtime)

The user management UI doesn't work either (where users can manage their own information)

I get a message saying "failed to initialize keycloak"

(You can also see the 403 here in the network console)

My Dockerfile uses the same multi-run logic as here:

https://github.com/leonardochappuis/keycloak-docker/blob/master/Dockerfile

I hope someone knows what the cause is, because in the future
the V2 runtime is set.

Thanks in advance for your time

0 Replies

obstkompostPRO

10 months ago

f751037a-ba7a-42ab-8a24-90e99fcd12d3


obstkompostPRO

10 months ago

I have now updated KeyCloak to the latest version, namely version 25.0.1.

Now I get a different error message:
"HTTPS required"
The logs say:
error="ssl_required"

This error only appears in the V2 runtime.
Has anything changed regarding SSL processing in the V2 runtime?


10 months ago

interesting, I will look into it later today


obstkompostPRO

10 months ago

To clarify this :
I get the error described here (ssl_required)
when I open the standard login form for end users.
Basically, you can say that various things do not work under the V2 runtime, even with different KeyCloak versions.


obstkompostPRO

10 months ago

The new edge Proxy-Feature also did not make a difference


obstkompostPRO

10 months ago

i think, i found the solution. I will test it a little more and post it than here


obstkompostPRO

10 months ago

OK, I've now made a small step forward:
If I set the KeyCloak parameter "Proxy Headers" to "forwarded" and no longer to "xforwarded" then at least the login page is displayed correctly again.
The login still doesn't work and I can't access the admin UI either.

Does the new runtime use new proxy headers?


obstkompostPRO

10 months ago

Another new finding:
When redirecting from KeyCloak to my application,
the KeyCloak server is specified in the "iss" parameter in the URL.
The legacy runtime uses https.
The V2 runtime uses http.
This reinforces my suspicion that
the behavior regarding the forward headers has changed


obstkompostPRO

10 months ago

It worked here:

1254380750552432600


10 months ago

the runtime and the edge proxy are separate systems, the runtime would have nothing to do with headers


obstkompostPRO

10 months ago

OK, then the behavior surprises me even more.
I'll try to get the Caddy proxy to log the incoming HTTP headers to check
whether the forwarded headers change in any way


10 months ago

there is no longer a need for the caddy proxy, can you please try deploying this pr


obstkompostPRO

10 months ago

Nice, i will give it a try and post the results here


10 months ago

for what it's worth, I was able to reproduce the issue you described with a fresh template deploy, but I got it to work and was able to login after making the changes that I submitted in that PR


obstkompostPRO

10 months ago

That's good to hear (:
I'm curious what causes these errors in the new runtime, but it's not worth going into the analysis if the PR fixes the problem


10 months ago

not sure the runtime is at fault here, we can't jump to such conclusions


10 months ago

jumping to conclusions like that has bit me in the past


obstkompostPRO

10 months ago

It works now! Thanks for your support Brody!
Bought you some coffees ☕


10 months ago

thank you very much! I appreciate that


obstkompostPRO

10 months ago

how can i mark your answer as the solution?


10 months ago

only mods/admins can


obstkompostPRO

10 months ago

ahh, that explains it (:


10 months ago

update, my pr was merged and the template was updated!


furkankurt1HOBBY

7 months ago

Hello. I did not understand what was I supposed to do but just deployed this app I am not able to display the login page for some reason. It just tries to open and then giving this screen:

1294758233935843300


furkankurt1HOBBY

7 months ago

1294758766448869400


furkankurt1HOBBY

7 months ago

1294758849651282000


furkankurt1HOBBY

7 months ago

What is the problem you think? Thank you in advance!


7 months ago

change KC_HOSTNAME="${{RAILWAY_PUBLIC_DOMAIN}}" to KC_HOSTNAME="[https://${{RAILWAY_PUBLIC_DOMAIN](https://${{RAILWAY_PUBLIC_DOMAIN)}}"


7 months ago

@Collectors Comet - can you update this on the template for future users?


furkankurt1HOBBY

7 months ago

Thank you!


obstkompostPRO

6 months ago

Hello Brody,
I have created a pull request here, which should hopefully make the template useable again.
https://github.com/leonardochappuis/keycloak-docker/pull/5
In the future it would probably be good if someone updated the template who also uses the template itself.


obstkompostPRO

6 months ago

I have added a new parameter “KCPROXYHEADERS” to the pull request.
Does it have to be included here in the line so that it works:https://github.com/leonardochappuis/keycloak-docker/blob/master/Dockerfile#L3 ?


6 months ago

not sure, but it can't hurt


KeyCloak can not open Admin-Web-UI with the new V2 Runtime - Railway Help Station