java.io.IOException: remote file operation failed: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 at hudson.remoting.Channel@18993415:13ca24de: java.io.FileNotFoundException: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 (Is a directory)

Jenkins JIRA | James Nord | 1 year ago
  1. 0

    observed in the following script {noformat} node() { withCredentials([[$class: 'ZipFileBinding', credentialsId: 'zip-credentials', variable: 'ZIP_LOC']]) { echo '1' withCredentials([[$class: 'FileBinding', credentialsId: 'ssh-key', variable: 'MY_SSH_KEY']]) { echo '2' sh 'echo Hello World - ${ZIP_LOC} --- ${MY_SSH_KEY}' } } } {noformat} there was an issue with the second withCredentials step but the workflow logs list the following {noformat} Running: Bind credentials to variables : Start Running: Bind credentials to variables : Body : Start Running: Print Message 1 Running: Bind credentials to variables : Start Running: Bind credentials to variables : End Running: Bind credentials to variables : Body : End Running: Bind credentials to variables : End Running: Change Directory : Body : End Running: Change Directory : End Running: Allocate node : Body : End Running: Allocate node : End Running: End of Workflow java.io.IOException: remote file operation failed: /scratch/jenkins/secretFiles/8ae515c7-76d4-4021-aff3-233263e97a71 at hudson.remoting.Channel@76710f3e:400b174c: java.nio.file.DirectoryNotEmptyException: /scratch/jenkins/secretFiles/8ae515c7-76d4-4021-aff3-233263e97a71/credentials.zip at hudson.FilePath.act(FilePath.java:985) at hudson.FilePath.act(FilePath.java:967) at hudson.FilePath.deleteRecursive(FilePath.java:1169) at org.jenkinsci.plugins.credentialsbinding.impl.FileBinding$UnbinderImpl.unbind(FileBinding.java:76) at org.jenkinsci.plugins.credentialsbinding.impl.BindingStep$Callback.cleanup(BindingStep.java:176) at org.jenkinsci.plugins.credentialsbinding.impl.BindingStep$Callback.onFailure(BindingStep.java:189) at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:294) at com.cloudbees.groovy.cps.impl.ContinuationGroup.throwException(ContinuationGroup.java:203) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:75) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:106) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:79) at sun.reflect.GeneratedMethodAccessor664.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:40) at com.cloudbees.groovy.cps.Next.step(Next.java:58) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:145) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:106) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:271) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:71) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:180) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:178) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.nio.file.DirectoryNotEmptyException: /scratch/jenkins/secretFiles/8ae515c7-76d4-4021-aff3-233263e97a71/credentials.zip at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:242) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1079) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at hudson.Util.deleteFile(Util.java:247) at hudson.FilePath.deleteRecursive(FilePath.java:1202) at hudson.FilePath.deleteContentsRecursive(FilePath.java:1211) at hudson.FilePath.deleteRecursive(FilePath.java:1193) at hudson.FilePath.access$1000(FilePath.java:191) at hudson.FilePath$14.invoke(FilePath.java:1172) at hudson.FilePath$14.invoke(FilePath.java:1169) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2688) at hudson.remoting.UserRequest.perform(UserRequest.java:121) at hudson.remoting.UserRequest.perform(UserRequest.java:49) at hudson.remoting.Request$2.run(Request.java:325) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) at ......remote call to 400b174c(Native Method) at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1360) at hudson.remoting.UserResponse.retrieve(UserRequest.java:221) at hudson.remoting.Channel.call(Channel.java:753) at hudson.FilePath.act(FilePath.java:978) ... 36 more Finished: FAILURE {noformat} Note that "2" is not printed, nor is the shell run - as the second credentials file failed - but there are no logs as to why. If the order of the 2 withCredentials steps is reveresed you see the true cause of the failure: {noformat} java.io.IOException: remote file operation failed: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 at hudson.remoting.Channel@18993415:13ca24de: java.io.FileNotFoundException: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 (Is a directory) at hudson.FilePath.act(FilePath.java:985) at hudson.FilePath.act(FilePath.java:967) at hudson.FilePath.write(FilePath.java:1881) at hudson.FilePath.copyFrom(FilePath.java:882) at org.jenkinsci.plugins.credentialsbinding.impl.FileBinding.copy(FileBinding.java:89) at org.jenkinsci.plugins.credentialsbinding.impl.FileBinding.bindSingle(FileBinding.java:60) at org.jenkinsci.plugins.credentialsbinding.Binding.bind(Binding.java:126) {noformat}

    Jenkins JIRA | 1 year ago | James Nord
    java.io.IOException: remote file operation failed: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 at hudson.remoting.Channel@18993415:13ca24de: java.io.FileNotFoundException: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 (Is a directory)
  2. 0

    observed in the following script {noformat} node() { withCredentials([[$class: 'ZipFileBinding', credentialsId: 'zip-credentials', variable: 'ZIP_LOC']]) { echo '1' withCredentials([[$class: 'FileBinding', credentialsId: 'ssh-key', variable: 'MY_SSH_KEY']]) { echo '2' sh 'echo Hello World - ${ZIP_LOC} --- ${MY_SSH_KEY}' } } } {noformat} there was an issue with the second withCredentials step but the workflow logs list the following {noformat} Running: Bind credentials to variables : Start Running: Bind credentials to variables : Body : Start Running: Print Message 1 Running: Bind credentials to variables : Start Running: Bind credentials to variables : End Running: Bind credentials to variables : Body : End Running: Bind credentials to variables : End Running: Change Directory : Body : End Running: Change Directory : End Running: Allocate node : Body : End Running: Allocate node : End Running: End of Workflow java.io.IOException: remote file operation failed: /scratch/jenkins/secretFiles/8ae515c7-76d4-4021-aff3-233263e97a71 at hudson.remoting.Channel@76710f3e:400b174c: java.nio.file.DirectoryNotEmptyException: /scratch/jenkins/secretFiles/8ae515c7-76d4-4021-aff3-233263e97a71/credentials.zip at hudson.FilePath.act(FilePath.java:985) at hudson.FilePath.act(FilePath.java:967) at hudson.FilePath.deleteRecursive(FilePath.java:1169) at org.jenkinsci.plugins.credentialsbinding.impl.FileBinding$UnbinderImpl.unbind(FileBinding.java:76) at org.jenkinsci.plugins.credentialsbinding.impl.BindingStep$Callback.cleanup(BindingStep.java:176) at org.jenkinsci.plugins.credentialsbinding.impl.BindingStep$Callback.onFailure(BindingStep.java:189) at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:294) at com.cloudbees.groovy.cps.impl.ContinuationGroup.throwException(ContinuationGroup.java:203) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:75) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:106) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:79) at sun.reflect.GeneratedMethodAccessor664.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:40) at com.cloudbees.groovy.cps.Next.step(Next.java:58) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:145) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:106) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:271) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:71) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:180) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:178) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.nio.file.DirectoryNotEmptyException: /scratch/jenkins/secretFiles/8ae515c7-76d4-4021-aff3-233263e97a71/credentials.zip at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:242) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1079) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at hudson.Util.deleteFile(Util.java:247) at hudson.FilePath.deleteRecursive(FilePath.java:1202) at hudson.FilePath.deleteContentsRecursive(FilePath.java:1211) at hudson.FilePath.deleteRecursive(FilePath.java:1193) at hudson.FilePath.access$1000(FilePath.java:191) at hudson.FilePath$14.invoke(FilePath.java:1172) at hudson.FilePath$14.invoke(FilePath.java:1169) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2688) at hudson.remoting.UserRequest.perform(UserRequest.java:121) at hudson.remoting.UserRequest.perform(UserRequest.java:49) at hudson.remoting.Request$2.run(Request.java:325) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) at ......remote call to 400b174c(Native Method) at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1360) at hudson.remoting.UserResponse.retrieve(UserRequest.java:221) at hudson.remoting.Channel.call(Channel.java:753) at hudson.FilePath.act(FilePath.java:978) ... 36 more Finished: FAILURE {noformat} Note that "2" is not printed, nor is the shell run - as the second credentials file failed - but there are no logs as to why. If the order of the 2 withCredentials steps is reveresed you see the true cause of the failure: {noformat} java.io.IOException: remote file operation failed: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 at hudson.remoting.Channel@18993415:13ca24de: java.io.FileNotFoundException: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 (Is a directory) at hudson.FilePath.act(FilePath.java:985) at hudson.FilePath.act(FilePath.java:967) at hudson.FilePath.write(FilePath.java:1881) at hudson.FilePath.copyFrom(FilePath.java:882) at org.jenkinsci.plugins.credentialsbinding.impl.FileBinding.copy(FileBinding.java:89) at org.jenkinsci.plugins.credentialsbinding.impl.FileBinding.bindSingle(FileBinding.java:60) at org.jenkinsci.plugins.credentialsbinding.Binding.bind(Binding.java:126) {noformat}

    Jenkins JIRA | 1 year ago | James Nord
    java.io.IOException: remote file operation failed: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 at hudson.remoting.Channel@18993415:13ca24de: java.io.FileNotFoundException: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 (Is a directory)
  3. 0

    [JIRA] [workflow-plugin] (JENKINS-30848) a failure in an exit of a step hides failures inside the step

    Google Groups | 1 year ago | te...@java.net (JIRA)
    java.io.IOException: remote file operation failed: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 at hudson.remoting.Channel@18993415:13ca24de: java.io.FileNotFoundException: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 (Is a directory)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Under an strange circumstance, after uploading a credential to Global Credentials section, Jenkins says that the credential is created and it is correct, but physically the file is not uploaded (or it is removed). In these cases the the credentials-binding-plugin fails with next exception: {code:java} java.io.IOException: remote file operation failed: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 at hudson.remoting.Channel@18993415:13ca24de: java.io.FileNotFoundException: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 (Is a directory) at hudson.FilePath.act(FilePath.java:985) at hudson.FilePath.act(FilePath.java:967) at hudson.FilePath.write(FilePath.java:1881) at hudson.FilePath.copyFrom(FilePath.java:882) at org.jenkinsci.plugins.credentialsbinding.impl.FileBinding.copy(FileBinding.java:89) at org.jenkinsci.plugins.credentialsbinding.impl.FileBinding.bindSingle(FileBinding.java:60) at org.jenkinsci.plugins.credentialsbinding.Binding.bind(Binding.java:126) at org.jenkinsci.plugins.credentialsbinding.impl.BindingStep$Execution.start(BindingStep.java:89) {code} It would be great if the plugin enforce to have a fileName set, and in case of not (probably because the credentials are not there) to throw an exception explaining the situation instead of showing an exception which does not explain this situation.

    Jenkins JIRA | 1 year ago | Alex Soto
    java.io.IOException: remote file operation failed: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 at hudson.remoting.Channel@18993415:13ca24de: java.io.FileNotFoundException: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 (Is a directory)
  6. 0

    Under an strange circumstance, after uploading a credential to Global Credentials section, Jenkins says that the credential is created and it is correct, but physically the file is not uploaded (or it is removed). In these cases the the credentials-binding-plugin fails with next exception: {code:java} java.io.IOException: remote file operation failed: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 at hudson.remoting.Channel@18993415:13ca24de: java.io.FileNotFoundException: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 (Is a directory) at hudson.FilePath.act(FilePath.java:985) at hudson.FilePath.act(FilePath.java:967) at hudson.FilePath.write(FilePath.java:1881) at hudson.FilePath.copyFrom(FilePath.java:882) at org.jenkinsci.plugins.credentialsbinding.impl.FileBinding.copy(FileBinding.java:89) at org.jenkinsci.plugins.credentialsbinding.impl.FileBinding.bindSingle(FileBinding.java:60) at org.jenkinsci.plugins.credentialsbinding.Binding.bind(Binding.java:126) at org.jenkinsci.plugins.credentialsbinding.impl.BindingStep$Execution.start(BindingStep.java:89) {code} It would be great if the plugin enforce to have a fileName set, and in case of not (probably because the credentials are not there) to throw an exception explaining the situation instead of showing an exception which does not explain this situation.

    Jenkins JIRA | 1 year ago | Alex Soto
    java.io.IOException: remote file operation failed: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 at hudson.remoting.Channel@18993415:13ca24de: java.io.FileNotFoundException: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 (Is a directory)

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.io.IOException

      remote file operation failed: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 at hudson.remoting.Channel@18993415:13ca24de: java.io.FileNotFoundException: /scratch/jenkins/secretFiles/35effc3c-7cfe-4d39-ad01-720f9f0c0913 (Is a directory)

      at hudson.FilePath.act()
    2. Hudson
      FilePath.copyFrom
      1. hudson.FilePath.act(FilePath.java:985)
      2. hudson.FilePath.act(FilePath.java:967)
      3. hudson.FilePath.write(FilePath.java:1881)
      4. hudson.FilePath.copyFrom(FilePath.java:882)
      4 frames
    3. org.jenkinsci.plugins
      Binding.bind
      1. org.jenkinsci.plugins.credentialsbinding.impl.FileBinding.copy(FileBinding.java:89)
      2. org.jenkinsci.plugins.credentialsbinding.impl.FileBinding.bindSingle(FileBinding.java:60)
      3. org.jenkinsci.plugins.credentialsbinding.Binding.bind(Binding.java:126)
      3 frames