• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • Jenkins 2.138.3
      Pipeline Multibranch with defaults 2.0
      Pipeline Multibranch Plugin 2.20
      Build Pipeline Plugin 1.58

      The logs in /job/master/167/console are shown when the build is in progress.
      After it has finished I see nothing. Only a black narrow bar.
      The BlueOcen shows me this stacktrace

      java.io.FileNotFoundException: /var/lib/jenkins/jobs/Invoice/branches/master/builds/166/log (No such file or directory)
      
      	at java.io.RandomAccessFile.open0(Native Method)
      
      	at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
      
      	at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
      
      	at org.jenkinsci.plugins.workflow.log.FileLogStorage.stepLog(FileLogStorage.java:259)
      
      	at org.jenkinsci.plugins.workflow.support.actions.LogStorageAction.getLogText(LogStorageAction.java:62)
      
      	at io.jenkins.blueocean.rest.impl.pipeline.PipelineStepImpl.getLog(PipelineStepImpl.java:139)
      
      	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
      
      

          [JENKINS-54678] Compression trick not supported by JEP-210

          Same problem spotted on 2.138.2

          Thomas Vuillaume added a comment - Same problem spotted on 2.138.2

          Tibor Digana added a comment -

          jglick
          Who should handle this issue?
          I am doing an internal workshop in my company about Jenkins on December 3rd and this issue is a big problem.

          Tibor Digana added a comment - jglick Who should handle this issue? I am doing an internal workshop in my company about Jenkins on December 3rd and this issue is a big problem.

          Thomas Vuillaume added a comment - - edited

          I'm sharing my Pipeline file so that we can move on (and maybe found a root cause).

           

          Anyway, this is pretty strange because we have 2 different Jenkins here. Both of them are on 2.138.2, both of them use Pipeline Build 1.5.8. Both of them use a pipeline to build, but not the same pipeline.

           

          Only one faces the issue (the one which uses the pipeline I added to this ticket)

          Thomas Vuillaume added a comment - - edited I'm sharing my Pipeline file so that we can move on (and maybe found a root cause).   Anyway, this is pretty strange because we have 2 different Jenkins here. Both of them are on 2.138.2, both of them use Pipeline Build 1.5.8. Both of them use a pipeline to build, but not the same pipeline.   Only one faces the issue (the one which uses the pipeline I added to this ticket)

          Jesse Glick added a comment -

          I presume

          compressBuildLog()
          

          is to blame. Try deleting that and uninstalling this plugin. Its Pipeline compatibility should be removed, as it will not work as of workflow-job 2.26.

          Jesse Glick added a comment - I presume compressBuildLog() is to blame. Try deleting that and uninstalling this plugin. Its Pipeline compatibility should be removed, as it will not work as of workflow-job 2.26.

          Confirmed !

           

          Thanks jglick, this did work ! I removed the compressBuildLog() and uninstalled the pluggin.

          I guess tibor17 will be pleased to have been saved before the 3rd of December !

          Many thanks !

          Thomas Vuillaume added a comment - Confirmed !   Thanks jglick , this did work ! I removed the compressBuildLog() and uninstalled the pluggin. I guess tibor17 will be pleased to have been saved before the 3rd of December ! Many thanks !

          Jesse Glick added a comment -

          Note that JEP-210 defines a beta, but supported, API for properly replacing build log storage as a whole, which theoretically this plugin could implement via log.gz. (Run.getLogFile is slated to be deprecated and is not supported by new versions of Pipeline.) That said, if you are compressing build logs because you are concerned about storage space on the master, the way forward is likely to be cloud log storage, as in the recently released pipeline-cloudwatch-logs plugin.

          Jesse Glick added a comment - Note that JEP-210 defines a beta, but supported, API for properly replacing build log storage as a whole, which theoretically this plugin could implement via log.gz . ( Run.getLogFile is slated to be deprecated and is not supported by new versions of Pipeline.) That said, if you are compressing build logs because you are concerned about storage space on the master, the way forward is likely to be cloud log storage, as in the recently released pipeline-cloudwatch-logs plugin.

          As I noted in the other report, downgrading Pipeline: Job Plugin to 2.25 did restore correct behavior.  We did not see removing compressBuildLog() as an option, as we would lose console access to historic logs already compressed. 

          After consideration, we are going to remove compressBuildLog() from our pipeline standard, as it isn't buying us much in terms of space, and plan to upgrade Job Plugin in a few weeks as old compressed build logs will be rotated off the system or otherwise not too useful to look at.

          Brant Niggemyer added a comment - As I noted in the other report, downgrading Pipeline: Job Plugin to 2.25 did restore correct behavior.  We did not see removing compressBuildLog() as an option, as we would lose console access to historic logs already compressed.  After consideration, we are going to remove compressBuildLog() from our pipeline standard, as it isn't buying us much in terms of space, and plan to upgrade Job Plugin in a few weeks as old compressed build logs will be rotated off the system or otherwise not too useful to look at.

          Jesse Glick added a comment -

          we would lose console access to historic logs already compressed

          Untested:

          find $JENKINS_HOME -name log.gz -print0 | xargs -0 -n1 gunzip
          

          Jesse Glick added a comment - we would lose console access to historic logs already compressed Untested: find $JENKINS_HOME -name log.gz -print0 | xargs -0 -n1 gunzip

          Tibor Digana added a comment - - edited

          I have updated all plugins in my Jenkins, and removed the function compressBuildLog() from my Jenkinsfile.
          Now the logs are back again as expected.
          jglick I think there was some environment variable to limit the the log size. Where can I find it? And second question, is the plugin logfilesizechecker safe to use?

          Tibor Digana added a comment - - edited I have updated all plugins in my Jenkins, and removed the function compressBuildLog() from my Jenkinsfile . Now the logs are back again as expected. jglick I think there was some environment variable to limit the the log size. Where can I find it? And second question, is the plugin logfilesizechecker safe to use?

          Tibor Digana added a comment -

          jglick How can i override MAX_LINES_READ in Jenkinsfile?
          Could not find a snippet code in documentation, only mentioning the constant in release notes.

          Tibor Digana added a comment - jglick How can i override MAX_LINES_READ in Jenkinsfile? Could not find a snippet code in documentation, only mentioning the constant in release notes.

          Jesse Glick added a comment -

          I think there was some environment variable to limit the the log size. Where can I find it?

          I am not aware of any such variable, and cannot guess what it would do.

          is the plugin logfilesizechecker safe to use?

          That is using Run.getLogText so it ought to work. (I have not tried.)

          How can i override MAX_LINES_READ in Jenkinsfile?

          I do not know what that variable is or what you think it should be doing. Probably unrelated to this issue—should be asked on the users’ list etc.

          Jesse Glick added a comment - I think there was some environment variable to limit the the log size. Where can I find it? I am not aware of any such variable, and cannot guess what it would do. is the plugin logfilesizechecker safe to use? That is using Run.getLogText so it ought to work. (I have not tried.) How can i override MAX_LINES_READ in Jenkinsfile? I do not know what that variable is or what you think it should be doing. Probably unrelated to this issue—should be asked on the users’ list etc.

          Rick de Vries added a comment - - edited

          Renaming the 'log.gz' to 'log' also makes it possible for jenkins to render the log.

          This way you dont have to unzip the log (which saves diskspace)

           

          Rick de Vries added a comment - - edited Renaming the 'log.gz' to 'log' also makes it possible for jenkins to render the log. This way you dont have to unzip the log (which saves diskspace)  

          Rick de Vries added a comment -

          Any ETA on when this is going to be fixed?

          Rick de Vries added a comment - Any ETA on when this is going to be fixed?

          Igor Sarkisov added a comment -

          What's the solution here, is it as simple as having compressed log stored as log vs log.gz?

          Igor Sarkisov added a comment - What's the solution here, is it as simple as having compressed log stored as log vs log.gz?

          Jesse Glick added a comment -

          No, it is not.

          Jesse Glick added a comment - No, it is not.

          Ralf Gerasch added a comment -

          if resulting file log.gz is renamed to log jenkins is able to show the log content.

          Ralf Gerasch added a comment - if resulting file log.gz is renamed to log jenkins is able to show the log content.

          akostadinov added a comment -

          Yeah, I can confirm that keeping the file name `log` even though it is compressed, keeps things working.

          Can't it just create a symlink log -> log.gz ?

          jglick, any plan to fix it?

          akostadinov added a comment - Yeah, I can confirm that keeping the file name `log` even though it is compressed, keeps things working. Can't it just create a symlink log -> log.gz ? jglick , any plan to fix it?

          Jesse Glick added a comment -

          jglick, any plan to fix it?

          Me? No, I do not work on this plugin. If it has a maintainer, it would be up to them.

          Jesse Glick added a comment - jglick , any plan to fix it? Me? No, I do not work on this plugin. If it has a maintainer, it would be up to them.

          akostadinov the plugin is marked as "up for adoption": https://plugins.jenkins.io/compress-buildlog/

          Looks like its main developer (also some tickets here in Jira are still assigned to him) was danielbeck. He could maybe give some light there.

          Francisco Robles Martin added a comment - akostadinov the plugin is marked as "up for adoption":  https://plugins.jenkins.io/compress-buildlog/ Looks like its main developer (also some tickets here in Jira are still assigned to him) was danielbeck . He could maybe give some light there.

          Daniel Beck added a comment -

          I plan to release https://github.com/jenkinsci/compress-buildlog-plugin/pull/10 soon, which just drops Pipeline support. I am not currently interested in implementing support for it, and that way the plugin at least works for other use cases.

          Daniel Beck added a comment - I plan to release https://github.com/jenkinsci/compress-buildlog-plugin/pull/10 soon, which just drops Pipeline support. I am not currently interested in implementing support for it, and that way the plugin at least works for other use cases.

          I opened a PR on the plugin to create a symlink log -> log.gz. Hopefully it resolves this issue.
          https://github.com/jenkinsci/compress-buildlog-plugin/pull/11

          Adam Brousseau added a comment - I opened a PR on the plugin to create a symlink log -> log.gz. Hopefully it resolves this issue. https://github.com/jenkinsci/compress-buildlog-plugin/pull/11

          Jesse Glick added a comment -

          An implementation of this would be an implementation of https://www.jenkins.io/doc/developer/extensions/workflow-api/#logstoragefactory derived from https://github.com/jenkinsci/workflow-api-plugin/blob/2e0755dc5d8de75d2e4d42a4aade18a18a1c9e11/src/main/java/org/jenkinsci/plugins/workflow/log/FileLogStorage.java but adding a compression layer (presumably only to the main log file and not the index file which is much smaller).

          Jesse Glick added a comment - An implementation of this would be an implementation of https://www.jenkins.io/doc/developer/extensions/workflow-api/#logstoragefactory derived from https://github.com/jenkinsci/workflow-api-plugin/blob/2e0755dc5d8de75d2e4d42a4aade18a18a1c9e11/src/main/java/org/jenkinsci/plugins/workflow/log/FileLogStorage.java but adding a compression layer (presumably only to the main log file and not the index file which is much smaller).

          bright.ma added a comment -

          pipeline build log not support to be compressed, my workaround:  ZFS on ubuntu,  " zfs set compress=lz4  work/jenkins_home"

          see https://docs.oracle.com/cd/E53394_01/html/E54801/gpxis.html

          bright.ma added a comment - pipeline build log not support to be compressed, my workaround:  ZFS on ubuntu,  " zfs set compress=lz4  work/jenkins_home" see https://docs.oracle.com/cd/E53394_01/html/E54801/gpxis.html

            Unassigned Unassigned
            tibor17 Tibor Digana
            Votes:
            34 Vote for this issue
            Watchers:
            39 Start watching this issue

              Created:
              Updated: