Skip to content
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

Downgrade Keycloak to 23.0.7 #2025

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

johnaohara
Copy link
Member

@johnaohara johnaohara commented Sep 24, 2024

Keycloak version was incompatible with services running SSO

Fixes Issue

Fixes: #2061

Changes proposed

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@johnaohara johnaohara self-assigned this Sep 24, 2024
@johnaohara johnaohara added branch/stable The stable branch priority/high High priority area/dependency Dependency Upgrade backport labels Sep 24, 2024
Copy link
Member

@lampajr lampajr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @johnaohara, I am not 100% sure but I think that we are still bringing 25.0.2 version for keycloak (in some places):


[INFO] \- io.quarkus:quarkus-keycloak-admin-resteasy-client:jar:3.14.4:compile
....
[INFO]    +- org.keycloak:keycloak-admin-client:jar:25.0.2:compile

That might be the reason of the failure we see here.

@johnaohara
Copy link
Member Author

@lampajr it's a mess after we upgraded quarkus :(

@johnaohara
Copy link
Member Author

either we need to remove the dependency on quarkus-keycloak-admin-resteasy-client or only use Quarkus LTS releases

@lampajr
Copy link
Member

lampajr commented Sep 24, 2024

it's a mess after we upgraded quarkus :(

+1

either we need to remove the dependency on quarkus-keycloak-admin-resteasy-client

I was trying this locally, but even if that works for the test I am not fully sure we won't introduce any bug by forcing quarkus-keycloak-admin-resteasy-client to use an older version of keycloak

only use Quarkus LTS releases

I think this will be something we should start considering..

@lampajr
Copy link
Member

lampajr commented Sep 24, 2024

either we need to remove the dependency on quarkus-keycloak-admin-resteasy-client or only use Quarkus LTS releases

Both options are not so straightforward.. 😓

@johnaohara johnaohara changed the title Downgrade Keycloak to 23.0.3 Downgrade Keycloak to 23.0.7 Oct 4, 2024
Copy link
Member

@lampajr lampajr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @johnaohara,

I tried locally and it looks working when starting from a fresh installation but it looks failing when starting from an existing db backup.

The thrown exception is:

Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Unable to re-configure keycloak instance: jakarta.ws.rs.NotAuthorizedException: HTTP 401 Unauthorized
	at io.hyperfoil.tools.horreum.dev.services.deployment.HorreumDevServicesProcessor.startHorreumContainers(HorreumDevServicesProcessor.java:197)
	at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
	at java.base/java.lang.Thread.run(Thread.java:840)
	at org.jboss.threads.JBossThread.run(JBossThread.java:483)
Caused by: java.lang.RuntimeException: Unable to re-configure keycloak instance: jakarta.ws.rs.NotAuthorizedException: HTTP 401 Unauthorized
	at io.hyperfoil.tools.horreum.infra.common.HorreumResources.startContainers(HorreumResources.java:163)
	at io.hyperfoil.tools.horreum.dev.services.deployment.HorreumDevServicesProcessor.startHorreumContainers(HorreumDevServicesProcessor.java:118)
	... 9 more

which seems expected but I don't get how you imagined the upgrade when a db is already existing 🤔

@johnaohara
Copy link
Member Author

@lampajr i saw this error when re-using a prod backup that had been loaded in dev mode by current main or 0.15 branch. When I tested with a fresh backup it worked without error.

I think the with the current main branch, upgrading to keycloak 0.25.x will have modified the database tables, which are incompatible with 0.23.x, so downgrading keycloak on an already migrated database will break auth.

We need to be able to chose the keycloak version to maintain compatibility with production versions

Copy link
Member

@lampajr lampajr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm then!

@johnaohara johnaohara merged commit 0f1c56b into Hyperfoil:master Oct 4, 2024
3 checks passed
@johnaohara johnaohara deleted the keycloak_downgrade branch October 4, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependency Dependency Upgrade backport branch/stable The stable branch priority/high High priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intrinsic Keycloak dependency
2 participants