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

sshRemove: Failed SFTP RMDIR

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • ssh-steps-plugin
    • None
    • Jenkins: 2.263.4
      ssh-steps: 2.0.0

      Using sshRemove on a directory fails (and also despite setting "failOnError: false" there will be an exception)

      sshRemove remote: remote, failOnError: false, path: 'DIR/test/'
      
      Removing a file/directory on server[server]: DIR/test/
       Failed SFTP RMDIR: server:DIR/test/
       [Pipeline] }
       [Pipeline] // withCredentials
       [Pipeline] }
       [Pipeline] // node
       [Pipeline] End of Pipeline
       2: No such file
       	at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2873)
       	at com.jcraft.jsch.ChannelSftp.rmdir(ChannelSftp.java:2149)
       	at com.jcraft.jsch.ChannelSftp$rmdir$2.call(Unknown Source)
       	at org.hidetake.groovy.ssh.operation.SftpOperations$_rmdir_closure7.doCall(SftpOperations.groovy:116)
       	at org.hidetake.groovy.ssh.operation.SftpOperations$_rmdir_closure7.doCall(SftpOperations.groovy)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       	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: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.CallSiteArray.defaultCall(CallSiteArray.java:48)
       	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:57)
       	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
       	at org.hidetake.groovy.ssh.operation.SftpOperations.tryCatchSftpException(SftpOperations.groovy:170)
       Caused: org.hidetake.groovy.ssh.operation.SftpException: Failed SFTP RMDIR: server:DIR/test/: (SSH_FX_NO_SUCH_FILE: A reference was made to a file which does not exist): No such file
       	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
       	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
       	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
       	at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77)
       	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
       	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:255)
       	at org.hidetake.groovy.ssh.operation.SftpOperations.tryCatchSftpException(SftpOperations.groovy:175)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       	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:93)
       	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
       	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrap.invoke(StaticMetaMethodSite.java:133)
       	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:102)
       	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:214)
       	at org.hidetake.groovy.ssh.operation.SftpOperations.rmdir(SftpOperations.groovy:115)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       	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:93)
       	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
       	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
       	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
       	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
       	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
       	at org.hidetake.groovy.ssh.session.transfer.SftpRemove$Trait$Helper$_remove_closure1$_closure2.doCall(SftpRemove.groovy:56)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       	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: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 groovy.lang.Closure.call(Closure.java:414)
       	at groovy.lang.Closure.call(Closure.java:430)
       	at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3156)
       	at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3127)
       	at org.codehaus.groovy.runtime.dgm$66.invoke(Unknown Source)
       	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
       	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
       	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
       	at org.hidetake.groovy.ssh.session.transfer.SftpRemove$Trait$Helper$_remove_closure1.doCall(SftpRemove.groovy:28)
       	at org.hidetake.groovy.ssh.session.transfer.SftpRemove$Trait$Helper$_remove_closure1.doCall(SftpRemove.groovy)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       	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: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.CallSiteArray.defaultCall(CallSiteArray.java:48)
       	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:57)
       	at org.hidetake.groovy.ssh.util.Utility.callWithDelegate(Utility.groovy:17)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       	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:93)
       	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
       	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:46)
       	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:102)
       	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:214)
       	at org.hidetake.groovy.ssh.operation.DefaultOperations.sftp(DefaultOperations.groovy:69)
       	at org.hidetake.groovy.ssh.operation.Operations$sftp.call(Unknown Source)
       	at org.hidetake.groovy.ssh.session.SessionHandler.sftp(SessionHandler.groovy:61)
       	at org.hidetake.groovy.ssh.session.SessionExtension$sftp.call(Unknown Source)
       	at org.hidetake.groovy.ssh.session.transfer.SftpRemove$Trait$Helper.remove(SftpRemove.groovy:27)
       	at org.hidetake.groovy.ssh.session.transfer.SftpRemove$Trait$Helper$remove.call(Unknown Source)
       	at org.hidetake.groovy.ssh.session.SessionHandler.remove(SessionHandler.groovy)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       	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:93)
       	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
       	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
       	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
       	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
       	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
       	at org.jenkinsci.plugins.sshsteps.SSHService$_remove_closure7$_closure19.doCall(SSHService.groovy:258)
       	at org.jenkinsci.plugins.sshsteps.SSHService$_remove_closure7$_closure19.doCall(SSHService.groovy)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       	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: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.CallSiteArray.defaultCall(CallSiteArray.java:48)
       	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:57)
       	at org.hidetake.groovy.ssh.util.Utility.callWithDelegate(Utility.groovy:17)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       	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:93)
       	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
       	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:46)
       	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:102)
       	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:214)
       	at org.hidetake.groovy.ssh.session.SessionTask.wetRun(SessionTask.groovy:64)
       	at org.hidetake.groovy.ssh.session.SessionTask.call(SessionTask.groovy:48)
       	at java_util_concurrent_Callable$call.call(Unknown Source)
       	at org.hidetake.groovy.ssh.core.Service.run(Service.groovy:81)
       	at org.hidetake.groovy.ssh.core.Service$run$0.call(Unknown Source)
       	at org.jenkinsci.plugins.sshsteps.SSHService.remove(SSHService.groovy:256)
       	at org.jenkinsci.plugins.sshsteps.steps.RemoveStep$Execution$RemoveCallable.execute(RemoveStep.java:78)
       	at org.jenkinsci.plugins.sshsteps.util.SSHMasterToSlaveCallable.call(SSHMasterToSlaveCallable.java:32)
       	at hudson.remoting.LocalChannel.call(LocalChannel.java:46)
       	at org.jenkinsci.plugins.sshsteps.steps.RemoveStep$Execution.run(RemoveStep.java:67)
       	at org.jenkinsci.plugins.sshsteps.util.SSHStepExecution.lambda$start$0(SSHStepExecution.java:84)
       	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:834)
      

      Files inside that folder have been removed, only the folder itself remains.

            nrayapati Naresh Rayapati
            gordin Christoph VogtlÃĪnder
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: