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

sshCommand sshGet fails to find file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • ssh-steps-plugin
    • Jenkins 2.204.2 (Windows slave Node)
      ssh-steps-plugin 2.0.0

      I have been using the SSH Steps plugin in declartive pipeline and is working well.

      I have been adding the sshGet, but this fails to with the following:

      2: No such file
      	at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2873)
      	at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2225)
      	at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2242)
      	at com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:928)
      	at com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:892)
      	at com.jcraft.jsch.ChannelSftp$get.call(Unknown Source)
      	at org.hidetake.groovy.ssh.operation.SftpOperations$_getFile_closure1.doCall(SftpOperations.groovy:39)
      	at org.hidetake.groovy.ssh.operation.SftpOperations$_getFile_closure1.doCall(SftpOperations.groovy)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.lang.reflect.Method.invoke(Unknown Source)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
      	at org.hidetake.groovy.ssh.operation.SftpOperations.tryCatchSftpException(SftpOperations.groovy:170)
      Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to Windows Node 01
      		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
      		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
      		at hudson.remoting.Channel.call(Channel.java:955)
      		at org.jenkinsci.plugins.sshsteps.steps.GetStep$Execution.run(GetStep.java:104)
      		at org.jenkinsci.plugins.sshsteps.util.SSHStepExecution.lambda$start$0(SSHStepExecution.java:84)
      		at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      Caused: org.hidetake.groovy.ssh.operation.SftpException: Failed SFTP GET: 10.100.101.211:c:/Dev/Test_DFM/conversionReport_report.xml -> C:\workspace\workspace\GC_Testpipes\UtilitiesTesting\DFM_test\conversionReport_report.xml: (SSH_FX_NO_SUCH_FILE: A reference was made to a file which does not exist): No such file
      

      However the file is there:

      The sshCommand side is running as I would expect, but it is only this part failing for me.

      Here is the stage for the sshGet:

      stage('Move *.report.xml'){
         steps{
            script{
               sshGet remote: remote, from: "c:/Dev/Test_DFM/conversionReport_report.xml", into: "conversionReport_report.xml", override: true
            }
            bat "move *_report.xml ${APPLICATION_NAME_PATH}/Reports"
         }
      } // End of Move *.report.xml
      

            nrayapati Naresh Rayapati
            gavinc Gavin Chalkley
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: