-
Notifications
You must be signed in to change notification settings - Fork 84
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
partial logs not showing colors #216
Comments
@AvihayTsayeg Thanks for the report and the example. I needed to beef it up a little (it had no The issue is fully reproducible. Plugin doesn't kick-in in a partial log output of a "Freestyle Project". Most of the time I use pipelines (where an equivalent script would work fine) so it slipped under my radar. |
Only now that I have a longer moment I see that the version I could reproduce this in was After merging everything I am no longer able to reproduce the issue. @AvihayTsayeg Could you please install the newest version and post the results? |
Many thanks 🙏 !!! |
@tszmytka |
Let's stick to comparing apples to apples.
|
Please use example from the issue description - the one I updated with ESC bytes ( If you have any of the following plugins installed, please provide their versions:
Are you running the job directly on the jenkins host or by means of agents? Maybe through docker and/or k8s? |
Ok, this means the script you've been using in issue description contains control characters that interfere with the whole processing.
The control characters probably have gotten garbled into � - which makes it impossible to reproduce (� doesn't trigger ANSI sequence processing so output remains as-is in both short and long console output). Can you check what these characters are? Or better yet - can you put your original script into a file and attach it to the issue? Please make sure it is the one that produces output exactly as shown in issue description screenshot. |
I have create a gist link to gist |
Luckily github leaves control characters in gists. Both of the invisible characters are One thing that is different with my output and screenshots from issue description is that your run seems to produce more (by about 9KB) output.
|
@tszmytka the diff size might be to set -x ? |
Confirmed with:
|
Thanks - got it. Feel free to remove your content if you don't want it to hang in the net.
This is a very interesting finding - thanks for that. I used |
Any workaround? |
I can confirm this. There is still an issue after #214. In the case I start viewing the log on the very beginning of the job everything works as expected. But when opening the console after the a while or even after the finished and when Jenkins displays the partial log output message, I see raw ansi escape sequences and no colors. Upgrade 0.7.5 did not solve the problem. I'm using Jenkins 2.271. The logs are coming out of a pipeline execution from a slave node which is running on the same machine. Neither timestamper nor kubernetes / docker plugins are installed. |
Please have a look into the proposed #220. I noted down some thoughts about the cause of the problem after some debugging sessions and proposed a fix, which I know, is not going to solve all aspects of the problem. |
Confirmed with: AnsiColor: 0.7.5 But AnsiColor 0.5.3 - works ok. |
Jenkins: 2.235.2 I confirm the problem, I have a log of about 130kb from the ansible, and part of the log is colored and part is not. |
I confirm that downgraded to version 0.5.3 and works flawlessly! :-) |
Hi @nuBacuk, could be you're hunting a different bug than me, @JiffsMaverick, @DavidPerezIngeniero for example. I think there is a difference between having no color at all in case the log is shown only partially in case it is too big and no color showing after a while in the log, but all the log is displayed. 0.5.3 also works for my usecase. |
To anyone experiencing this problem: Could you please post the actual job/pipeline that you are using and a screenshot of the output? |
I did further analysis and now can say that the bug was introduced by b1336fd and a5d7d8c. Thus, ansicolor-0.6.3 is the last version without this bug. b1336fd does not compile and a5d7d8c is fixing that together with a lot more other stuff. That's why I currently can't say which of both exactly introduced it. I'm able to reproduce it on Linux with the Bash script above in a freestyle job with nothing more than the ansicolor checkbox ticked and the script added as a "script" build step. I'm also able to reproduce it on Windows with similar setup but replacing the Bash script with this Windows Batch script:
This script is from https://ss64.com/nt/echoansi.txt and slightly modified to run in a loop. |
and @tszmytka, this is the screenshot of the output: |
Again new findings: Until 0.6.x I can reproduce the bug with exactly the setup in this repository. Just by checking out and running The issue is located in
In case the build is finished, |
@roehrijn I ran it on my end with Re.
I haven't tested such a case but thinking about this now I can confirm that tailed output won't be colored while the build is running. Current implementation simply doesn't have this covered. Either way this is a separate issue - let's focus here on what happens after build has finished. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This is a shot in the dark but ansicolor-1.0.0 has just been released. It includes fixes for a couple of bugs that might have contributed to this issue as well. |
Issue not fixed, same look on partial logs. |
Still the same - unformated partial output
Upgraded from |
Issue stil exists on:
|
Any updates? |
@orzechszek nope |
Still happening on Jenkins 2.336 and ansiColor 1.0.1 Following the console log is nearly impossible. I often see black text on black background which is only fixed once the job completes. |
This is a really nice plugin. Unfortunately run into this bug. Reproduced with instructions on the README. Jenkins: pipeline {
agent any
options {
timestamps()
ansiColor('xterm')
}
stages {
stage('Build') {
steps {
echo '\033[34mHello\033[0m \033[33mcolorful\033[0m \033[35mworld!\033[0m'
}
}
stage('Test') {
steps {
echo 'hello from test step'
}
}
stage('Deploy') {
steps {
echo 'hello from deploy step'
}
}
}
}
|
Pretty please, would help greatly :) Thanks! |
To fix it, you need to go to Settings ---> Ansicolor ---> Global color map for all builds ---> and set it to xterm. |
follow to #212
repreduces:
free style job
The text was updated successfully, but these errors were encountered: