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

Failed to display file source for resharper analysis: Copying the source file from the workspace to the build folder on the Jenkins master failed.

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • None
    • Windows Server 2008 R2, Jenkins 1.651.3, Warnings plugin 4.56, Subversion Plug-in 2.4.4

      We use default Jenkins Configuration.

      Standard ASP.NET MVC web project with MSBuild task, Resharper InspectCode and Postbuild warnings pluging with parser for Resharper Inspect Code. All information is showed inside of "Resharper InspectCode Warnings". Until trying to view file content with proble line everything is worked. After clicking on file name - exception is thrown.All other tools (like Warnings MSBuild console parser) shows file content correctly.

      Mapped svn folder - trunk. Trunk structure:
      BuildTools
      Common
      Documents
      WebProject

      Only WebProject is build and published.

      Error Message:
      Content of file pdf.js

      01 Copying the source file 'WebProject/Plugins/pdfjs/build/pdf.js' from the workspace to the build folder 'f4904279.tmp' on the Jenkins master failed.
      02 Seems that the path is relative, however an absolute path is required when copying the sources.
      03 Is the file 'pdf.js' contained more than once in your workspace?
      04 Is the file 'WebProject/Plugins/pdfjs/build/pdf.js' a valid filename?
      05 If you are building on a slave: please check if the file is accessible under '$JENKINS_HOME/[job-name]/WebProject/Plugins/pdfjs/build/pdf.js'
      06 If you are building on the master: please check if the file is accessible under '$JENKINS_HOME/[job-name]/workspace/WebProject/Plugins/pdfjs/build/pdf.js'
      07 java.io.IOException: Failed to copy WebProject/Plugins/pdfjs/build/pdf.js to C:\Program Files (x86)\Jenkins\jobs\Trunk-Complete\builds\2\workspace-files\f4904279.tmp
      08 at hudson.FilePath.copyTo(FilePath.java:1990)
      09 at hudson.plugins.analysis.util.Files.copyFilesWithAnnotationsToBuildFolder(Files.java:80)
      10 at hudson.plugins.analysis.core.HealthAwareRecorder.copyFilesWithAnnotationsToBuildFolder(HealthAwareRecorder.java:333)
      11 at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:89)
      12 at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:280)
      13 at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
      14 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      15 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
      16 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
      17 at hudson.model.Build$BuildExecution.post2(Build.java:185)
      18 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
      19 at hudson.model.Run.execute(Run.java:1763)
      20 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      21 at hudson.model.ResourceController.execute(ResourceController.java:98)
      22 at hudson.model.Executor.run(Executor.java:410)
      23 Caused by: java.io.FileNotFoundException: WebProject\Plugins\pdfjs\build\pdf.js (The system cannot find the path specified)
      24 at java.io.FileInputStream.open(Native Method)
      25 at java.io.FileInputStream.<init>(Unknown Source)
      26 at hudson.FilePath$41.invoke(FilePath.java:2016)
      27 at hudson.FilePath$41.invoke(FilePath.java:2011)
      28 at hudson.FilePath.act(FilePath.java:990)
      29 at hudson.FilePath.act(FilePath.java:968)
      30 at hudson.FilePath.copyTo(FilePath.java:2011)
      31 at hudson.FilePath.copyTo(FilePath.java:1985)
      32 ... 14 more

          [JENKINS-36132] Failed to display file source for resharper analysis: Copying the source file from the workspace to the build folder on the Jenkins master failed.

          Dean Thrasher added a comment -

          It's been a while since I worked on that project, but I'm fairly certain that I had tried the "scan for files in the workspace" option. As I said in my earlier comment, I think the issue was that my solution (.sln) file was placed two subfolders below the workspace / Git root.

          Dean Thrasher added a comment - It's been a while since I worked on that project, but I'm fairly certain that I had tried the "scan for files in the workspace" option. As I said in my earlier comment, I think the issue was that my solution (.sln) file was placed two subfolders below the workspace / Git root.

          Where is this option located ?
          Is it in Job configuration or in the plugin one ?

          Nicolas Nobelis added a comment - Where is this option located ? Is it in Job configuration or in the plugin one ?

          Robert Smid added a comment -

          LinkProblem.docx

          I have same problem, In attachment, you can see content of workspace - it contains one log file to parse by PC-Lint (Warnings) parser and source code file (pics 1,2).

          Link in log file - pic 3

          I get error when i try to look at the source code - pic 4 - Failed to copy sourc file to workspace

          pic 5 - this is the problem i think (as Nicolas mentioned), the expected directory is
          $JENKINS_HOME/jobs/[job-name]/workspace, but in Jenkins, workspace can be found here: $JENKINS_HOME/workspace/[job-name]

          Robert Smid added a comment - LinkProblem.docx I have same problem, In attachment, you can see content of workspace - it contains one log file to parse by PC-Lint (Warnings) parser and source code file (pics 1,2). Link in log file - pic 3 I get error when i try to look at the source code - pic 4 - Failed to copy sourc file to workspace pic 5 - this is the problem i think (as Nicolas mentioned), the expected directory is $JENKINS_HOME/jobs/ [job-name] /workspace, but in Jenkins, workspace can be found here: $JENKINS_HOME/workspace/ [job-name]

          Ulli Hafner added a comment -

          Robert: thanks for the images. I'll create a test case with your setup to see what is happening. Is the file in your workspace at the top level folder and in the src folder?

          Ulli Hafner added a comment - Robert: thanks for the images. I'll create a test case with your setup to see what is happening. Is the file in your workspace at the top level folder and in the src folder?

          Robert Smid added a comment -

          Hello, yes that file is there twice. First (and correctly i expect) it was only in src folder, but later (as one of my tries/test) i put it at the top level, but it does not help.

          Robert Smid added a comment - Hello, yes that file is there twice. First (and correctly i expect) it was only in src folder, but later (as one of my tries/test) i put it at the top level, but it does not help.

          Ulli Hafner added a comment - - edited

          Robert: Seems that you are using the wrong parser? The log

          src/file.c:111:11: Info 1111: A message.
          

          from your example is not in MS-Build (same as PC-Lint) message format. Did you follow the explanation. What tool creates your warnings? Can you wrap an example console log message into a noformat tag (see above)?

          (BTW: this issue is about Resharper messages )

          Ulli Hafner added a comment - - edited Robert: Seems that you are using the wrong parser? The log src/file.c:111:11: Info 1111: A message. from your example is not in MS-Build (same as PC-Lint) message format. Did you follow the explanation . What tool creates your warnings? Can you wrap an example console log message into a noformat tag (see above)? (BTW: this issue is about Resharper messages )

          Robert Smid added a comment -

          Sorry, i thought main goal is that main goal is copying source files from workspace to the build folder. Do i have to start another issue? Here is part of log file:
          src/idr_libthmdl.c:162:1: Info 830: Location cited in prior message
          src/idr_libthmdl.c:289:1: Info 818: Pointer parameter 'f_struct10ms_p' (line 238) could be declared as pointing to const [MISRA 2012 Rule 8.13, advisory]
          src\idr_libthmdl.c:238:1: Info 830: Location cited in prior message

          I use Warnings plugin, pc-lint parser

          I do not know what tool creates this warnings, i do not have control over building process, it is black box for me, i just triggering omakes and collect results in Jenkins. But the message format looks ok to me

          Robert Smid added a comment - Sorry, i thought main goal is that main goal is copying source files from workspace to the build folder. Do i have to start another issue? Here is part of log file: src/idr_libthmdl.c:162:1: Info 830: Location cited in prior message src/idr_libthmdl.c:289:1: Info 818: Pointer parameter 'f_struct10ms_p' (line 238) could be declared as pointing to const [MISRA 2012 Rule 8.13, advisory] src\idr_libthmdl.c:238:1: Info 830: Location cited in prior message I use Warnings plugin, pc-lint parser I do not know what tool creates this warnings, i do not have control over building process, it is black box for me, i just triggering omakes and collect results in Jenkins. But the message format looks ok to me

          Ulli Hafner added a comment - - edited

          Well, the filename currently is parsed as "src/idr_libthmdl.c:162:1", which is not valid!

          The expected message format for pc-lint parser is different (note the line and columns):

          Src\Parser\CSharp\cs.ATG (2242,17):  warning CS0168: The variable 'type' is declared but never used
          C:\Src\Parser\CSharp\file.cs (10): error XXX: An error occurred
          
          Controls\MozItem.cs(1338,4): warning CS0618: System.ComponentModel.Design.ComponentDesigner.OnSetComponentDefaults() : This method has been deprecated. Use InitializeNewComponent instead. http://go.microsoft.com/fwlink/?linkid=14202
          
          MediaPortal.cs(3001,5): warning CS0162: Hier kommt der Warnings Text
          
          x/a/b/include/abc.h(18) : fatal error C1083: Cannot open include file: xyz.h:...
          
          foo.h(5): Info 701: This is an info message from PcLint
          

          I.e., you need to use a different parser or adapt the messages of pc-lint. +

          Maybe we need to have a new parser for pclint that matches better to your input.

          Ulli Hafner added a comment - - edited Well, the filename currently is parsed as "src/idr_libthmdl.c:162:1", which is not valid! The expected message format for pc-lint parser is different (note the line and columns): Src\Parser\CSharp\cs.ATG (2242,17): warning CS0168: The variable 'type' is declared but never used C:\Src\Parser\CSharp\file.cs (10): error XXX: An error occurred Controls\MozItem.cs(1338,4): warning CS0618: System.ComponentModel.Design.ComponentDesigner.OnSetComponentDefaults() : This method has been deprecated. Use InitializeNewComponent instead. http://go.microsoft.com/fwlink/?linkid=14202 MediaPortal.cs(3001,5): warning CS0162: Hier kommt der Warnings Text x/a/b/include/abc.h(18) : fatal error C1083: Cannot open include file: xyz.h:... foo.h(5): Info 701: This is an info message from PcLint I.e., you need to use a different parser or adapt the messages of pc-lint. + Maybe we need to have a new parser for pclint that matches better to your input.

          Robert Smid added a comment -

          Now i found the difference, i manually changed the log file from
          src/idr_libthmdl.c:162:1: Info 830: Location cited in prior message
          to
          src/idr_libthmdl.c(162:1): Info 830: Location cited in prior message
          and it works, so it is up to me

          1) find another parser or
          2) prepare own parser or
          3) discuss with department that is responsible for tool creating warnings if it is configureable somehow

          Thanks for help
          Robert

          Robert Smid added a comment - Now i found the difference, i manually changed the log file from src/idr_libthmdl.c:162:1: Info 830: Location cited in prior message to src/idr_libthmdl.c(162:1): Info 830: Location cited in prior message and it works, so it is up to me 1) find another parser or 2) prepare own parser or 3) discuss with department that is responsible for tool creating warnings if it is configureable somehow Thanks for help Robert

          Ulli Hafner added a comment - - edited

          Maybe this link helps: https://wiki.jenkins-ci.org/display/JENKINS/PcLint+options

          I think option 2 should be quite easy if no existing parser works.

          Ulli Hafner added a comment - - edited Maybe this link helps: https://wiki.jenkins-ci.org/display/JENKINS/PcLint+options I think option 2 should be quite easy if no existing parser works.

            drulli Ulli Hafner
            yauhen Yauhen Filipskikh
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: