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

Pipeline Job Plugin (workflow-job-plugin) gives empty console output when an error occurs

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When upgrading to version 2.29 of the "Pipeline: Job" plugin, users had a completely empty console output in case of an error.

      Downgrading to version 2.28 fixed the issue.

      When investigating we found an error log that a log file could not be located:

      java.io.FileNotFoundException: /var/lib/jenkins/jobs/iText-merge-pipeline/builds/319/log (No such file or directory)

      See attachments for screenshots of the console output and the log.

      If I read the change log for version 2.29 

      • JENKINS-54128: Change the implementation of WorkflowRun#getLogFile to avoid creating a new temporary file each time the method is called.
      • Fix: Do not call WorkflowRun#getLogFile when an error occurs while opening the log file for a Pipeline to avoid logging an additional stack trace

      My guess would be that WorkflowRun#getLogFile is also not called when an error is thrown in a pipeline script.

        Attachments

          Issue Links

            Activity

            Hide
            marco_andries Marco Andries added a comment -

            Amedee Van Gasse, yes I believe you answered all questions.

            Show
            marco_andries Marco Andries added a comment - Amedee Van Gasse , yes I believe you answered all questions.
            Hide
            marco_andries Marco Andries added a comment -

            Due to circumstances we needed to update the plugin and now we are experiencing that the console output is empty when the job is completed not only for failed jobs but also for aborted and successful jobs.

            I think to have found the issue we're experiencing.....

            I saw the following when I look at the logs of a stage:

            When I check that location, I find the following:

            + ls -l /var/lib/jenkins/jobs/iText_7_Java/jobs/itextcore/branches/feature-QA-1892-3.0d3g52/builds/3
            total 288
            drwxr-xr-x 3 jenkins jenkins 16 Jun 5 14:42 archive
            rw-rr- 1 jenkins jenkins 54829 Jun 5 14:43 build.xml
            rw-rr- 1 jenkins jenkins 0 Jun 5 14:42 changelog0.xml
            rw-rr- 1 jenkins jenkins 39174 Jun 5 14:43 log.gz
            rw-rr- 1 jenkins jenkins 329 Jun 5 14:43 log-index
            rw-rr- 1 jenkins jenkins 58 Jun 5 14:43 open-tasks-fixed.xml
            rw-rr- 1 jenkins jenkins 171277 Jun 5 14:43 open-tasks.xml
            drwxr-xr-x 2 jenkins jenkins 8192 Jun 5 14:43 workflow
            drwxr-xr-x 2 jenkins jenkins 4096 Jun 5 14:42 workspace-files

            The log file is indeed not there but there's a log.gz file.

            I extracted the file running the following command: gzip -d /var/lib/jenkins/jobs/iText_7_Java/jobs/itextcore/branches/feature-QA-1892-3.0d3g52/builds/3/log.gz

            And now the console output is no longer empty and the stage log is also correct:

            So it seems there's an issue with packing and unpacking the log.

            Hope this helps....

            Show
            marco_andries Marco Andries added a comment - Due to circumstances we needed to update the plugin and now we are experiencing that the console output is empty when the job is completed not only for failed jobs but also for aborted and successful jobs. I think to have found the issue we're experiencing..... I saw the following when I look at the logs of a stage: When I check that location, I find the following: + ls -l /var/lib/jenkins/jobs/iText_7_Java/jobs/itextcore/branches/feature-QA-1892-3.0d3g52/builds/3 total 288 drwxr-xr-x 3 jenkins jenkins 16 Jun 5 14:42 archive rw-r r - 1 jenkins jenkins 54829 Jun 5 14:43 build.xml rw-r r - 1 jenkins jenkins 0 Jun 5 14:42 changelog0.xml rw-r r - 1 jenkins jenkins 39174 Jun 5 14:43 log.gz rw-r r - 1 jenkins jenkins 329 Jun 5 14:43 log-index rw-r r - 1 jenkins jenkins 58 Jun 5 14:43 open-tasks-fixed.xml rw-r r - 1 jenkins jenkins 171277 Jun 5 14:43 open-tasks.xml drwxr-xr-x 2 jenkins jenkins 8192 Jun 5 14:43 workflow drwxr-xr-x 2 jenkins jenkins 4096 Jun 5 14:42 workspace-files The log file is indeed not there but there's a log.gz file. I extracted the file running the following command: gzip -d /var/lib/jenkins/jobs/iText_7_Java/jobs/itextcore/branches/feature-QA-1892-3.0d3g52/builds/3/log.gz And now the console output is no longer empty and the stage log is also correct: So it seems there's an issue with packing and unpacking the log. Hope this helps....
            Hide
            dnusbaum Devin Nusbaum added a comment - - edited

            Ok, looks like a duplicate of JENKINS-54678. Compressed build logs are not supported by new versions of workflow-job. If your pipelines use compressBuildLog, you should remove that from their Jenkinsfile for now. If the Compress Build Logs plugin has some global option that causes all build logs to be compressed, then you'll have to turn that off as well.

            Show
            dnusbaum Devin Nusbaum added a comment - - edited Ok, looks like a duplicate of  JENKINS-54678 . Compressed build logs are not supported by new versions of workflow-job. If your pipelines use compressBuildLog , you should remove that from their Jenkinsfile for now. If the Compress Build Logs plugin has some global option that causes all build logs to be compressed, then you'll have to turn that off as well.
            Hide
            marco_andries Marco Andries added a comment -

            Devin Nusbaum, thanks for the reply. I will have a look.

            Show
            marco_andries Marco Andries added a comment - Devin Nusbaum , thanks for the reply. I will have a look.
            Hide
            marco_andries Marco Andries added a comment -

            Devin Nusbaum, it seems to solve the issue with the empty console outputs.

            No idea why we first only had it when an error was thrown.

            But now with the plugins completely updated, the console output is there for failed, successful and aborted jobs when "Compress Build Logs" is turned off.

            Thanks!

            Show
            marco_andries Marco Andries added a comment - Devin Nusbaum , it seems to solve the issue with the empty console outputs. No idea why we first only had it when an error was thrown. But now with the plugins completely updated, the console output is there for failed, successful and aborted jobs when "Compress Build Logs" is turned off. Thanks!

              People

              • Assignee:
                Unassigned
                Reporter:
                marco_andries Marco Andries
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: