-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Control characters appearing in job output in 0.6.0 #145
Comments
Seeing the same in console output from Cucumber. Rolling back to |
Yes this was probably introduced by #132. If anyone is able to create a PR with a minimal failing test case similar to the tests in AnsiColorBuildWrapperTest it would help us understand the core part of the problem. Might be similar to #135, so I would be interested to see if something like #137 would help. |
I attached a custom snapshot build of the plugin to JENKINS-55139 based on |
Still broken for us with the custom version attached to JENKINS-55139. Had to downgrade to 0.5.3. E.g. broken: https://jenkins.akka.io:8498/job/pr-validator-per-commit-jenkins/14436/console |
Ok, then perhaps this is a distinct issue related to Jesse's comment here: #137 (comment). If anyone has time to create a failing test case in AnsiColorBuildWrapperTest for the issue that would make it much more likely for this to be fixed quickly. |
Thanks for the links @jrudolph. I am not able to reproduce a failure in quite the same way unless I disable colorized output from the job's configuration page, although perhaps the appearance has degraded even further that it looked originally when you were running 0.6.0, because 0.5.3 does not understand the log format used in 0.6.0, so that might explain the discrepancy. I took a line from your logs and did some local testing to reproduce the issue. Here are the 3 variants of the issue that I am seeing:
It would be very helpful to understand if you and other users are seeing variant 1 or variant 2 for builds built when running ansicolor 0.6.0 while ansicolor 0.6.0 is still installed (not after downgrading to 0.5.3 and looking at logs for builds run under version 0.6.0). If you are seeing variant 1, then I have no idea what is going on, but if you are seeing variant 2 then I know how to fix the problem. For anyone seeing variant 1 of the issue, are you running Freestyle or Pipeline jobs? Are there any error messages in your Jenkins logs when you view the console output for a job? If it is a freestyle job, is colorized output enabled? |
It seems it's variant 2 here. |
I am noticing that it has something to do with the here document like stuff when you call things. Color doesn't work here:
Color works like this and wierdly enough anything after the single quote echo with ansi all color kinda sorta works.... it's missing some of the closing escapes sometimes and keeps the color until it finds a close or a new color.
|
I have similar issues on Jenkins 2.150.2 and 0.6.1 |
I just released 0.6.2 with a change that should improve this issue. 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 |
@dwnusbaum it works like a charm, thank you! |
Hi @dwnusbaum, the fix in v0.6.2 is only partially working when using Cucumber. What I mean by partially is that I still see the control characters and no colors in the console output as the text shows up. However, when I refresh the page the control characters disappear and the text shows up in color. This behavior is not experienced in v0.5.3. Also, this only happens in the console output and not in the Blue Ocean view. Before refresh: After page refresh: Raw output:
Cucumber command:
|
I'm seeing that behaviour as well. It seems that if I load the Console Output page before any escape codes have appeared, I'll see the codes. Reloading the page, or loading it after some colour output has appeared will show the colours properly. |
@kapoorlakshya @fgnathan That sounds like #136, but I don't have any ideas about the cause. It would be great to add any additional reproduction information or diagnostics to that issue (perhaps it is related to size of the logs, whether the logs are truncated, etc.) to help us understand what is happening. |
I also see this issue It happens with very little amount of logs, so no truncating. Maybe that helps |
@dwnusbaum Thanks! I will add all relevant information in that issue. |
It seems that Terraform attempts to format the output using color. However, Jenkins does not output this formatting correctly and thus you see those unusual characters in the output. Thanks to this thread, I was able to make Terraform omit those characters in the output by using the This options is available for at least three of the major Terraform functions: |
I'm seeing control characters show up in coloured job output where previously there were none before. It seems that this could be somewhat related to #141.
Test environment
Expected behavior
Up until 0.6.0 I would only occasionally see
[0m
characters show up and they did not affect output. The following appears when testing against 0.5.3Actual behavior
With 0.6.0 I now see more control characters and in some cases no colour output at all:
In more complex jobs with more varied colour output, the colour output will not be properly bounded and will leak into following lines.
Steps to reproduce the behavior
The above outputs were reproduced by running the following job using the pipeline library:
The text was updated successfully, but these errors were encountered: