带有 Kubernetes 客户端插件的 Jenkins - NoSuchMethodError

fue*_*sle 7 jenkins kubernetes

将 jenkins 插件 Kubernetes Client 升级到版本 1.30.3(也适用于 1.31.1)后,当我开始构建时,我在 jenkins 日志中收到以下异常:

Timer task org.csanchez.jenkins.plugins.kubernetes.KubernetesClientProvider$UpdateConnectionCount@2c16d367 failed
java.lang.NoSuchMethodError: 'okhttp3.OkHttpClient io.fabric8.kubernetes.client.HttpClientAware.getHttpClient()'
    at org.csanchez.jenkins.plugins.kubernetes.KubernetesClientProvider$UpdateConnectionCount.doRun(KubernetesClientProvider.java:150)
    at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:90)
    at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:67)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
Run Code Online (Sandbox Code Playgroud)

在发生其中一些异常之后,构建本身会被取消,并出现以下错误:

java.io.IOException: Timed out waiting for websocket connection. You should increase the value of system property org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator.websocketConnectionTimeout currently set at 30 seconds
at org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator$1.doLaunch(ContainerExecDecorator.java:451)
at org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator$1.launch(ContainerExecDecorator.java:338)
at hudson.Launcher$ProcStarter.start(Launcher.java:507)
at org.jenkinsci.plugins.durabletask.BourneShellScript.launchWithCookie(BourneShellScript.java:176)
at org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoringTask.java:132)
at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.start(DurableTaskStep.java:324)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:319)
Run Code Online (Sandbox Code Playgroud)

您知道可以做什么吗?

小智 18

将插件降级为 kubernetes-client-api:5.10.1-171.vaa0774fb8c20。目前最新的版本存在兼容性问题。

新信息:现在通过将Kubernetes 插件升级到版本来解决此问题:1.31.2 https://issues.jenkins.io/browse/JENKINS-67483