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

Could not copy slave.jar into '<dir>' on slave

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Labels:
      None
    • Environment:
      Jenkins ver. 1.651.3, 2.150.1
      ssh-slaves-plugin:1.11-1.30.1
      OS: Linux 2.6.32-642.11.1.el6.x86_64
    • Similar Issues:

      Description

      Attempting to start Linux node results in failure:

      {{08/16/18 17:47:31] [SSH] Copying latest slave.jar...}}
       {{hudson.util.IOException2: Could not copy slave.jar into '/build' on slave}}
       {{        at hudson.plugins.sshslaves.SSHLauncher.copySlaveJar(SSHLauncher.java:1054)}}
       {{        at hudson.plugins.sshslaves.SSHLauncher.access$300(SSHLauncher.java:137)}}
       {{        at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:723)}}
       {{        at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:706)}}
       {{        at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
       {{        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}
       {{        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}
       {{        at java.lang.Thread.run(Thread.java:748)}}
       {{Caused by: hudson.util.IOException2: Could not copy slave.jar to '/build/slave.jar' on slave}}
       {{        at hudson.plugins.sshslaves.SSHLauncher.copySlaveJar(SSHLauncher.java:1049)}}
       {{        ... 7 more}}
       {{Caused by: com.trilead.ssh2.SFTPException: Failure (SSH_FX_FAILURE: An error occurred, but no specific error code exists to describe the failure.)}}
       {{        at com.trilead.ssh2.SFTPv3Client.openFile(SFTPv3Client.java:1201)}}
       {{        at com.trilead.ssh2.SFTPv3Client.createFile(SFTPv3Client.java:1074)}}
       {{        at com.trilead.ssh2.SFTPv3Client.createFile(SFTPv3Client.java:1055)}}
       {{        at hudson.plugins.sshslaves.SFTPClient.writeToFile(SFTPClient.java:93)}}
       {{        at hudson.plugins.sshslaves.SSHLauncher.copySlaveJar(SSHLauncher.java:1039)}}
       {{        ... 7 more}}
      

      Turns out root cause is file system went read-only:

      mount: warning: /etc/mtab is not writable (e.g. read-only filesystem).
             It's possible that information reported by mount(8) is not
             up to date. For actual information about system mount points
             check the /proc/mounts file.

      Reporting error because of the response in the logs:

      (SSH_FX_FAILURE: An error occurred, but no specific error code exists to describe the failure.)

      This is a different failure condition to other documented bugs (JENKINS-42856 , JENKINS-42441) so worth mentioning and perhaps code can be fixed to provide more descriptive failure response

        Attachments

          Activity

          Hide
          ifernandezcalvo Ivan Fernandez Calvo added a comment -

          unsupported Jenkins core version and ssh-slaves-plugin

          Show
          ifernandezcalvo Ivan Fernandez Calvo added a comment - unsupported Jenkins core version and ssh-slaves-plugin
          Hide
          ianw Ian Williams added a comment -

          I realize it took 10 months to get to this point, but just wondering if you read to the end of the description?
          It seems fairly self-explanatory and could be verified by inspection.

          My guess is you should be handling one of the other error responses - eg:

          SSH_FX_PERMISSION_DENIED 3
          SSH_FX_WRITE_PROTECT 12

          The complete list can be found at SSH File Transfer Protocol: Status response

          I believe the impacted code is here - SFTPv3Client.java

          Several of the other "Similar Issues" also appear to meet the conditions of one of the known error responses.

          I am 100% certain the condition remains in the latest LTS. Shall I reproduce under under the latest release for you?

          Please re-review.

          Show
          ianw Ian Williams added a comment - I realize it took 10 months to get to this point, but just wondering if you read to the end of the description? It seems fairly self-explanatory and could be verified by inspection. My guess is you should be handling one of the other error responses - eg: SSH_FX_PERMISSION_DENIED 3 SSH_FX_WRITE_PROTECT 12 The complete list can be found at SSH File Transfer Protocol: Status response I believe the impacted code is here - SFTPv3Client.java Several of the other "Similar Issues" also appear to meet the conditions of one of the known error responses. I am 100% certain the condition remains in the latest LTS. Shall I reproduce under under the latest release for you? Please re-review.
          Hide
          ifernandezcalvo Ivan Fernandez Calvo added a comment - - edited

          I was closing old stuff, this one I really didn't really want to close it.

          >I realize it took 10 months to get to this point, but just wondering if you read to the end of the description?

          BTW, really unpolite comment.

          Show
          ifernandezcalvo Ivan Fernandez Calvo added a comment - - edited I was closing old stuff, this one I really didn't really want to close it. >I realize it took 10 months to get to this point, but just wondering if you read to the end of the description? BTW, really unpolite comment.
          Hide
          ianw Ian Williams added a comment - - edited

          Apologies for the antagonism

          Show
          ianw Ian Williams added a comment - - edited Apologies for the antagonism
          Hide
          ifernandezcalvo Ivan Fernandez Calvo added a comment -

          I've dug in how Trilead-ssh2 library implements the SSH error manage and it simply relays the error code and adds the error message described in SSH File Transfer Protocol: Status response so the implementation is correct, it depends on the implementation that the SSH server made and the error codes that it returns, if those codes are incorrect or lazy implemented the information that the Trilead-ssh2 can return has the same level of detail. So I am afraid that I can not do anything here to improve the user experience.

          https://github.com/jenkinsci/trilead-ssh2/blob/master/src/com/trilead/ssh2/SFTPv3Client.java#L1201
          https://github.com/jenkinsci/trilead-ssh2/blob/master/src/com/trilead/ssh2/SFTPException.java
          https://github.com/jenkinsci/trilead-ssh2/blob/master/src/com/trilead/ssh2/sftp/ErrorCodes.java

          Show
          ifernandezcalvo Ivan Fernandez Calvo added a comment - I've dug in how Trilead-ssh2 library implements the SSH error manage and it simply relays the error code and adds the error message described in SSH File Transfer Protocol: Status response so the implementation is correct, it depends on the implementation that the SSH server made and the error codes that it returns, if those codes are incorrect or lazy implemented the information that the Trilead-ssh2 can return has the same level of detail. So I am afraid that I can not do anything here to improve the user experience. https://github.com/jenkinsci/trilead-ssh2/blob/master/src/com/trilead/ssh2/SFTPv3Client.java#L1201 https://github.com/jenkinsci/trilead-ssh2/blob/master/src/com/trilead/ssh2/SFTPException.java https://github.com/jenkinsci/trilead-ssh2/blob/master/src/com/trilead/ssh2/sftp/ErrorCodes.java

            People

            • Assignee:
              ifernandezcalvo Ivan Fernandez Calvo
              Reporter:
              ianw Ian Williams
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: