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

Warnings-ng plugin cannot parse my console output containing "Entering directory"

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • analysis-model
    • Jenkins - 2.362
      Analysis Model API 10.15.0
      Warnings Next Generation Plugin - 9.15.0

      Unfortunately my application uses an external library (mindterm) which also generates the same output in junit nightly build console, which is expected from make in analysis-model plugin:
      ..
      2022-08-04 08:17:45,975 [ 102] TRACE ch.post.pf.ndepo.service.remote.SSHTransfer - Stdout for job SSHtransfer_1.1659593865537 initialized.
      2022-08-04 08:17:45,975 [ 102] TRACE ch.post.pf.ndepo.service.remote.SSHTransfer - Transfer >>/tmp/testDir806422480360626789<< to a remote host destination >>testDistDir-5874342317266424232<<
      Entering directory /tmp/testDir806422480360626789
      ...
      see https://github.com/jenkinsci/analysis-model/commit/d29ee72bb116bf3930aca0de45bacab573a11a7a

      Error message / Stack trace:
      ...
      [Java Compiler] Sleeping for 5 seconds due to JENKINS-32191...
      [Java Compiler] Parsing console log (workspace: '/home/depotest/mvn_nightly_hudson/data/workspace/nightly_02_ndepo_master')
      ERROR: Build step failed with exception
      edu.hm.hafner.analysis.ParsingException: Unable to change directory using: .Entering directory [`'](?<dir>.)['`] to match Entering directory /tmp/testDir806422480360626789
      at edu.hm.hafner.analysis.LookaheadParser.extractDirectory(LookaheadParser.java:157)
      at edu.hm.hafner.analysis.LookaheadParser.enterDirectory(LookaheadParser.java:92)
      at edu.hm.hafner.analysis.LookaheadParser.handleDirectoryChanges(LookaheadParser.java:123)
      at edu.hm.hafner.analysis.LookaheadParser.parse(LookaheadParser.java:68)
      at edu.hm.hafner.analysis.LookaheadParser.parse(LookaheadParser.java:57)
      at edu.hm.hafner.analysis.registry.CompositeParserDescriptor$CompositeParser.parse(CompositeParserDescriptor.java:84)
      at io.jenkins.plugins.analysis.core.model.ReportScanningTool.scanInConsoleLog(ReportScanningTool.java:191)
      at io.jenkins.plugins.analysis.core.model.ReportScanningTool.scan(ReportScanningTool.java:138)
      at io.jenkins.plugins.analysis.core.model.ReportScanningTool.scan(ReportScanningTool.java:130)
      at io.jenkins.plugins.analysis.core.steps.IssuesScanner.scan(IssuesScanner.java:101)
      at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.scanWithTool(IssuesRecorder.java:793)
      at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.record(IssuesRecorder.java:757)
      at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.perform(IssuesRecorder.java:726)
      at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.perform(IssuesRecorder.java:702)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:816)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:765)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:709)
      at hudson.model.Run.execute(Run.java:1924)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
      at hudson.model.ResourceController.execute(ResourceController.java:107)
      at hudson.model.Executor.run(Executor.java:449)
      Build step 'Record compiler warnings and static analysis results' marked build as failure
      ...

          [JENKINS-69242] Warnings-ng plugin cannot parse my console output containing "Entering directory"

          Ulli Hafner added a comment -

          Thanks, seems like another corner case for that part of the code. Interested in improving the regular expression?

          Ulli Hafner added a comment - Thanks, seems like another corner case for that part of the code. Interested in improving the regular expression?

          Dean Milo added a comment -

          my workaround for the moment was to downgrade "Analysis Model API" to 10.0.0 and "Warnings Next Generation Plugin" to 9.0.1

          Dean Milo added a comment - my workaround for the moment was to downgrade "Analysis Model API" to 10.0.0 and "Warnings Next Generation Plugin" to 9.0.1

          Eric Beuque added a comment -

          Hi,

          i got the same issue due to a custom script with the following command line :

          echo "-- Entering directory ${PATH_BUILD}"

          Which output something like this :

          -- Entering directory build

          I changed my script to this line and it's working.

          echo "-- Entering in directory ${PATH_BUILD}"

          But this will be blocking if the script or the program log cannot be changed by user.

          Eric Beuque added a comment - Hi, i got the same issue due to a custom script with the following command line : echo "-- Entering directory ${PATH_BUILD}" Which output something like this : -- Entering directory build I changed my script to this line and it's working. echo "-- Entering in directory ${PATH_BUILD}" But this will be blocking if the script or the program log cannot be changed by user.

          Subhash Rawat added a comment - - edited

          Hi drulli, I would like to pick up this task. Is it ok? I am a newbie want to learn and contribute.

          Subhash Rawat added a comment - - edited Hi drulli , I would like to pick up this task. Is it ok? I am a newbie want to learn and contribute.

          Ulli Hafner added a comment -

          Yes, please go ahead!

          This issue can be solved by creating a new test case for https://github.com/jenkinsci/analysis-model that contains the examples in the comments above. Then the parser needs to be adapted until the tests succeed.

          (You can also see the results in Jenkins by setting up https://github.com/uhafner/warnings-ng-plugin-devenv, but this is not required for an issue that affects the out put of a parser only.)

          Ulli Hafner added a comment - Yes, please go ahead! This issue can be solved by creating a new test case for https://github.com/jenkinsci/analysis-model that contains the examples in the comments above. Then the parser needs to be adapted until the tests succeed. (You can also see the results in Jenkins by setting up https://github.com/uhafner/warnings-ng-plugin-devenv , but this is not required for an issue that affects the out put of a parser only.)

            shubzz Subhash Rawat
            dean_milo Dean Milo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: