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

CppCheck Plugin can not reach files on a slave node

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: other
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      I run a windows master and a linux slave. The slave runs cppcheck on my project
      and generates the error report files. CppCheck Plugin reads the file, displays
      all stats, graphs and tables correct. When I click on a error message in the
      overview page the file can not be found and an error occurs.

      It looks like CppCheck Plugin searches for the files on the C: harddisk, but
      with the absolute path of the slave node. The path looks like this:

      file:/C:/home/myuser/myhudson/workspace/on/the/slave/node/file.c

        Attachments

          Activity

          Hide
          gbois Gregory Boissinot added a comment -

          Regarding the exception, if I understand, do you have the exception only for old
          builds (built with a previous cppcheck version)?
          In this situation, I have no solution. In fact, due to changes of the
          configuration object, there is not compatibility with previous builds. The only
          solution is to remove the previous build (before cppcheck 0.7).

          Regarding the new IOException, could you send me the cppcheck result file.
          It seems you have a directory value in the file attribute of a error instead of
          a file
          And this case is not catched.

          The supported use cases are the following situations
          <error file="/home/csc/hudson_work/workspace/MC_MLG/source
          /testcppcheck.cpp" line="19" id="udivError" severity="error" msg="Unsigned
          division. The result will be wrong."/>

          I think you have
          file="/home/csc/hudson_work/workspace/MC_MLG/source" instead of for example
          file="/home/csc/hudson_work/workspace/MC_MLG/source
          /testcppcheck.cpp"

          I don't know this use case. Which command line arguments are you using for
          generating the cppcheck result file?

          Show
          gbois Gregory Boissinot added a comment - Regarding the exception, if I understand, do you have the exception only for old builds (built with a previous cppcheck version)? In this situation, I have no solution. In fact, due to changes of the configuration object, there is not compatibility with previous builds. The only solution is to remove the previous build (before cppcheck 0.7). Regarding the new IOException, could you send me the cppcheck result file. It seems you have a directory value in the file attribute of a error instead of a file And this case is not catched. The supported use cases are the following situations <error file="/home/csc/hudson_work/workspace/MC_MLG/source /testcppcheck.cpp" line="19" id="udivError" severity="error" msg="Unsigned division. The result will be wrong."/> I think you have file="/home/csc/hudson_work/workspace/MC_MLG/source" instead of for example file="/home/csc/hudson_work/workspace/MC_MLG/source /testcppcheck.cpp" I don't know this use case. Which command line arguments are you using for generating the cppcheck result file?
          Hide
          cringe cringe added a comment -

          My call to cppcheck, configured as a build step:

          /opt/cppcheck-1.30/cppcheck --unused-functions --xml --all --verbose --style
          ${WORKSPACE}/source 2> ${WORKSPACE}/source/cppcheck.err

          I send my cppcheck.err file via mail. I don't want it to show up here...

          Show
          cringe cringe added a comment - My call to cppcheck, configured as a build step: /opt/cppcheck-1.30/cppcheck --unused-functions --xml --all --verbose --style ${WORKSPACE}/source 2> ${WORKSPACE}/source/cppcheck.err I send my cppcheck.err file via mail. I don't want it to show up here...
          Hide
          gbois Gregory Boissinot added a comment -

          Your command line is correct.

          Note: It seems you are using cppcheck 1.30.
          The plugin is aimed at the latest cppcheck version : 1.35.

          Show
          gbois Gregory Boissinot added a comment - Your command line is correct. Note: It seems you are using cppcheck 1.30. The plugin is aimed at the latest cppcheck version : 1.35.
          Hide
          cringe cringe added a comment -

          I updated to cppcheck 1.35 now. I wiped the workspace and started the build
          again. But this exception come up again:

          [Cppcheck] Starting the cppcheck analysis.
          [Cppcheck] Processing 1 files with the pattern '**/cppcheck.err'.
          [Cppcheck] Not changing build status, since no threshold has been exceeded
          FATAL: remote file operation failed
          hudson.util.IOException2: remote file operation failed
          at hudson.FilePath.act(FilePath.java:672)
          at hudson.FilePath.act(FilePath.java:660)
          at hudson.FilePath.copyTo(FilePath.java:1272)
          at
          com.thalesgroup.hudson.plugins.cppcheck.CppcheckPublisher.copyFilesFromSlaveToMa
          ster(CppcheckPublisher.java:170)
          at com.thalesgroup.hudson.plugins.cppcheck.CppcheckPublisher.perform
          (CppcheckPublisher.java:124)
          at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
          at hudson.model.AbstractBuild$AbstractRunner.perform
          (AbstractBuild.java:480)
          at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep
          (AbstractBuild.java:466)
          at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep
          (AbstractBuild.java:454)
          at hudson.model.Build$RunnerImpl.post2(Build.java:146)
          at hudson.model.AbstractBuild$AbstractRunner.post
          (AbstractBuild.java:438)
          at hudson.model.Run.run(Run.java:1129)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:93)
          at hudson.model.Executor.run(Executor.java:122)
          Caused by:
          java.io.FileNotFoundException: /home/csc/hudson_work/workspace/MYPROJECT/source
          (Is a directory)
          at java.io.FileInputStream.open(Native Method)
          at java.io.FileInputStream.<init>(FileInputStream.java:106)
          at hudson.FilePath$30.invoke(FilePath.java:1276)
          at hudson.FilePath$30.invoke(FilePath.java:1272)
          at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2032)
          at hudson.remoting.UserRequest.perform(UserRequest.java:103)
          at hudson.remoting.UserRequest.perform(UserRequest.java:47)
          at hudson.remoting.Request$2.run(Request.java:236)
          at java.util.concurrent.Executors$RunnableAdapter.call
          (Executors.java:441)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
          (ThreadPoolExecutor.java:885)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run
          (ThreadPoolExecutor.java:907)
          at java.lang.Thread.run(Thread.java:619)

          Show
          cringe cringe added a comment - I updated to cppcheck 1.35 now. I wiped the workspace and started the build again. But this exception come up again: [Cppcheck] Starting the cppcheck analysis. [Cppcheck] Processing 1 files with the pattern '**/cppcheck.err'. [Cppcheck] Not changing build status, since no threshold has been exceeded FATAL: remote file operation failed hudson.util.IOException2: remote file operation failed at hudson.FilePath.act(FilePath.java:672) at hudson.FilePath.act(FilePath.java:660) at hudson.FilePath.copyTo(FilePath.java:1272) at com.thalesgroup.hudson.plugins.cppcheck.CppcheckPublisher.copyFilesFromSlaveToMa ster(CppcheckPublisher.java:170) at com.thalesgroup.hudson.plugins.cppcheck.CppcheckPublisher.perform (CppcheckPublisher.java:124) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractRunner.perform (AbstractBuild.java:480) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep (AbstractBuild.java:466) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep (AbstractBuild.java:454) at hudson.model.Build$RunnerImpl.post2(Build.java:146) at hudson.model.AbstractBuild$AbstractRunner.post (AbstractBuild.java:438) at hudson.model.Run.run(Run.java:1129) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:93) at hudson.model.Executor.run(Executor.java:122) Caused by: java.io.FileNotFoundException: /home/csc/hudson_work/workspace/MYPROJECT/source (Is a directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at hudson.FilePath$30.invoke(FilePath.java:1276) at hudson.FilePath$30.invoke(FilePath.java:1272) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2032) at hudson.remoting.UserRequest.perform(UserRequest.java:103) at hudson.remoting.UserRequest.perform(UserRequest.java:47) at hudson.remoting.Request$2.run(Request.java:236) at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask (ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619)
          Hide
          gbois Gregory Boissinot added a comment -

          Fixed with cppcheck plugin 0.8

          Show
          gbois Gregory Boissinot added a comment - Fixed with cppcheck plugin 0.8

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              cringe cringe
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: