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

timestamper 1.9 breaks warnings-ng's ability to find source files

    • 5.0.0 (analysis-model and warnings-ng)

      In timestamper 1.9, the log format was changed.  When I enable timestamper on a pipeline job, then scan it with warnings-ng, it detects errors but incorrectly parses the filename — it considers the timestamp to be part of the filename.

      To reproduce the issue, install both plugins and run this pipeline job:

      node {
          timestamps {
              sh """
                  echo '#error This is an error.' > test.c
                  clang test.c || true
              """
              recordIssues tools: [clang(id: 'clang', name: 'clang')]
          }
      }
      

      and the console log says:

      00:00:01.047  test.c:1:2: error: This is an error.
      …
      00:00:06.276  [clang] [ERROR] Can't resolve absolute paths for some files:
      00:00:06.276  [clang] [ERROR] - [2019-03-08T15:46:53.268Z] test.c
      00:00:06.276  [clang] [ERROR] Can't create fingerprints for some files:
      00:00:06.276  [clang] [ERROR] - '[2019-03-08T15:46:53.268Z] test.c', IO exception has been thrown: java.nio.file.NoSuchFileException: [2019-03-08T15:46:53.268Z] test.c
      

          [JENKINS-56484] timestamper 1.9 breaks warnings-ng's ability to find source files

          Ulli Hafner added a comment -

          Ulli Hafner added a comment - See discussion in https://github.com/jenkinsci/analysis-model/pull/118 .

          Ulli Hafner added a comment -

          This is not related to the timestamper plugin in general. It also happens if e.g. warnings are reported using a colored maven output.

          Ulli Hafner added a comment - This is not related to the timestamper plugin in general. It also happens if e.g. warnings are reported using a colored maven output.

          Jesse Glick added a comment - - edited

          There is apparently a TimestamperAPI.read method which no longer works (and has no test coverage that I know of), though I guess you are looking for something like the opposite which AFAIK does not exist.

          Jesse Glick added a comment - - edited There is apparently a TimestamperAPI.read method which no longer works (and has no test coverage that I know of), though I guess you are looking for something like the opposite which AFAIK does not exist.

          Jesse Glick added a comment -

          Possibly this plugin could pick out filenames from other surrounding text using various algorithms. You could use a block-scoped step where you would be able to intercept process output before other decorations are applied by Jenkins plugins like Timestamper, though as you point out this will do nothing to help cases where decorations are applied by some external tool on the agent such as Maven execution wrappers.

          Jesse Glick added a comment - Possibly this plugin could pick out filenames from other surrounding text using various algorithms. You could use a block-scoped step where you would be able to intercept process output before other decorations are applied by Jenkins plugins like Timestamper, though as you point out this will do nothing to help cases where decorations are applied by some external tool on the agent such as Maven execution wrappers.

          Ulli Hafner added a comment -

          I see. Then I think that I will try to clean up the console log using various line filters before I hand out the result to the individual parsers (block-scoped is on my todo list, but I need a solution for freestyle jobs anyway). I already have a ConsoleNotesFilter and an AnsiColorFilter is on its way. Seems that I need to add an TimeStamperFilter as well.

          Ulli Hafner added a comment - I see. Then I think that I will try to clean up the console log using various line filters before I hand out the result to the individual parsers (block-scoped is on my todo list, but I need a solution for freestyle jobs anyway). I already have a ConsoleNotesFilter and an AnsiColorFilter is on its way. Seems that I need to add an TimeStamperFilter as well.

          Is this issue really fixed? I'm facing a similar issue - if not the same - when using recordIssues together with timestamps in my pipeline. The console log says:

          [Pipeline] recordIssues
          17:43:26 [GNU C Compiler (gcc)] Searching for all files in '/home/jenkins/workspace/navigation/release/cranial4.0/apps/stp/quantum/common/conversation.linux64-gcc.pipeline' that match the pattern 'target/build/build.for_recordIssues.log'
          17:43:26 [GNU C Compiler (gcc)] -> found 1 file
          17:43:26 [GNU C Compiler (gcc)] Successfully parsed file /home/jenkins/workspace/navigation/release/cranial4.0/apps/stp/quantum/common/conversation.linux64-gcc.pipeline/target/build/build.for_recordIssues.log
          17:43:26 [GNU C Compiler (gcc)] -> found 39 issues (skipped 4 duplicates)
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] Can't create fingerprints for some files:
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17
          17:43:27 [GNU C Compiler (gcc)] [-ERROR-] ... skipped logging of 15 additional errors ...
          

          To me it looks like the two digits followed by the colon - which are the hour of the system time - are interpreted as a file name.

          This makes my build red.

          Heiko Nardmann added a comment - Is this issue really fixed? I'm facing a similar issue - if not the same - when using recordIssues together with timestamps in my pipeline. The console log says: [Pipeline] recordIssues 17:43:26 [GNU C Compiler (gcc)] Searching for all files in '/home/jenkins/workspace/navigation/release/cranial4.0/apps/stp/quantum/common/conversation.linux64-gcc.pipeline' that match the pattern 'target/build/build.for_recordIssues.log' 17:43:26 [GNU C Compiler (gcc)] -> found 1 file 17:43:26 [GNU C Compiler (gcc)] Successfully parsed file /home/jenkins/workspace/navigation/release/cranial4.0/apps/stp/quantum/common/conversation.linux64-gcc.pipeline/target/build/build.for_recordIssues.log 17:43:26 [GNU C Compiler (gcc)] -> found 39 issues (skipped 4 duplicates) 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] Can't create fingerprints for some files: 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] - '17', IO exception has been thrown: java.nio.file.NoSuchFileException: 17 17:43:27 [GNU C Compiler (gcc)] [-ERROR-] ... skipped logging of 15 additional errors ... To me it looks like the two digits followed by the colon - which are the hour of the system time - are interpreted as a file name. This makes my build red.

          Ulli Hafner added a comment -

          According to the test case it is fixed: https://github.com/jenkinsci/warnings-ng-plugin/blob/master/plugin/src/test/java/io/jenkins/plugins/analysis/warnings/integrations/TimeStamperPluginITest.java

          What makes me wonder in your case: you seem not to parse the console? Removing of the console log strings is done only for the console log and not for files.

          Ulli Hafner added a comment - According to the test case it is fixed: https://github.com/jenkinsci/warnings-ng-plugin/blob/master/plugin/src/test/java/io/jenkins/plugins/analysis/warnings/integrations/TimeStamperPluginITest.java What makes me wonder in your case: you seem not to parse the console? Removing of the console log strings is done only for the console log and not for files.

            smokris Steve Mokris
            smokris Steve Mokris
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: