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

Cannot resolve relative filenames referencing parent directory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • warnings-plugin
    • None
    • Ubuntu 15.10 64 bit, OpenJDK
      Jenkins 1.642
      Warnings plug-in 4.51

      Warnings plugin cannot resolve some relative file names even if "Resolve relative paths" option is set. There are problems with names such as ../file. In that case it cannot find that file even if its name is unique across the entire workspace (but it can resolve "file" without ".." in the same build).

      STEPS TO REPRODUCE

      1. Create empty Git repository
      2. Unpack the archive attached and commit
      3. Create new Freestyle project
        • source control: git
        • build steps: none
        • post-build steps: scan workspace files (compile-log.txt, "Clang (LLVM based)"), set the "Resole relative paths" option
        • build is conducted on the master
      4. Build project and examine warnings

      WHAT IS EXPECTED
      On Files tab one should see one file.txt, one file-in-subdir.txt and one or several multi-file-in-subdir.txt (this file name contained multiple times in the workspace).
      For all warnings in file.txt and file-in-subdir.txt one can view source (because these files have unique names across workspace).

      WHAT HAPPENS
      file-in-subdir.txt is listed twice on Files tab. I cannot view source for warning where it is referenced as ../file-in-subdir.txt (but the source is viewable for warning without ".." in filename).

      CONTENTS OF hudson.plugins.analysis.core.ParserResult (FINE) LOG

      дек 20, 2015 3:07:21 PM FINE hudson.plugins.analysis.core.ParserResult
      Building cache of all workspace files to obtain absolute filenames for all warnings: /var/lib/jenkins/workspace/Test
      дек 20, 2015 3:07:21 PM FINE hudson.plugins.analysis.core.ParserResult
      Absolute filename could not be resolved for: ../multi-file-in-subdir.txt. Found multiple matches: [directory-b/multi-file-in-subdir.txt, directory-a/multi-file-in-subdir.txt]. 
      дек 20, 2015 3:07:21 PM FINE hudson.plugins.analysis.core.ParserResult
      Absolute filename could not be resolved for: ../file-in-subdir.txt. Found multiple matches: [directory-a/file-in-subdir.txt]. 
      дек 20, 2015 3:07:21 PM FINE hudson.plugins.analysis.core.ParserResult
      Absolute filename could not be resolved for: multi-file-in-subdir.txt. Found multiple matches: [directory-b/multi-file-in-subdir.txt, directory-a/multi-file-in-subdir.txt]. 
      дек 20, 2015 3:07:21 PM FINE hudson.plugins.analysis.core.ParserResult
      Absolute filename could not be resolved for: multi-file-in-subdir.txt. Found multiple matches: [directory-b/multi-file-in-subdir.txt, directory-a/multi-file-in-subdir.txt]. 
      дек 20, 2015 3:07:21 PM FINE hudson.plugins.analysis.core.ParserResult
      Absolute filename could not be resolved for: ../file-in-subdir.txt. Found multiple matches: [directory-a/file-in-subdir.txt]. 
      дек 20, 2015 3:07:21 PM FINE hudson.plugins.analysis.core.ParserResult
      Absolute filename could not be resolved for: ../multi-file-in-subdir.txt. Found multiple matches: [directory-b/multi-file-in-subdir.txt, directory-a/multi-file-in-subdir.txt]. 
      

      ERRROR MESSAGE

      01 Copying the source file '../file-in-subdir.txt' from the workspace to the build folder '53f2b315.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 'file-in-subdir.txt' contained more than once in your workspace?
      04 Is the file '../file-in-subdir.txt' a valid filename?
      05 If you are building on a slave: please check if the file is accessible under '$JENKINS_HOME/[job-name]/../file-in-subdir.txt'
      06 If you are building on the master: please check if the file is accessible under '$JENKINS_HOME/[job-name]/workspace/../file-in-subdir.txt'
      07 java.io.IOException: Failed to copy ../file-in-subdir.txt to /var/lib/jenkins/jobs/Test/builds/2/workspace-files/53f2b315.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:312)
      11   at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:89)
      12   at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:259)
      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: ../file-in-subdir.txt (Нет такого файла или каталога)
      24   at java.io.FileInputStream.open(Native Method)
      25   at java.io.FileInputStream.<init>(FileInputStream.java:146)
      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
      

            drulli Ulli Hafner
            atrosinenko Anatoly Trosinenko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: