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

Logs contain garbage

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Component/s: blueocean-plugin
    • Labels:
      None
    • Environment:
      Jenkins version: 1.6.2 Core 2.130 807049f 29th June 2018 04:50 PM
      Installed plugins:
      active-directory:2.8
      blueocean:1.6.2
      job-dsl:1.70
      permissive-script-security:0.3
    • Similar Issues:

      Description

      When I run a simple pipeline, build log file contains a lot of weird garbage like:

      Running on ha:////4HJCv54c0lEgrV1wLb6n/KPfVX0OOg22E88oNYy/23LcAAAAnh+LCAAAAAAAAP9b85aBtbiIQTGjNKU4P08vOT+vOD8nVc83PyU1x6OyILUoJzMv2y+/JJUBAhiZGBgqihhk0NSjKDWzXb3RdlLBUSYGJk8GtpzUvPSSDB8G5tKinBIGIZ+sxLJE/ZzEvHT94JKizLx0a6BxUmjGOUNodHsLgAz2EgZh/eT83ILSktQifY3cxGIgrakPAHib2iPIAAAAJenkins in /var/jenkins_home/workspace/test_master-YKUBYJHFWV5SAO5BKANKYXEX6RUGQUBB2GGZLHYPHNUKZELZPATQ
      ha:////4NMRX/2zQkjhhEu6irGOh5x53sMa6+wSWt6/G2k7asfQAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] {
      ha:////4NMRX/2zQkjhhEu6irGOh5x53sMa6+wSWt6/G2k7asfQAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] load
      ha:////4NMRX/2zQkjhhEu6irGOh5x53sMa6+wSWt6/G2k7asfQAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] { (/var/jenkins_home/utils.groovy)
      ha:////4NMRX/2zQkjhhEu6irGOh5x53sMa6+wSWt6/G2k7asfQAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] }
      ha:////4NMRX/2zQkjhhEu6irGOh5x53sMa6+wSWt6/G2k7asfQAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] // load
      ha:////4NMRX/2zQkjhhEu6irGOh5x53sMa6+wSWt6/G2k7asfQAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] input
      ha:////4OmDVHI4o91ZSUbNBxKnSZZ3rCykVdQyv1wNpspeTGhXAAAAmh+LCAAAAAAAAP9b85aBtbiIQSajNKU4P08vOT+vOD8nVc+jsiC1KCczL9svvyTVzHb1RttJBUeZGJg8GdhyUvPSSzJ8GJhLi3JKGIR8shLLEvVzEvPS9YNLijLz0q0rihik0IxzhtAgwxgggJGJgaGiAMjgL2GQ1c/KT9IvSS0uATNyE4tLUov0jfQz8wpKS/QB8YXTXqIAAAA=Input requested
      Approved by ha:////4IgQ6im0TubWfaT0AVJclPYdZ4HG/+5dO2zwE4cZPZ33AAAAmx+LCAAAAAAAAP9b85aBtbiIQTGjNKU4P08vOT+vOD8nVc83PyU1x6OyILUoJzMv2y+/JJUBAhiZGBgqihhk0NSjKDWzXb3RdlLBUSYGJk8GtpzUvPSSDB8G5tKinBIGIZ+sxLJE/ZzEvHT94JKizLx0a6BxUmjGOUNodHsLgAyhEgZ+/dLi1CL94oLS9MTkjNQyADPTtQHEAAAAStanislav Pugachev

      When I browse same log as standard "Console Output" - everything is fine

      When I browse same log as pipeline.log in BlueOcean view - everything is fine as well.

      Is there a way to get log in format which pipeline.log file has?

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          It's not a garbage, this is a binary annotation data (e.g. Pipeline sections, text color, etc.).

          If you want to get plain text log without annotations, use...

          Hopefully it helps

          Show
          oleg_nenashev Oleg Nenashev added a comment - It's not a garbage, this is a binary annotation data (e.g. Pipeline sections, text color, etc.). If you want to get plain text log without annotations, use...  BUILD_URL/consoleText endpoint ("View as plain text action") "console" command in CLI: https://jenkins.io/doc/book/managing/cli/#console Hopefully it helps
          Hide
          spugachev Stanislav Pugachov added a comment - - edited

          Hi Oleg Nenashev,

           

          Thank you for your reply.

           

          Your solutions are not an option for me because they require authentication.

          But i just want to collect the log programatically, preferably by groovy code-snippet.

          Is this possible?

          The only way I can see is https://javadoc.jenkins-ci.org/hudson/model/Run.html#getLog-int-

          But it doesn't solve the problem..

          Its weird that 'job' has no way to get its own "clean log" 

           

          Thanks

          Show
          spugachev Stanislav Pugachov added a comment - - edited Hi Oleg Nenashev ,   Thank you for your reply.   Your solutions are not an option for me because they require authentication. But i just want to collect the log programatically, preferably by groovy code-snippet. Is this possible? The only way I can see is https://javadoc.jenkins-ci.org/hudson/model/Run.html#getLog-int- But it doesn't solve the problem.. Its weird that 'job' has no way to get its own "clean log"    Thanks
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          There is a way to do that. Run#getLogText().writePlainText or so. No access to the laptop now

          Show
          oleg_nenashev Oleg Nenashev added a comment - There is a way to do that. Run#getLogText().writePlainText or so. No access to the laptop now
          Hide
          spugachev Stanislav Pugachov added a comment - - edited

          you are right,

          def baos = new ByteArrayOutputStream()
          currentBuild.rawBuild.getLogText().writeLogTo(0, baos)
          println(baos.toString())
          

          works like a charm,

          Thanks, sorry for bothering.

          Show
          spugachev Stanislav Pugachov added a comment - - edited you are right, def baos = new ByteArrayOutputStream() currentBuild.rawBuild.getLogText().writeLogTo(0, baos) println(baos.toString()) works like a charm, Thanks, sorry for bothering.
          Show
          spugachev Stanislav Pugachov added a comment - doc reference is  https://javadoc.jenkins.io/hudson/console/AnnotatedLargeText.html

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            spugachev Stanislav Pugachov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: