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

scp plugin throws exception while uploading console log

    Details

    • Similar Issues:

      Description

      During upload of console log an exception is thrown and the connection pipe gets closed which results in copying only a portion of the console log to the remote server. This feature was working when used with Jenkins 1.525, but started to fail when I upgraded to Jenkins 1.540.

      The exception occurs when writer.flush() is called in ConsoleRunnable thread.

      steps to repro:
      1. get and install the latest version of the scp plugin
      2. goto jenkins global config page and configure an scp server
      3. create a new job
      4. add a 'Publish artifacts to SCP Repository' build step
      5. select to copy console log
      6. run a build (with a relatively large log maybe ~5 MB)
      7. verify that entire console log is copied to the remote server.

        Attachments

          Activity

          Show
          zaro Khai Do added a comment - https://github.com/jenkinsci/scp-plugin/pull/7
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Khai Do
          Path:
          pom.xml
          src/main/java/be/certipost/hudson/plugin/SCPRepositoryPublisher.java
          http://jenkins-ci.org/commit/scp-plugin/49399091a5aa7fdf5d3937cfa90ced22c1118a4e
          Log:
          fix uploading of build console logs to remote server

          Fixes issue JENKINS-21138

          An exception occurs during console log upload causing only partial logs
          to be copied to the remote server. The problem is that the session object
          is not thread safe. To fix this problem we need to move the session
          object into the ConsoleRunnable thread. Now the console upload always
          runs in a completely detached thread.

          Notes:
          1. Needed to update jenkins version to 1.430 because 1.403 would not build
          anymore. I think 1.430 should be conservative enought to be compatible
          with most of the existing jenkins installs.
          2. Updated com.jcraft.jsch depenency to version 1.50

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Khai Do Path: pom.xml src/main/java/be/certipost/hudson/plugin/SCPRepositoryPublisher.java http://jenkins-ci.org/commit/scp-plugin/49399091a5aa7fdf5d3937cfa90ced22c1118a4e Log: fix uploading of build console logs to remote server Fixes issue JENKINS-21138 An exception occurs during console log upload causing only partial logs to be copied to the remote server. The problem is that the session object is not thread safe. To fix this problem we need to move the session object into the ConsoleRunnable thread. Now the console upload always runs in a completely detached thread. Notes: 1. Needed to update jenkins version to 1.430 because 1.403 would not build anymore. I think 1.430 should be conservative enought to be compatible with most of the existing jenkins installs. 2. Updated com.jcraft.jsch depenency to version 1.50

            People

            • Assignee:
              zaro Khai Do
              Reporter:
              zaro Khai Do
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: