-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Jenkins runs fail on invalid XML: "Invalid byte 2 of 4-byte UTF-8 sequence" #16
Comments
Looks like there are a couple other issues besides the pattern for valid XML characters. The output from the test steps is buffered one byte at a time, because the IO streams for the
Since Then later on, long output is truncated. At this point, it's a UTF-8 string, so
Working on fixing those up as part of this. |
I think I have a fix for this – https://github.com/apjanke/brew/commit/eb8db209c3a79145be49191978ef2328e602abee. But I don't know how to write a unit test for it, since Seems to work when I run it locally on my 10.9 and 10.11 boxes. And I found why the issue might be occurring for this case: one of the file names in the When I look at the diff in the output between the current code and my patch, it shows up as different. But I'm having trouble pulling out exactly the difference, because the text editors and stuff I'm working with are probably doing their own invalid-character-replacement stuff.
Next up: finding a simple command-line XML validator that I can pass the "before" and "after" |
Oh, ha ha: it's just It likes my changes.
|
@apjanke Nice work on this. When you're happy with it I think it's fine to just push to |
Thank you! If @xu-cheng is awake, would like to hear his feedback before pushing, since he knows |
I think you can push it. Looks good to me. |
Thanks! I'm about to go to bed. I'll push it in the morning when I'll be around to monitor the test jobs for a while. |
Pushed it. I'll be watching the test-bot for the next few hours, and running some additional builds to exercise it. |
👏 Thanks for not only tackling this issue, but also for documenting the process so nicely! Reading this issue was very instructive and insightful. |
I pushed the revised version. Since then, some Jenkins runs have been failing with "output not available", but they're Jenkins-level errors saying "GitHub is down for maintenance", so I'm pretty sure it's a coincidence. Will keep an eye on it. |
Some Jenkins build runs will fail completely without output like this. No test results or artifacts will be available.
The test output is all included in an XML file, which includes the output of some of the steps. That output, from commands we call, may not be valid XML CDATA, or even valid UTF-8, since we're calling external commands.
The
test-bot
command attempts to filter out invalid characters but it's apparently not being thorough enough. We need more robust filtering or escaping.I think the approach in Homebrew/legacy-homebrew#50092 was pretty solid, but needed different syntax, like so.
And it might be better to replace filtered-out characters with a Unicode "replacement character" placeholder instead of just eliding. Then there'd still be some indication that there was other output there.
References
The text was updated successfully, but these errors were encountered: