I’m creating a quarkus api with postgres and Keycloak and uploading it to containers.
I am first uploading the keycloak and postgres containers, after uploading I configure keycloak to authenticate my Api endpoints and then I enter the OIDC settings in my application.properties file and upload the application container.
The application container goes up but does not connect with the keycloak and returns the following:
2024-05-16 11:16:02 __ __ __ __ __ __ ____ ______
2024-05-16 11:16:02 –/ __ / / / / _ | / _ / //_/ / / / __/
2024-05-16 11:16:02 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /
2024-05-16 11:16:02 –_____/_/ |_/_/|_/_/|_|__/__/
2024-05-16 11:16:02 2024-05-16 14:16:02,212 WARN [io.qua.oid.com.run.OidcCommonUtils] (vert.x-eventloop-thread-1) OIDC Server is not available:: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:8180
2024-05-16 11:16:02 Caused by: java.net.ConnectException: Connection refused
2024-05-16 11:16:02 at java.base/sun.nio.ch.Net.pollConnect(Native Method)
2024-05-16 11:16:02 at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
2024-05-16 11:16:02 at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:946)
2024-05-16 11:16:02 at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:337)
2024-05-16 11:16:02 at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:339)
2024-05-16 11:16:02 at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776)
2024-05-16 11:16:02 at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
2024-05-16 11:16:02 at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
2024-05-16 11:16:02 at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
2024-05-16 11:16:02 at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
2024-05-16 11:16:02 at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
2024-05-16 11:16:02 at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
2024-05-16 11:16:02 at java.base/java.lang.Thread.run(Thread.java:840)
2024-05-16 11:16:02
2024-05-16 11:16:02 2024-05-16 14:16:02,217 WARN [io.qua.oid.run.OidcRecorder] (vert.x-eventloop-thread-1) OIDC server is not available at the ‘http://localhost:8180/auth/realms/quarkus’ URL. Please make sure it is correct. Note it has to end with a realm value if you work with Keycloak, for example: ‘https://localhost:8180/auth/realms/quarkus’
2024-05-16 11:16:02 2024-05-16 14:16:02,219 WARN [io.qua.oid.run.OidcRecorder] (vert.x-eventloop-thread-1) Tenant ‘Default’: ‘OIDC Server is not available’. OIDC server is not available yet, an attempt to connect will be made during the first request. Access to resources protected by this tenant may fail if OIDC server will not become available
2024-05-16 11:16:03 2024-05-16 14:16:03,343 INFO [io.quarkus] (main) api-zathura-web 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.9.2) started in 2.419s. Listening on: http://0.0.0.0:8080
2024-05-16 11:16:03 2024-05-16 14:16:03,343 INFO [io.quarkus] (main) Profile prod activated.
2024-05-16 11:16:03 2024-05-16 14:16:03,343 INFO [io.quarkus] (main) Installed features: [agroal, cdi, hibernate-orm, hibernate-orm-panache, jdbc-postgresql, keycloak-authorization, narayana-jta, oidc, rest, rest-jackson, security, smallrye-context-propagation, smallrye-openapi, swagger-ui, vertx]
2024-05-16 11:16:00 INFO exec -a “java” java -XX:MaxRAMPercentage=80.0 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:+ExitOnOutOfMemoryError -Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -cp “.” -jar /deployments/quarkus-run.jar
2024-05-16 11:16:00 INFO running in /deployments
I tried to upload the containers with Docker Compose all together, separately, I tried to configure the OIDC in another way but without success.
Caua 2312 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.