Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-69837

[ssh-agent] FATAL: Could not find a suitable ssh-agent provider

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • ssh-agent-plugin
    • None
    • Jenkins

      Hi, 

       

      After the upgrade from version v1.20 to v295.v9ca_a_1c7cc3a_a_

      We encountered the issue, we are running the jenkins in a kubernetes container. 

       
      java.lang.RuntimeException: [ssh-agent] Could not find a suitable ssh-agent provider.
      at com.cloudbees.jenkins.plugins.sshagent.SSHAgentStepExecution.initRemoteAgent(SSHAgentStepExecution.java:176)
      at com.cloudbees.jenkins.plugins.sshagent.SSHAgentStepExecution.start(SSHAgentStepExecution.java:64)
      at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:322)
      at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
      at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:124)
      at jdk.internal.reflect.GeneratedMethodAccessor304.invoke(Unknown Source)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
      at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
      at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:163)
      at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
      at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:158)
      at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:161)
      at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:165)
      at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
      at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
      at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
      at WorkflowScript.run(WorkflowScript:53)
      at __cps.transform__(Native Method)
      at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
      at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
      at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
      at jdk.internal.reflect.GeneratedMethodAccessor162.invoke(Unknown Source)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46)
      at com.cloudbees.groovy.cps.Next.step(Next.java:83)
      at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
      at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
      at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:136)
      at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:275)
      at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
      at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
      at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
      at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:187)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:420)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:95)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:330)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:294)
      at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
      at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      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)
      Finished: FAILURE

          [JENKINS-69837] [ssh-agent] FATAL: Could not find a suitable ssh-agent provider

          Imho it is the same problem as

          The error triggers in the same point of code (off by a line because of the version change).

           

          Maybe is related to some config update.

           

          I was migrating my jenkins from one computer (Windows 8) to another (Windows 10) and the pipeline stop working.

           

          I changed the PATH variable, replicate the plugin list in the two computers and many other tries without luck.

          Nacho Nogueira added a comment - Imho it is the same problem as JENKINS-68035 JENKINS-67240 The error triggers in the same point of code (off by a line because of the version change).   Maybe is related to some config update.   I was migrating my jenkins from one computer (Windows 8) to another (Windows 10) and the pipeline stop working.   I changed the PATH variable, replicate the plugin list in the two computers and many other tries without luck.

          qiao added a comment -

          I have same problem。i have try many way to reslove this problem,but i cann't

          qiao added a comment - I have same problem。i have try many way to reslove this problem,but i cann't

          shin added a comment -

          I experienced the same issue.

          For me the problem was caused by more than one ssh-agent.exe in PATH environment variable.

          I moved the PATH for ssh-agent.exe used by git.exe to the front, and the problem was solved for me.

          shin added a comment - I experienced the same issue. For me the problem was caused by more than one ssh-agent.exe in PATH environment variable. I moved the PATH for ssh-agent.exe used by git.exe to the front, and the problem was solved for me.

          Thanks a lot shin_t, this clearly put us in the right direction to troubleshoot our issue.

          We are adding git ssh-agent in Windows agent path using Jenkins Node properties: PATH+GITSSH=...

          Turns out such property is not yet computed during the ssh-agent build-wrapper step (at least in our case of FreeStyle job).
          So plugin was trying to use Windows OpenSSH ssh-agent, which is known not to work properly

          Solution is to put git ssh-agent in Windows agent path at OS level (*system *environment variables), so the correct version is picked-up and used by Jenkins plugin.

          Geoffroy Jabouley added a comment - Thanks a lot shin_t , this clearly put us in the right direction to troubleshoot our issue. We are adding git ssh-agent in Windows agent path using Jenkins Node properties: PATH+GITSSH=... Turns out such property is not yet computed during the ssh-agent build-wrapper step (at least in our case of FreeStyle job). So plugin was trying to use Windows OpenSSH ssh-agent, which is known not to work properly Solution is to put git ssh-agent in Windows agent path at OS level (*system *environment variables), so the correct version is picked-up and used by Jenkins plugin.

            Unassigned Unassigned
            smendigoria Sadi Mendigoria
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: