eclipse-jkube / jkube

Build and Deploy java applications on Kubernetes
https://www.eclipse.dev/jkube/
Eclipse Public License 2.0
733 stars 480 forks source link

`JibImageBuildServicePushTest` failing intermittently on Eclipse Jenkins #3225

Closed rohanKanojia closed 1 month ago

rohanKanojia commented 1 month ago

Component

JKube Kit

Task description

Description

I'm observing JibImageBuildServicePushTest failing intermittently on CI

[ERROR] Tests run: 6, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.851 s <<< FAILURE! -- in org.eclipse.jkube.kit.config.service.kubernetes.JibImageBuildServicePushTest$ValidMultiplatformConfiguration
[ERROR] org.eclipse.jkube.kit.config.service.kubernetes.JibImageBuildServicePushTest$ValidMultiplatformConfiguration.pushesImage -- Time elapsed: 0.091 s <<< ERROR!
org.eclipse.jkube.kit.config.service.JKubeServiceException: Error when pushing JIB image
    at org.eclipse.jkube.kit.config.service.kubernetes.JibImageBuildService.pushSingleImage(JibImageBuildService.java:86)
    at org.eclipse.jkube.kit.config.service.AbstractImageBuildService.lambda$push$0(AbstractImageBuildService.java:41)
    at org.eclipse.jkube.kit.config.service.AbstractImageBuildService.processImage(AbstractImageBuildService.java:57)
    at org.eclipse.jkube.kit.config.service.AbstractImageBuildService.push(AbstractImageBuildService.java:41)
    at org.eclipse.jkube.kit.config.service.kubernetes.JibImageBuildServicePushTest$ValidMultiplatformConfiguration.pushValidImage(JibImageBuildServicePushTest.java:226)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at java.util.ArrayList.forEach(ArrayList.java:1259)
    at java.util.ArrayList.forEach(ArrayList.java:1259)
    at java.util.ArrayList.forEach(ArrayList.java:1259)
Caused by: org.eclipse.jkube.kit.common.JKubeException: Unable to containerize image using Jib: org.apache.http.conn.HttpHostConnectException: Connect to localhost:43691 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)
    at org.eclipse.jkube.kit.service.jib.JibService.containerize(JibService.java:169)
    at org.eclipse.jkube.kit.service.jib.JibService.push(JibService.java:126)
    at org.eclipse.jkube.kit.config.service.kubernetes.JibImageBuildService.pushSingleImage(JibImageBuildService.java:84)
    ... 8 more
Caused by: java.util.concurrent.ExecutionException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:43691 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)
    at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:594)
    at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:573)
    at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:91)
    at com.google.cloud.tools.jib.builder.steps.StepsRunner.lambda$pushApplicationLayers$13(StepsRunner.java:511)
    at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
    at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:76)
    at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:750)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:43691 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
    at com.google.api.client.http.apache.v2.ApacheHttpRequest.execute(ApacheHttpRequest.java:73)
    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1012)
    at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:349)
    at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:266)
    at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:138)
    at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:114)
    at com.google.cloud.tools.jib.registry.RegistryClient.callRegistryEndpoint(RegistryClient.java:623)
    at com.google.cloud.tools.jib.registry.RegistryClient.doBearerAuth(RegistryClient.java:318)
    at com.google.cloud.tools.jib.registry.RegistryClient.doPushBearerAuth(RegistryClient.java:308)
    at com.google.cloud.tools.jib.builder.steps.AuthenticatePushStep.call(AuthenticatePushStep.java:66)
    at com.google.cloud.tools.jib.builder.steps.AuthenticatePushStep.call(AuthenticatePushStep.java:35)
    ... 6 more
Caused by: java.net.ConnectException: Connection refused (Connection refused)
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:607)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:368)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
    ... 25 more

I'm not able to reproduce this failure locally. We need to check why is this happening on Jenkins.

Expected Behavior

JibImageBuildServicePushTest should pass on CI

Acceptance Criteria

manusa commented 1 month ago

The test should have a prerequisite to verify that (and wait for) the registry server is accepting connections.