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

ansicolor 0.6.0 shows terminal escape sequences in console log

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • ansicolor-plugin
    • Jenkins version: 2.150.1
      JDK: OpenJDK Runtime Environment 1.8.0_191-8u191-b12-0ubuntu0.16.04.1-b12
      OS: Ubuntu 16.04.5 LTS
      ansicolor 0.6.0
      timestamper 1.8.10
    • ansicolor 0.6.2

      Since I updated the ansicolor plugin to 0.6.0, I see escape sequences in the terminal log (the log is from an ansible-playbook run):

      consoleText in WebUI:
      ok: [essf0desc]

      log file:
      [[0;32mok: [essf0desc][[0m

      When i downgrade the ansicolor plugin to 0.5.3, I don't see the escape sequences in the log:

      consoleText in WebUI:
      ok: [essf0desc]

      log file:
      [[8mha:////4GByXBh6D5sO4uIaL/Xvo6rBHYkdqIOcMtgU7KVDnLnuAAAApR+LCAAAAAAAAP9b85aBtbiIQT2jNKU4P0+vIKc0PTOvWC8xrzgzOT8nv0gvODO3ICfVoyQ3xy+/JNU2Yj/Tagmf50wMjD4M7CWJ6SCJEgYhn6zEskT9nMS8dP3gkqLMvHTriiIGKaihyfl5xfk5qXrOEBpkDgMEMDIxMFQUlDDI2RQXJOYpFJdU5qTaKoEttlJQNjBwdjEwsFayAwAsE8VZpQAAAA==[[0mok: [essf0desc][[8mha:////4MLkG6V+s9c4kbbINbBZTN8IdUcULVaJJVRaElSmS5VEAAAAkR+LCAAAAAAAAP9b85aBtbiIQT2jNKU4P0+vIKc0PTOvWC8xrzgzOT8nv0gvODO3ICfVoyQ3xy+/JNU2Yj/Tagmf50wMjD4M7CWJ6SCJEgYhn6zEskT9nMS8dP3gkqLMvHTriiIGKaihyfl5xfk5qXrOEBpkDgMEMDIxMFQUlDCw2+gXFyTm2QEAI9P8iI4AAAA=[[0m

      The log output let me assume that the changes in 0.6.0 maybe interference with the timestamper plugin.

          [JENKINS-55139] ansicolor 0.6.0 shows terminal escape sequences in console log

          Anthony Pioli added a comment -

          I'm seeing the same behavior as rverduijn as well

          Anthony Pioli added a comment - I'm seeing the same behavior as rverduijn as well

          Vishal Meghani added a comment - - edited

          I am also seeing the same issue with 0.6.2 version of plugin and CloudBees Jenkins Enterprise 2.164.3.2-rolling.

          After refreshing the page colors appear. Issue only happens when you have opened console output before the {{ansiColor }}option is executed.

          However, downgrading to 0.5.3, resolves the issue.
          dnusbaum

          eg.

          [1;37;45m***************************************************************************** STAGE INIT *****************************************************************************

           

          Vishal Meghani added a comment - - edited I am also seeing the same issue with 0.6.2 version of plugin and CloudBees Jenkins Enterprise 2.164.3.2-rolling. After refreshing the page colors appear. Issue only happens when you have opened console output before the {{ansiColor }}option is executed. However, downgrading to 0.5.3, resolves the issue. dnusbaum eg. [1;37;45m***************************************************************************** STAGE INIT *****************************************************************************  

          Tried to downgrade to 0.5.3 - it didn't help.

          It is reproduced only on Maven Projects. Only checking "Color ANSI output" workarounds this but it's color schemes don't suite for us and there're lots of jobs to reconfigure.

          Can anybody please help with this issue?

          Valentin Baranov added a comment - Tried to downgrade to 0.5.3 - it didn't help. It is reproduced only on Maven Projects. Only checking "Color ANSI output" workarounds this but it's color schemes don't suite for us and there're lots of jobs to reconfigure. Can anybody please help with this issue?

          Marc Benstein added a comment -

          This seems similar to my issue with v0.6.2. This was working in v0.5.x I have a freestyle project where I have enabled ansi color with xterm. A single shell command with:

          echo "testing-1.2.300" | grep -E --color=always '[0-9]+.[0-9]+.[0-9]+'

          Results in:

          Marc Benstein added a comment - This seems similar to my issue with v0.6.2. This was working in v0.5.x I have a freestyle project where I have enabled ansi color with xterm. A single shell command with: echo "testing-1.2.300" | grep -E --color=always '[0-9]+.[0-9]+.[0-9]+' Results in:

          Dennis Hoer added a comment - - edited

          I had the same issue with Jenkinsfile and ansible. The problem was I was using single quotes for multiline shell command, e.g.,

              sh '''
                . .venv/bin/activate
                molecule test
              '''
          
          

          Switching to double quotes fixed the issue, e.g.,

               pipeline {
                 ...
                 options { 
                   ansiColor('xterm') 
                   ... 
                 }
                 stages {
                   ...
                   stage('Test') {
                     steps { 
                       sh """
                          . .venv/bin/activate 
                          molecule test 
                       """ 
                     }
                   }
                   ...
                 }
               }
          

          Dennis Hoer added a comment - - edited I had the same issue with Jenkinsfile and ansible. The problem was I was using single quotes for multiline shell command, e.g., sh ''' . .venv/bin/activate molecule test ''' Switching to double quotes fixed the issue, e.g., pipeline { ... options { ansiColor( 'xterm' ) ... } stages { ... stage( 'Test' ) { steps { sh """ . .venv/bin/activate molecule test """ } } ... } }

          Thomas M added a comment -

          I can confirm this bug and also that downgrading to 0.5.3 (from http://updates.jenkins-ci.org/download/plugins/ansicolor/) helps.
           
          My sh commands use double quotes (but only single-line, as in sh "bash path/to/script ${arg1} ${arg2}") already so I cannot confirm dhoer workaround.

          With the 0.6.2 I get output similar to initialzero comment.

          Thomas M added a comment - I can confirm this bug and also that downgrading to 0.5.3 (from http://updates.jenkins-ci.org/download/plugins/ansicolor/) helps.   My sh commands use double quotes (but only single-line, as in sh "bash path/to/script ${arg1} ${arg2}" ) already so I cannot confirm dhoer workaround. With the 0.6.2 I get output similar to initialzero comment.

          Marc Benstein added a comment - - edited

          This issue is resolved as of 0.6.3

          Marc Benstein added a comment - - edited This issue is resolved as of 0.6.3

          Sean Dukehart added a comment -

          I concur that it is resolved as of 0.6.3. I do still see the terminal escape sequences in the console text output.

          Sean Dukehart added a comment - I concur that it is resolved as of 0.6.3. I do still see the terminal escape sequences in the console text output.

          Marc Benstein added a comment -

          I see this issue has been reopened. In the 0.7.2 release the escape sequences are showing. For example, 

          [1mPROCESSED

          Marc Benstein added a comment - I see this issue has been reopened. In the 0.7.2 release the escape sequences are showing. For example,  [1mPROCESSED

          Marc Benstein added a comment -

          This issue must be related to a dependency. In the latest update to 0.7.2 I noticed the "[1mPROCESSED" issue in log files with Jenkins 2.235.5. However, I rolled back ansicolor to the last known working version which was 0.6.3 and this issue is still present.

          Marc Benstein added a comment - This issue must be related to a dependency. In the latest update to 0.7.2 I noticed the "[1mPROCESSED" issue in log files with Jenkins 2.235.5. However, I rolled back ansicolor to the last known working version which was 0.6.3 and this issue is still present.

            dnusbaum Devin Nusbaum
            cloos Christian Loos
            Votes:
            13 Vote for this issue
            Watchers:
            28 Start watching this issue

              Created:
              Updated: