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

Not reading hco.log file when build runs on a slave server

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • harvest-plugin
    • None
    • Windows.

      When running build on remote slave the build fails with java io exception

      FileNotFoundExecption c:\temp\hudson\build\...\hco.log file cannot be opened.

      If I run the build on the master server only it works.

      If I copy a hco.log file to the master server and run another build on the remote slave it also works.

      Does the Harvest plug-in only expect to find the log file on the master server and not on the slave where it gets created?

      I have downloaded the source code from the trunk and have modified the code and have it working correctly on the slave.

      The code copies the hco.log file from the workspace for the build to the build directory on the Master and then reads the log before continuing.
      There were several reasons for doing the copy, the first being to reduce io across master slave servers, and secondly to have a saved copy of the hco.log file as part of the build output for audit.

      The code I used is as follows:

      FilePath SCMlogdest = new FilePath(build.getRootDir()).child("hco.log");
      FilePath SCMlog = new FilePath(workspace.getChannel(), workspace.getRemote()).child("hco.log");

      SCMlog.copyTo(SCMlogdest);

          [JENKINS-8489] Not reading hco.log file when build runs on a slave server

          gliptak added a comment -

          We do not use distribute our builds, so I can only validate this change within a single instance.

          Is there always a corresponding pair of workspaces between the master and slave?

          Feel free to make the change in SVN or submit an actual patch here.

          Thanks

          gliptak added a comment - We do not use distribute our builds, so I can only validate this change within a single instance. Is there always a corresponding pair of workspaces between the master and slave? Feel free to make the change in SVN or submit an actual patch here. Thanks

          nissancedric added a comment -

          there may not be corresponding workspaces between a master and slave.
          The slave agent could run in a different location to the hudson workspace.

          Eg. On my test setup I have a virtual server running Husdon "Master" and my workstation as a slave.
          The slave agent runs in c:\temp\working so the working path is c:\temp\hudson\workspace\SampleHarvestAntbuild.
          on the Master Hudson_home is set to c:\hudson so the working folder is c:\hudson\jobs\SampleHarvestAntbuild\workspace.

          I have made two versions.
          The first harvestscm.java.build simply copies the hco.log file from the master or slave working folder to the build directory (which is always on the master as it holds all the final logs) and then reads it from thesr.
          The second harvestscm.java.working determins if the build is running on a slave (by checking for server name differences) and copying the file to the master working folder. This one is a little more comple as it needs to determind if job is runnung on a slave, and how to determine the workspace nname on the master (if using custom workspace).

          You can pick which one you want to implement.

          nissancedric added a comment - there may not be corresponding workspaces between a master and slave. The slave agent could run in a different location to the hudson workspace. Eg. On my test setup I have a virtual server running Husdon "Master" and my workstation as a slave. The slave agent runs in c:\temp\working so the working path is c:\temp\hudson\workspace\SampleHarvestAntbuild. on the Master Hudson_home is set to c:\hudson so the working folder is c:\hudson\jobs\SampleHarvestAntbuild\workspace. I have made two versions. The first harvestscm.java.build simply copies the hco.log file from the master or slave working folder to the build directory (which is always on the master as it holds all the final logs) and then reads it from thesr. The second harvestscm.java.working determins if the build is running on a slave (by checking for server name differences) and copying the file to the master working folder. This one is a little more comple as it needs to determind if job is runnung on a slave, and how to determine the workspace nname on the master (if using custom workspace). You can pick which one you want to implement.

            Unassigned Unassigned
            nissancedric nissancedric
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: