How to resolve connection refused error between API and Keycloak containers

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.

New contributor

Caua 2312 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật