Bug 1504527
Summary: | beaker-watchdog crashes when saving console logs from OpenStack: UnicodeEncodeError: 'ascii' codec can't encode... | ||
---|---|---|---|
Product: | [Retired] Beaker | Reporter: | Dan Callaghan <dcallagh> |
Component: | general | Assignee: | Dan Callaghan <dcallagh> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Anwesha Chatterjee <achatter> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 24 | CC: | achatter, dcallagh, mjia, rjoost |
Target Milestone: | 25.0 | Keywords: | Patch |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-03-19 04:18:12 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Dan Callaghan
2017-10-20 06:15:05 UTC
Yoink. So the first thing to note is that the servers.get_console_output call in novaclient is actually returning unicode not str. Which is odd because the serial console is really a stream of bytes. Any non-ASCII bytes that appear are being converted to U+FFFD REPLACEMENT CHARACTER inside OpenStack, even if it was a valid UTF-8 sequence. So that's annoying. Probably related to the ANSI escape stripping which OpenStack is also doing (bug 1395029). Regardless how right or wrong that behaviour is, I guess we just need to treat the return value of get_console_output as pre-decoded unicode. Even if OpenStack fixes the handling of non-ASCII console output in a future version, they will need to keep the return type as unicode to avoid breaking compatibility. In some ways it makes this problem easier, because it means we don't have to worry about decoding UTF-8 or handling UTF-8 invalid byte sequences through XMLRPC or anything. We just need to re-encode to UTF-8 at the last layer before we write bytes to disk. https://gerrit.beaker-project.org/5903 Verified that beaker-watchdog no longer crashes when rendering non-ascii characters in the console log. For example in : https://beaker-devel.app.eng.bos.redhat.com/beaker-logs/2018/01/136/13643/20543/console.log This line appears: Firmware for Intel® Wireless 5150 A/G/N network adaptors Apologies, please disregard (https://bugzilla.redhat.com/show_bug.cgi?id=1504527#c4) Comment 4 This bug is verified with this log file: https://beaker-devel.app.eng.bos.redhat.com/beaker-logs/2018/01/136/13626/20526/console.log containing this line: Firmware for Intel�� PRO/Wireless 5000 A/G/N network adaptors which shows that the console is rendering non-ascii characters as a unicode replacement character, and beaker-watchdog is not crashing. This bug was fixed on the release-24 branch, to appear in Beaker 24.6, but we are not planning any more maintenance releases for the 24.x series. The next release will be Beaker 25.0. Updating the milestone accordingly. Beaker 25.0 has been released. Release notes are available upstream: https://beaker-project.org/docs/whats-new/release-25.html |