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

9 views
Skip to first unread message

cloos@netsandbox.de (JIRA)

unread,
Dec 12, 2018, 4:06:04 AM12/12/18
to jenkinsc...@googlegroups.com
Christian Loos created an issue
 
Jenkins / Bug JENKINS-55139
ansicolor 0.6.0 shows terminal escape sequences in console log
Issue Type: Bug Bug
Assignee: Unassigned
Components: ansicolor-plugin
Created: 2018-12-12 09:05
Environment: 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
Labels: plugin consoleoutput regression
Priority: Major Major
Reporter: Christian Loos

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:
[0;32mok: [essf0desc] [0m

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.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 7, 2019, 11:59:02 AM1/7/19
to jenkinsc...@googlegroups.com

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 7, 2019, 11:59:03 AM1/7/19
to jenkinsc...@googlegroups.com
Devin Nusbaum commented on Bug JENKINS-55139
 
Re: ansicolor 0.6.0 shows terminal escape sequences in console log

There is some additional discussion on https://github.com/jenkinsci/ansicolor-plugin/issues/145. I am not sure exactly what the issue is with ansible, but it looks like at least TerraForm is using multiline input, which I think should be fixed by https://github.com/jenkinsci/ansicolor-plugin/pull/137 (merged but not released). If anyone seeing the issue can test out the attached SNAPSHOT build of the plugin based on the current master (ansicolor.hpi) and report on whether that fixes the issue, makes things better, makes things worse, or makes no difference, that would be very helpful.

ansicolor.hpi

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 7, 2019, 12:04:01 PM1/7/19
to jenkinsc...@googlegroups.com
Devin Nusbaum edited a comment on Bug JENKINS-55139
There is some additional discussion on [https://github.com/jenkinsci/ansicolor-plugin/issues/145.] I am not sure exactly what the issue is with ansible, but it looks like at least TerraForm Terraform is using multiline input, which I think should be fixed by [https://github.com/jenkinsci/ansicolor-plugin/pull/137] (merged but not released). If anyone seeing the issue can test out the attached SNAPSHOT build of the plugin based on the current master ([^ansicolor.hpi]) and report on whether that fixes the issue, makes things better, makes things worse, or makes no difference, that would be very helpful.

[^ansicolor.hpi]

vektory79@gmail.com (JIRA)

unread,
Jan 9, 2019, 11:30:02 AM1/9/19
to jenkinsc...@googlegroups.com

I tried this snapshot and it's makes no difference...

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 10, 2019, 11:48:02 AM1/10/19
to jenkinsc...@googlegroups.com

Thanks for trying it out Victor Verbitsky! It would be great if anyone seeing the issue could report whether they are seeing variant 1 or 2 of the issue while ansicolor 0.6.x is installed as described in my comment on the GitHub issue.

vektory79@gmail.com (JIRA)

unread,
Jan 10, 2019, 11:56:02 AM1/10/19
to jenkinsc...@googlegroups.com

If ansicolor 0.6.x is installed then I see the 1 variant of the issue.

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 10, 2019, 12:07:04 PM1/10/19
to jenkinsc...@googlegroups.com

Are there any error messages in your logs? Do you see any kind of coloration in any jobs? What tools are producing colorized output in your logs (Ansible)? Can you copy-paste one of the lines that is showing up incorrectly here (preferably replacing literal occurrences of the character 0x1B with 0x1B here so we can see how control characters are being processed?)

vektory79@gmail.com (JIRA)

unread,
Jan 11, 2019, 3:23:03 AM1/11/19
to jenkinsc...@googlegroups.com

> Are there any error messages in your logs?

I haven't found any meaningful messages.

> Do you see any kind of coloration in any jobs?

No at all.

> What tools are producing colorized output in your logs (Ansible)?

Apache Maven 3.6.0 (with special flags to force the coloration).

> Can you copy-paste one of the lines that is showing up incorrectly here

{{[ [1;33mWARNING [m] }}
{{[ [1;33mWARNING [m] It is highly recommended to fix these problems because they threaten the stability of your build.}}
{{[ [1;33mWARNING [m] }}
{{[ [1;33mWARNING [m] For this reason, future Maven versions might no longer support building such malformed projects.}}
{{[ [1;33mWARNING [m] }}
{{[ [1;34mINFO [m] [1m------------------------------------------------------------------------ [m}}
{{[ [1;34mINFO [m] [1mReactor Build Order: [m}}
{{[ [1;34mINFO [m] }}
{{[ [1;34mINFO [m] ru.krista:root:pom [pom]}}
{{[ [1;34mINFO [m] ru.krista:core:pom [pom]}}
{{[ [1;34mINFO [m] ru.krista.core:common:pom [pom]}}
{{[ [1;34mINFO [m] ru.krista.core.common:utils:jar [takari-jar]}}
{{[ [1;34mINFO [m] ru.krista.core:ioc:pom [pom]}}

 > preferably replacing literal occurrences of the character 0x1B with 0x1B here so we can see how control characters are being processed?

Sorry, but I don't know how to do this... I just see this log instead of color text. With 0.5.3 all colors is in place here.

 

vektory79@gmail.com (JIRA)

unread,
Jan 11, 2019, 3:24:03 AM1/11/19
to jenkinsc...@googlegroups.com
Victor Verbitsky edited a comment on Bug JENKINS-55139

vektory79@gmail.com (JIRA)

unread,
Jan 11, 2019, 3:26:03 AM1/11/19
to jenkinsc...@googlegroups.com

> preferably replacing literal occurrences of the character 0x1B with 0x1B here so we can see how control characters are being processed?

Sorry twice! I found them!

[0x1B[1;33mWARNING0x1B[m]
[0x1B[1;33mWARNING0x1B[m] It is highly recommended to fix these problems because they threaten the stability of your build.
[0x1B[1;33mWARNING0x1B[m]
[0x1B[1;33mWARNING0x1B[m] For this reason, future Maven versions might no longer support building such malformed projects.
[0x1B[1;33mWARNING0x1B[m]
[0x1B[1;34mINFO0x1B[m] 0x1B[1m------------------------------------------------------------------------0x1B[m
[0x1B[1;34mINFO0x1B[m] 0x1B[1mReactor Build Order:0x1B[m
[0x1B[1;34mINFO0x1B[m]
[0x1B[1;34mINFO0x1B[m] ru.krista:root:pom [pom]
[0x1B[1;34mINFO0x1B[m] ru.krista:core:pom [pom]
[0x1B[1;34mINFO0x1B[m] ru.krista.core:common:pom [pom]
[0x1B[1;34mINFO0x1B[m] ru.krista.core.common:utils:jar [takari-jar]
[0x1B[1;34mINFO0x1B[m] ru.krista.core:ioc:pom [pom]

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 16, 2019, 4:51:02 PM1/16/19
to jenkinsc...@googlegroups.com

Victor Verbitsky Maven coloring is explicitly validated in this test case. Are you sure that you are seeing that output for a build while you are still running Ansicolor 0.6.0? If you have Ansicolor 0.5.3 installed, then the logs are expected to look like that for builds that originally ran while Ansicolor 0.6.0 was installed. I am not able to reproduce your issue on Ansicolor 0.6.0. If you are able to create a similar test case to the Maven one I linked that demonstrates the issue you are seeing, that would be very helpful.

jonas.d.lindstrom@netent.com (JIRA)

unread,
Jan 29, 2019, 9:06:03 AM1/29/19
to jenkinsc...@googlegroups.com

Fairly minimal test case:

  • docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:2.150.2
  • Don't install any plugins
  • Go to Plugin Manager, install AnsiColor 0.5.3 from https://updates.jenkins.io/download/plugins/ansicolor/
  • Create a free-style job with "Color ANSI Console Output", and a build step "Execute shell" containing: echo "\e[1m\e[34mbold blue text\e[0m\e[0m"
  • Build the job. Output bold blue text
  • Go to Plugin Manager, upgrade AnsiColor to 0.6.1 and restart Jenkins
  • Build the job. Output: bold blue text [0m

jonas.d.lindstrom@netent.com (JIRA)

unread,
Jan 29, 2019, 9:07:02 AM1/29/19
to jenkinsc...@googlegroups.com
Jonas Lindström edited a comment on Bug JENKINS-55139
Fairly minimal test case:
* {{docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:2.150.2}}
*
Go to http://localhost:8080
*
Don't install any plugins
* Go to Plugin Manager, install AnsiColor 0.5.3 from [https://updates.jenkins.io/download/plugins/ansicolor/]
* Create a free-style job with "Color ANSI Console Output", and a build step "Execute shell" containing: {{echo "\e[1m\e[34mbold blue text\e[0m\e[0m"}}
* Build the job. Output *{color:#4c9aff}bold blue text{color}*
* Go to Plugin Manager, upgrade AnsiColor to 0.6.1 and restart Jenkins
* Build the job. Output: {color:#4c9aff}*bold blue text*{color} [0m

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 29, 2019, 9:10:03 AM1/29/19
to jenkinsc...@googlegroups.com

Jonas Lindström Thanks for the reproduction case. I think it would be handled by [PR 147https://github.com/jenkinsci/ansicolor-plugin/pull/147], which is ready to be merged and released, although I'm not sure when I'll have time to release the plugin.

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 29, 2019, 9:10:04 AM1/29/19
to jenkinsc...@googlegroups.com
Devin Nusbaum edited a comment on Bug JENKINS-55139
[~jl68] Thanks for the reproduction case. I think it would be handled by [PR 147https 147|https ://github.com/jenkinsci/ansicolor-plugin/pull/147], which is ready to be merged and released, although I'm not sure when I'll have time to release the plugin.

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 29, 2019, 9:11:42 AM1/29/19
to jenkinsc...@googlegroups.com

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 29, 2019, 9:11:43 AM1/29/19
to jenkinsc...@googlegroups.com

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 29, 2019, 9:11:43 AM1/29/19
to jenkinsc...@googlegroups.com
Devin Nusbaum started work on Bug JENKINS-55139
 
Change By: Devin Nusbaum
Status: Open In Progress

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 31, 2019, 2:32:03 PM1/31/19
to jenkinsc...@googlegroups.com
Devin Nusbaum commented on Bug JENKINS-55139
 
Re: ansicolor 0.6.0 shows terminal escape sequences in console log

I just released 0.6.2 with a change that should fix this issue for the cases I am aware of. If you are still seeing it after the upgrade, please copy-and-paste some of the broken output from Jenkins here (preferably replacing literal occurrences of the ASCII character 0x1b with the text 0x1b so we can see what is happening to the escape sequences).

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 31, 2019, 2:32:06 PM1/31/19
to jenkinsc...@googlegroups.com
Change By: Devin Nusbaum
Status: In Review Resolved
Resolution: Fixed
Released As: ansicolor 0.6.2

jonas.d.lindstrom@netent.com (JIRA)

unread,
Feb 1, 2019, 4:02:02 AM2/1/19
to jenkinsc...@googlegroups.com
Jonas Lindström commented on Bug JENKINS-55139
 
Re: ansicolor 0.6.0 shows terminal escape sequences in console log

As far I can see, it looks good now. Thanks for the fix!

cloos@netsandbox.de (JIRA)

unread,
Feb 22, 2019, 9:04:05 AM2/22/19
to jenkinsc...@googlegroups.com

Sorry for the delay. I had today time to test it again. And I still can see the control charcters.

After updating to 0.6.2, control character in /console and /consoleText:
[[0;32mok: [lxsrvmgi1360][[0m

After downgrading to 0.5.3, no control character in /console and /consoleText:
[[8mha:////4GByXBh6D5sO4uIaL/Xvo6rBHYkdqIOcMtgU7KVDnLnuAAAApR+LCAAAAAAAAP9b85aBtbiIQT2jNKU4P0+vIKc0PTOvWC8xrzgzOT8nv0gvODO3ICfVoyQ3xy+/JNU2Yj/Tagmf50wMjD4M7CWJ6SCJEgYhn6zEskT9nMS8dP3gkqLMvHTriiIGKaihyfl5xfk5qXrOEBpkDgMEMDIxMFQUlDDI2RQXJOYpFJdU5qTaKoEttlJQNjBwdjEwsFayAwAsE8VZpQAAAA==[[0mok: [lxsrvmgi1360][[8mha:////4MLkG6V+s9c4kbbINbBZTN8IdUcULVaJJVRaElSmS5VEAAAAkR+LCAAAAAAAAP9b85aBtbiIQT2jNKU4P0+vIKc0PTOvWC8xrzgzOT8nv0gvODO3ICfVoyQ3xy+/JNU2Yj/Tagmf50wMjD4M7CWJ6SCJEgYhn6zEskT9nMS8dP3gkqLMvHTriiIGKaihyfl5xfk5qXrOEBpkDgMEMDIxMFQUlDCw2+gXFyTm2QEAI9P8iI4AAAA=[[0m

cloos@netsandbox.de (JIRA)

unread,
Feb 22, 2019, 9:04:05 AM2/22/19
to jenkinsc...@googlegroups.com
Christian Loos reopened an issue
 
Change By: Christian Loos
Resolution: Fixed
Status: Resolved Reopened

robinverduijn.github@gmail.com (JIRA)

unread,
May 3, 2019, 4:50:02 PM5/3/19
to jenkinsc...@googlegroups.com
Robin Verduijn commented on Bug JENKINS-55139
 
Re: ansicolor 0.6.0 shows terminal escape sequences in console log

Note that for me, I am also still seeing the control characters in the console output but only while watching an active build. Inspecting the console output after a build has completed does render them correctly.

david.aldrich@emea.nec.com (JIRA)

unread,
May 7, 2019, 3:53:02 AM5/7/19
to jenkinsc...@googlegroups.com

anthony@pioli.com (JIRA)

unread,
May 8, 2019, 12:12:02 PM5/8/19
to jenkinsc...@googlegroups.com

vmeghani@salesforce.com (JIRA)

unread,
Jun 17, 2019, 2:01:04 AM6/17/19
to jenkinsc...@googlegroups.com

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

Interestingly it was not there for Jenkins-2.150.3.2-1 with 0.6.2 version on ansi color plugin. 

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.
Devin Nusbaum

eg.

[1;37;45m***************************************************************************** [0m [1;37;45mSTAGE INIT [0m [1;37;45m***************************************************************************** [0m

 

vmeghani@salesforce.com (JIRA)

unread,
Jun 17, 2019, 5:57:02 AM6/17/19
to jenkinsc...@googlegroups.com
Vishal Meghani edited a comment on Bug JENKINS-55139
I am also seeing the same issue with 0.6.2 version of plugin and CloudBees Jenkins Enterprise 2.164.3.2-rolling.

Interestingly it was not there for Jenkins-2.150.3.2-1 with 0.6.2 version on ansi color plugin. 

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***************************************************************************** [0m [1;37;45mSTAGE INIT [0m [1;37;45m***************************************************************************** [0m

 

valentin.baranov@netcracker.com (JIRA)

unread,
Aug 20, 2019, 4:18:05 AM8/20/19
to jenkinsc...@googlegroups.com

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?

initialzero@gmail.com (JIRA)

unread,
Aug 21, 2019, 7:32:03 PM8/21/19
to jenkinsc...@googlegroups.com
Marc Benstein updated an issue
 
Change By: Marc Benstein
Attachment: image-2019-08-21-16-31-39-960.png

initialzero@gmail.com (JIRA)

unread,
Aug 21, 2019, 7:33:03 PM8/21/19
to jenkinsc...@googlegroups.com
Marc Benstein commented on Bug JENKINS-55139
 
Re: ansicolor 0.6.0 shows terminal escape sequences in console log

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@gmail.com (JIRA)

unread,
Aug 29, 2019, 6:37:07 PM8/29/19
to jenkinsc...@googlegroups.com

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@gmail.com (JIRA)

unread,
Aug 29, 2019, 6:38:03 PM8/29/19
to jenkinsc...@googlegroups.com
Dennis Hoer edited a comment on Bug JENKINS-55139
I had the same issue with Jenkinsfile and ansible. The problem was I was using single quotes for multiline shell command, e.g.,


{code:java}

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

{code}

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


{code:java}

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

thomas.martitz@mailbox.org (JIRA)

unread,
Dec 3, 2019, 3:48:06 AM12/3/19
to jenkinsc...@googlegroups.com
Thomas M commented on Bug JENKINS-55139

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 Dennis Hoer workaround.

With the 0.6.2 I get output similar to Marc Benstein comment.

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages