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

Unable to copy the sloccount summary when the job has been executed on a slave with a different OS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • sloccount-plugin
    • None
    • I had the issue when running the master on Windows XP and executing the Job on Unix (Ubuntu Server)

      If I execute my job on a slave that runs on Unix, when the master node that runs on Windows XP tries to copy the file sloccount.sc from the slave to the master jobs directory I get the following exception (it results to a build failure).

       
      java.io.IOException: remote file operation failed: C:\var\jenkins\workspace\sloccount-fasttrack\sloccount.sc at hudson.remoting.Channel@11a5ec7:AES-KLBUILD
      	at hudson.FilePath.act(FilePath.java:910)
      	at hudson.FilePath.act(FilePath.java:887)
      	at hudson.FilePath.copyTo(FilePath.java:1809)
      	at hudson.plugins.sloccount.SloccountPublisher.copyFilesToBuildDirectory(SloccountPublisher.java:139)
      	at hudson.plugins.sloccount.SloccountPublisher.perform(SloccountPublisher.java:92)
      	at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:784)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:756)
      	at hudson.model.Build$BuildExecution.post2(Build.java:183)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:705)
      	at hudson.model.Run.execute(Run.java:1695)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:231)
      Caused by: java.io.FileNotFoundException: C:\var\jenkins\workspace\sloccount-fasttrack\sloccount.sc (No such file or directory)
      	at java.io.FileInputStream.open(Native Method)
      	at java.io.FileInputStream.<init>(FileInputStream.java:138)
      	at hudson.FilePath$37.invoke(FilePath.java:1814)
      	at hudson.FilePath$37.invoke(FilePath.java:1809)
      	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2461)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:328)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	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:724)
      Build step 'Publish SLOCCount analysis results' marked build as failure}}
      

      As you can see, the master starts to get crazy because in copyFilesToBuildDirectory, it uses the sourceFile.getAbsolutePath(). This method tries to resolve the sourceFile against the current JVM FileSystem that is different from the slave.

      BTW, I am wondering why the code uses the getAbsolutePath() method instead of the getPath() that returns the actual file path.

            poussma Mathieu POUSSE
            poussma Mathieu POUSSE
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: