question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrading to 0.5.1 from 0.5.0 causes exception and no output in jobs

See original GitHub issue

Please provide precise details of the issue you detected.

Test environment

  • Jenkins Version: Jenkins ver. 2.60.2
  • AnsiColor Version: 0.5.1
  • Hostsystem: AWS OS

Expected behavior

I upgraded to 0.5.1 from 0.5.0 and now none of my jobs that use python’s “termcolor” package are producing output, AND i’m getting an exception in Jenkins logs.

I’m attaching a GIF on the failure. And I’m attaching a GIF of rolling back to 0.5.0 and seeing that it works.

Actual behavior

Here is a gif of the failure: ansi_issue

Here is a gif of me downloading to 0.5.0 and seeing that it works: ansi_downgrade_fixes

Steps to reproduce the behavior

You can reproduce it with BASH, python, etc. Here it is with a python snippet:

import termcolor
s = termcolor.colored('hello', color='red', attrs=['bold', 'dark'])
print(s)

Here is the stack trace in the logs:

Aug 13, 2017 2:02:08 PM SEVERE hudson.model.Executor finish1
Executor threw an exception
java.lang.NumberFormatException: For input string: "2m"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:580)
	at java.lang.Integer.<init>(Integer.java:867)
	at hudson.plugins.ansicolor.AnsiOutputStream.write(AnsiOutputStream.java:124)
	at hudson.plugins.ansicolor.AnsiHtmlOutputStream.collectAmbleCharacter(AnsiHtmlOutputStream.java:249)
	at hudson.plugins.ansicolor.AnsiHtmlOutputStream.write(AnsiHtmlOutputStream.java:233)
	at java.io.FilterOutputStream.write(FilterOutputStream.java:125)
	at hudson.plugins.ansicolor.AnsiColorConsoleLogFilter$1.eol(AnsiColorConsoleLogFilter.java:51)
	at hudson.console.LineTransformationOutputStream.eol(LineTransformationOutputStream.java:60)
	at hudson.console.LineTransformationOutputStream.write(LineTransformationOutputStream.java:56)
	at hudson.console.LineTransformationOutputStream.write(LineTransformationOutputStream.java:74)
	at java.io.PrintStream.write(PrintStream.java:480)
	at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
	at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
	at sun.nio.cs.StreamEncoder.flushBuffer(StreamEncoder.java:104)
	at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:185)
	at java.io.PrintStream.newLine(PrintStream.java:546)
	at java.io.PrintStream.println(PrintStream.java:807)
	at hudson.model.StreamBuildListener.finished(StreamBuildListener.java:80)
	at hudson.model.Run.execute(Run.java:1787)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:405)

Aug 13, 2017 2:03:00 PM SEVERE hudson.init.impl.InstallUncaughtExceptionHandler$DefaultUncaughtExceptionHandler uncaughtException
A thread (python /tmp/jenkins1370482297388284338.py: stdout copier/305) died unexpectedly due to an uncaught exception, this may leave your Jenkins in a bad way and is usually indicative of a bug in the code.
java.lang.IllegalStateException: Attribute 2 should not be reached
	at hudson.plugins.ansicolor.AnsiHtmlOutputStream.processSetAttribute(AnsiHtmlOutputStream.java:469)
	at hudson.plugins.ansicolor.AnsiOutputStream.processEscapeCommand(AnsiOutputStream.java:347)
	at hudson.plugins.ansicolor.AnsiOutputStream.write(AnsiOutputStream.java:129)
	at hudson.plugins.ansicolor.AnsiHtmlOutputStream.write(AnsiHtmlOutputStream.java:220)
	at java.io.FilterOutputStream.write(FilterOutputStream.java:125)
	at hudson.plugins.ansicolor.AnsiColorConsoleLogFilter$1.eol(AnsiColorConsoleLogFilter.java:51)
	at hudson.console.LineTransformationOutputStream.eol(LineTransformationOutputStream.java:60)
	at hudson.console.LineTransformationOutputStream.write(LineTransformationOutputStream.java:56)
	at hudson.console.LineTransformationOutputStream.write(LineTransformationOutputStream.java:74)
	at java.io.PrintStream.write(PrintStream.java:480)
	at hudson.util.StreamCopyThread.run(StreamCopyThread.java:61)

We will stick with 0.5.0 until this is resolved.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
victorbcommented, Sep 5, 2017

Can confirm that upgrading the plugin to 0.5.2 fixes this very issue.

1reaction
dblockcommented, Aug 14, 2017

Someone should contribute a fix, please, don’t hold back. At least a spec would be a start!

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found