terrakube: ConnectTimeoutException When proxy is used

Bug description 🐞

When a proxy is being used, via JAVA_TOOL_OPTIONS environment variables in a docker-compose environment, I noticed that when VCS integration is made, the following error occurs. It cannot connect terrakube to github:

terrakube-api         | 2024-05-31 06:51:14.979  INFO 1 --- [io-8080-exec-10] o.t.a.p.v.controller.CallbackController  : Updating connection for vcs cb46a180-1f16-11ef-b70e-953d9b79f8aa
terrakube-api         | 2024-05-31 06:51:15.034  INFO 1 --- [io-8080-exec-10] o.terrakube.api.plugin.vcs.TokenService  : VCS found with custom callback
terrakube-api         | 2024-05-31 06:51:46.127 ERROR 1 --- [io-8080-exec-10] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.reactive.function.client.WebClientRequestException: connection timed out: github.com/140.82.121.3:443; nested exception is io.netty.channel.ConnectTimeoutException: connection timed out: github.com/140.82.121.3:443] with root cause
terrakube-api         | 
terrakube-api         | io.netty.channel.ConnectTimeoutException: connection timed out: github.com/x.x.x.x:443
terrakube-api         |         at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$2.run(AbstractEpollChannel.java:613) ~[netty-transport-classes-epoll-4.1.101.Final.jar:4.1.101.Final]
terrakube-api         |         at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98) ~[netty-common-4.1.101.Final.jar:4.1.101.Final]
terrakube-api         |         at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153) ~[netty-common-4.1.101.Final.jar:4.1.101.Final]
terrakube-api         |         at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173) ~[netty-common-4.1.101.Final.jar:4.1.101.Final]
terrakube-api         |         at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166) ~[netty-common-4.1.101.Final.jar:4.1.101.Final]
terrakube-api         |         at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.101.Final.jar:4.1.101.Final]
terrakube-api         |         at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:416) ~[netty-transport-classes-epoll-4.1.101.Final.jar:4.1.101.Final]
terrakube-api         |         at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.101.Final.jar:4.1.101.Final]
terrakube-api         |         at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.101.Final.jar:4.1.101.Final]
terrakube-api         |         at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.101.Final.jar:4.1.101.Final]
terrakube-api         |         at java.base/java.lang.Thread.run(Unknown Source) ~[na:na

Steps to reproduce

Deploy application without internet access and configure proxy. Other functionalities seems working, as respects the configuration to use proxy. From the vm the code is deployed I verified that github.com is reachable through the proxy.

Expected behavior

NIO requests should also use the proxy service.

Example repository

No response

Anything else?

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

I merged the changes, this feature can be tested using the following version.

2.24.0-beta.1

Feel free to leave any comment or suggestion testing that version

Use the latest image please 2.23.2, I will merge https://github.com/AzBuilder/terrakube/pull/931 once I fix the conflicts, I guess the proxy image has another bugs that we fixed in later versions.

Ok! It’s working in the proxy-fix version. The issue was related with the no_proxy variable without the terrakube-* hosts πŸ˜ƒ