-
Bug
-
Resolution: Unresolved
-
Blocker
-
None
-
Jenkins 2.289.2
Ssh-agent plugin 1.23 or 1.22
Kubernetes plugin 1.30.1
Hi, after upgrading our Jenkins server to 2.289.2 and upgrading all plugins the ssh-agent plugin does not work inside a Kubernetes container block.
This works
node('kubernetes') { sshagent(['mykey']) { sh "ssh ..." } }
This does not work
node('kubernetes') { container('jnlp') { sh 'which ssh-agent' sshagent(['mykey']) { sh "ssh ..." } } }
16:49:04 + which ssh-agent 16:49:04 /usr/bin/ssh-agent 16:49:04 [Pipeline] sshagent 16:49:04 [ssh-agent] Using credentials ci 16:49:04 [ssh-agent] Looking for ssh-agent implementation... 16:49:04 [ssh-agent] FATAL: Could not find a suitable ssh-agent provider 16:49:04 [ssh-agent] Diagnostic report 16:49:04 [Pipeline] // sshagent 16:49:04 [Pipeline] } 16:49:04 [Pipeline] // container 16:49:04 [Pipeline] } 16:49:04 [Pipeline] // node 16:49:04 [Pipeline] End of Pipeline 16:49:04 java.lang.RuntimeException: [ssh-agent] Could not find a suitable ssh-agent provider. 16:49:04 at com.cloudbees.jenkins.plugins.sshagent.SSHAgentStepExecution.initRemoteAgent(SSHAgentStepExecution.java:175) 16:49:04 at com.cloudbees.jenkins.plugins.sshagent.SSHAgentStepExecution.start(SSHAgentStepExecution.java:63) 16:49:04 at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:319) 16:49:04 at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:193) 16:49:04 at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122) 16:49:04 at jdk.internal.reflect.GeneratedMethodAccessor896.invoke(Unknown Source) 16:49:04 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 16:49:04 at java.base/java.lang.reflect.Method.invoke(Method.java:566) 16:49:04 at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) 16:49:04 at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) 16:49:04 at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213) 16:49:04 at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022) 16:49:04 at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42) 16:49:04 at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) 16:49:04 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) 16:49:04 at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:163) 16:49:04 at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23) 16:49:04 at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:158) 16:49:04 at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:161) 16:49:04 at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:165) 16:49:04 at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135) 16:49:04 at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135) 16:49:04 at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17) 16:49:04 at WorkflowScript.run(WorkflowScript:4) 16:49:04 at __cps.transform__(Native Method) 16:49:04 at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86) 16:49:04 at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113) 16:49:04 at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83) 16:49:04 at jdk.internal.reflect.GeneratedMethodAccessor774.invoke(Unknown Source) 16:49:04 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 16:49:04 at java.base/java.lang.reflect.Method.invoke(Method.java:566) 16:49:04 at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) 16:49:04 at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46) 16:49:04 at com.cloudbees.groovy.cps.Next.step(Next.java:83) 16:49:04 at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174) 16:49:04 at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163) 16:49:04 at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129) 16:49:04 at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268) 16:49:04 at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163) 16:49:04 at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18) 16:49:04 at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51) 16:49:04 at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185) 16:49:04 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400) 16:49:04 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96) 16:49:04 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312) 16:49:04 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276) 16:49:04 at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67) 16:49:04 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) 16:49:04 at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) 16:49:04 at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) 16:49:04 at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) 16:49:04 at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) 16:49:04 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) 16:49:04 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 16:49:04 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 16:49:04 at java.base/java.lang.Thread.run(Thread.java:834) 16:49:04 Finished: FAILURE