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

Keycloak timeout with latest Quarkus version #49

Closed
szape89 opened this issue Aug 1, 2024 · 5 comments
Closed

Keycloak timeout with latest Quarkus version #49

szape89 opened this issue Aug 1, 2024 · 5 comments
Assignees
Labels
component/runtime Runtime behavior of dev service kind/question Further information is requested

Comments

@szape89
Copy link

szape89 commented Aug 1, 2024

Describe the bug

Since the latest Quarkus version I get a Keycloak timeout when running tests.

I tested the following versions:

  • Quarkus 3.12.3 + Microcks 0.2.6 = works
  • Quarkus 3.13.0 + Microcks 0.2.6 = error
  • Quarkus 3.13.0 + Microcks 0.1.3 = works

Expected behavior

No error.

Actual behavior

[ERROR] Test.test » Runtime java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors [error]: Build step io.quarkus.oidc.deployment.devservices.keycloak.KeycloakDevServicesProcessor#startKeycloakContainer threw an exception: java.lang.RuntimeException: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image quay.io/keycloak/keycloak:25.0.0 at io.quarkus.oidc.deployment.devservices.keycloak.KeycloakDevServicesProcessor.startKeycloakContainer(KeycloakDevServicesProcessor.java:250) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849) 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:1583) at org.jboss.threads.JBossThread.run(JBossThread.java:483) Caused by: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image quay.io/keycloak/keycloak:25.0.0 at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:359) at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:330) at io.quarkus.oidc.deployment.devservices.keycloak.KeycloakDevServicesProcessor.lambda$startContainer$4(KeycloakDevServicesProcessor.java:377) at java.base/java.util.Optional.orElseGet(Optional.java:364) at io.quarkus.oidc.deployment.devservices.keycloak.KeycloakDevServicesProcessor.startContainer(KeycloakDevServicesProcessor.java:402) at io.quarkus.oidc.deployment.devservices.keycloak.KeycloakDevServicesProcessor.startKeycloakContainer(KeycloakDevServicesProcessor.java:198) ... 10 more Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88) at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:344) ... 15 more Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:563) at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:354) at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81) ... 16 more Caused by: java.lang.IllegalStateException: Wait strategy failed. Container exited with code 2 at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:533) ... 18 more Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '.*Keycloak.*started.*' at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47) at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52) at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:909) at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:500) ... 18 more

How to Reproduce?

Use Quarkus 3.13.0 + Microcks 0.2.6

Microcks version or git rev

0.2.6

Install method (docker-compose, helm chart, operator, docker-desktop extension,...)

mvn package

Additional information

No response

Copy link

github-actions bot commented Aug 1, 2024

👋 @szape89

Welcome to the Microcks community! 💖

Thanks and congrats 🎉 for opening your first issue here! Be sure to follow the issue template or please update it accordingly.

📢 If you're using Microcks in your organization, please add your company name to this list. 🙏 It really helps the project to gain momentum and credibility. It's a small contribution back to the project with a big impact.

If you need to know why and how to add yourself to the list, please read the blog post "Join the Microcks Adopters list and Empower the vibrant open source Community 🙌"

Hope you have a great time there!

🌟 ~~~~~~~~~ 🌟

📢 If you like Microcks, please ⭐ star ⭐ our repo to support it!

🙏 It really helps the project to gain momentum and credibility. It's a small contribution back to the project with a big impact.

@lbroudoux lbroudoux added kind/question Further information is requested component/runtime Runtime behavior of dev service labels Aug 2, 2024
@lbroudoux
Copy link
Member

Hello, looks like it is related to #48.

#48 explicit the error messages when running with Keycloak 24.0.4 and this one explains what happens when running with Keycloak 25.0.0. Errors are slightly different but the fix is the same: tuning the network on which the container is made available.

For the record, Keycloak 25.0.0 container fails starting with this error in the container logs:

2024-08-02 08:08:39 Changes detected in configuration. Updating the server image.
2024-08-02 08:08:39 Updating the configuration and installing your custom providers, if any. Please wait.
2024-08-02 08:09:02 2024-08-02 06:09:02,540 INFO  [io.qua.dep.QuarkusAugmentor] (main) Quarkus augmentation completed in 20199ms
2024-08-02 08:09:02 Server configuration updated and persisted. Run the following command to review the configuration:
2024-08-02 08:09:02 
2024-08-02 08:09:02     kc.sh show-config
2024-08-02 08:09:02 
2024-08-02 08:09:02 Next time you run the server, just run:
2024-08-02 08:09:02 
2024-08-02 08:09:02     kc.sh start --http-enabled=true --hostname-strict=false --spi-user-profile-declarative-user-profile-config-file=/opt/keycloak/upconfig.json --hostname-port=61848 --optimized
2024-08-02 08:09:02 
2024-08-02 08:09:03 Disabled option: '--hostname-port'. Available only when hostname:v1 feature is enabled
2024-08-02 08:09:03 Possible solutions: --hostname, --hostname-admin, --hostname-backchannel-dynamic, --hostname-strict, --hostname-debug
2024-08-02 08:09:03 Try 'kc.sh start --help' for more information on the available options.
2024-08-02 08:09:03 Specify '--help-all' to obtain information on all options and their availability.

@lbroudoux
Copy link
Member

A fix in Quarkus has been submitted here: quarkusio/quarkus#42288

@lbroudoux
Copy link
Member

PR has now been merged. We have to wait for the next Quarkus release. Keeping this open in the mean time.

@szape89
Copy link
Author

szape89 commented Aug 8, 2024

Latest 3.13.1 version of Quarkus containing the bugfix resolves the reported issue. Thank you!

@szape89 szape89 closed this as completed Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/runtime Runtime behavior of dev service kind/question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants