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

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

      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.

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

          Marco Andries created issue -

          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 jglick in case this scenario rings a bell to him.

          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 jglick in case this scenario rings a bell to him.
          Vivek Pandey made changes -
          Labels Original: pipeline plugin New: pipeline pipeline-triaged plugin

          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.

          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.

          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".

          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".

          Jens Beyer added a comment -

          dnusbaum 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.

          Jens Beyer added a comment - dnusbaum 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.

          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?

          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?

          Devin Nusbaum added a comment -

          jglick 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.

          Devin Nusbaum added a comment - jglick 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.
          Devin Nusbaum made changes -
          Resolution New: Incomplete [ 4 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Amedee Van Gasse added a comment - - edited

          Hi! I am a colleague of Marco. Looks like we abandoned this issue, I am sorry about that. Other fish to fry at the time because we had a workaround.

          The issue has resurfaced because the Warnings Next Generations plugin is dependent on a Pipeline Job plugin > 2.28.

          I will be taking over this issue and answering all your questions about additional information until we get to a solution.

          I previously wasn't involved with reporting this issue so it is possible that I will be asking things that have already been asked before, please bear with me.

          Amedee Van Gasse added a comment - - edited Hi! I am a colleague of Marco. Looks like we abandoned this issue, I am sorry about that. Other fish to fry at the time because we had a workaround. The issue has resurfaced because the Warnings Next Generations plugin is dependent on a Pipeline Job plugin > 2.28. I will be taking over this issue and answering all your questions about additional information until we get to a solution. I previously wasn't involved with reporting this issue so it is possible that I will be asking things that have already been asked before, please bear with me.

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

              Created:
              Updated:
              Resolved: