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

No ANSI coloring on slave agents in pipeline

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed

    Description

      Pipeline:

      node('master'){
          ansiColor('xterm') {
              sh 'echo -e "\033[31mRed\033[0m"'
          }
          wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
              sh 'echo -e "\033[31mRed\033[0m"'
          }
      }
      node('ansible'){
          ansiColor('xterm') {
              sh 'echo -e "\033[31mRed\033[0m"'
          }
          wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
              sh 'echo -e "\033[31mRed\033[0m"'
          }
      }
      

      Output:

       

       

       

      I've verified I see ANSI coloring on a freestyle project restricted to the same 'ansible' label

      Shell build step

       

      echo -e "\033[31mRed\033[0m"
      

      Output

       

       

      I've verified this happens on multiple Jenkins instances running 2.138.2. This started happening after the following plugin updates:

      -rw-r--r--. 1 jenkins jenkins  560808 Oct 12 16:54 workflow-cps.jpi
      -rw-r--r--. 1 jenkins jenkins  111622 Oct 12 16:54 workflow-job.jpi
      -rw-r--r--. 1 jenkins jenkins  311324 Oct 12 16:54 ws-cleanup.jpi
      -rw-r--r--. 1 jenkins jenkins  360909 Oct 12 16:54 workflow-support.jpi
      

       

       

      Attachments

        1. image.png
          220 kB
          Viacheslav Subotskyi
        2. Screen Shot 2018-10-17 at 11.17.21 AM.png
          230 kB
          Ben Specht
        3. Screen Shot 2018-10-17 at 11.26.10 AM.png
          45 kB
          Ben Specht

        Issue Links

          Activity

            Delivered in pipeline-maven-plugin 3.6.0

            cleclerc Cyrille Le Clerc added a comment - Delivered in pipeline-maven-plugin 3.6.0
            jglick Jesse Glick added a comment -

            Thus the fixes for ant and pipeline-maven have been released; as well as the hotfix of this issue as originally filed for ansicolor (PRs 128 & 130), though the full fix through rewrite (PR 132) which is merged but not yet released by dnusbaum (and which also requires a post-LTS version of Jenkins core).

            jglick Jesse Glick added a comment - Thus the fixes for ant and pipeline-maven have been released; as well as the hotfix of this issue as originally filed for ansicolor (PRs 128 & 130), though the full fix through rewrite (PR 132) which is merged but not yet released by dnusbaum (and which also requires a post-LTS version of Jenkins core).
            dnusbaum Devin Nusbaum added a comment -

            jglick I just released the full fix for ansicolor in version 0.6.0 of the plugin.

            dnusbaum Devin Nusbaum added a comment - jglick I just released the full fix for ansicolor in version 0.6.0 of the plugin.
            toisen Konstantin Berndikov added a comment - - edited

            I have reproduced the issue with Jenkins 2.332.1 and AnsiColor 1.0.1. The nodes are started with bash and they are using WebSocket connection if that matters. The node executes jar-file which prints color coded messages in log. Everything is fine on master, but no colors or color escape sequences in the output for nodes.

            Jenkins version: 2.332.1
            JDK: openjdk-11+28
            OS: Oracle Linux Server 7.9

            toisen Konstantin Berndikov added a comment - - edited I have reproduced the issue with  Jenkins 2.332.1  and AnsiColor 1.0.1. The nodes are started with bash and they are using WebSocket connection if that matters. The node executes jar-file which prints color coded messages in log. Everything is fine on master, but no colors or color escape sequences in the output for nodes. Jenkins version: 2.332.1 JDK: openjdk-11+28 OS: Oracle Linux Server 7.9
            jglick Jesse Glick added a comment -

            toisen best to file a fresh issue linked to this one with steps to reproduce from scratch.

            jglick Jesse Glick added a comment - toisen best to file a fresh issue linked to this one with steps to reproduce from scratch.

            People

              jglick Jesse Glick
              bspecht Ben Specht
              Votes:
              3 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: