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

          Activity

          Hide
          dnusbaum Devin Nusbaum added a comment -

          I don't think the changes in workflow-job 2.29 and workflow-api 2.32 related to WorkflowRun#getLogFile are related to an empty console view, since the WorkflowRun#getLogFile method is not actually used when displaying logs.

          The stack trace you posted shows that the call to new RandomAccessFile here threw a FileNotFoundException when trying to open the logs for a step because the log file did not exist. What does the build folder for the build look like? Does the log file exist? Are there any other errors in the Jenkins logs that seem relevant? It seems like something else might have deleted that file, but I am not sure what could have caused it. Do you know if the build that was broken was building when Jenkins was restarted for the plugin update, or had it already completed? CC Jesse Glick in case this scenario rings a bell to him.

          Show
          dnusbaum Devin Nusbaum added a comment - I don't think the changes in workflow-job 2.29 and workflow-api 2.32 related to WorkflowRun#getLogFile are related to an empty console view, since the WorkflowRun#getLogFile method is not actually used when displaying logs. The stack trace you posted shows that the call to new RandomAccessFile here threw a FileNotFoundException when trying to open the logs for a step because the log file did not exist. What does the build folder for the build look like? Does the log file exist? Are there any other errors in the Jenkins logs that seem relevant? It seems like something else might have deleted that file, but I am not sure what could have caused it. Do you know if the build that was broken was building when Jenkins was restarted for the plugin update, or had it already completed? CC Jesse Glick in case this scenario rings a bell to him.
          Hide
          beyerj Jens Beyer added a comment - - edited

          Regarding the exception:

          The new workflow-job 2.31 (compared to 2.25) does not write the log files for the individual steps anymore. At least on my system.

          For new builds started after the upgrade, the individual build step logs seem to work without the individual build step log files.

          But for builds finished before the upgrade, after the upgrade is done, you are unable to get the full build step logs, and the mentioned exception occurs.

           

          Regarding the empty console: I opened JENKINS-55465 which may also be the reason for your issue.

          Show
          beyerj Jens Beyer added a comment - - edited Regarding the exception: The new workflow-job 2.31 (compared to 2.25) does not write the log files for the individual steps anymore. At least on my system. For new builds started after the upgrade, the individual build step logs seem to work without the individual build step log files. But for builds finished before the upgrade, after the upgrade is done, you are unable to get the full build step logs, and the mentioned exception occurs.   Regarding the empty console: I opened JENKINS-55465 which may also be the reason for your issue.
          Hide
          dnusbaum Devin Nusbaum added a comment -

          But for builds finished before the upgrade, after the upgrade is done, you are unable to get the full build step logs, and the mentioned exception occurs.

          For builds before the upgrade, the full build log should work ok (some markup will not be displayed correctly), but the step logs are expected to be broken. Is that what you are seeing? I am not quite sure what you mean by "full build step logs".

          Show
          dnusbaum Devin Nusbaum added a comment - But for builds finished before the upgrade, after the upgrade is done, you are unable to get the full build step logs, and the mentioned exception occurs. For builds before the upgrade, the full build log should work ok (some markup will not be displayed correctly), but the step logs are expected to be broken. Is that what you are seeing? I am not quite sure what you mean by "full build step logs".
          Hide
          beyerj Jens Beyer added a comment -

          Devin Nusbaum Sorry I just realized that my issue with the build step logs (the first one I mentioned) was probably also caused by the full console issue with compressedBuildLog (JENKINS-55465, the second one I mentioned). Please disregard.

          Show
          beyerj Jens Beyer added a comment - Devin Nusbaum Sorry I just realized that my issue with the build step logs (the first one I mentioned) was probably also caused by the full console issue with compressedBuildLog ( JENKINS-55465 , the second one I mentioned). Please disregard.
          Hide
          jglick Jesse Glick added a comment -

          After the back and forth here, I am unclear on what the status of this is. Do we have a reproducible bug?

          Show
          jglick Jesse Glick added a comment - After the back and forth here, I am unclear on what the status of this is. Do we have a reproducible bug?
          Hide
          dnusbaum Devin Nusbaum added a comment -

          Jesse Glick Nothing reproducible that I am aware of other than the duplicate related to compressBuildLog. Marco Andries are you still seeing this issue? If so, can you answer the questions in my earlier comment and perhaps attach the Pipeline script that is failing so we can see what it is doing? I am going to close this as incomplete for now, but please feel free to reopen it if you are able to provide additional data.

          Show
          dnusbaum Devin Nusbaum added a comment - Jesse Glick Nothing reproducible that I am aware of other than the duplicate related to compressBuildLog . Marco Andries are you still seeing this issue? If so, can you answer the questions in my earlier comment and perhaps attach the Pipeline script that is failing so we can see what it is doing? I am going to close this as incomplete for now, but please feel free to reopen it if you are able to provide additional data.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: