Bug 1022752 - traceback after core test
traceback after core test
Status: CLOSED DUPLICATE of bug 1041999
Product: Red Hat Hardware Certification Program
Classification: Red Hat
Component: Test Suite (harness) (Show other bugs)
1.7.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Greg Nichols
Red Hat Kernel QE team
:
Depends On:
Blocks: 1052374
  Show dependency treegraph
 
Reported: 2013-10-23 19:47 EDT by Brian Brock
Modified: 2014-03-26 17:52 EDT (History)
4 users (show)

See Also:
Fixed In Version: hwcert-client 1.7.0-63
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-03-26 17:52:37 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
documentbase.py patch to encode text elements in xml as utf-8 (3.46 KB, patch)
2013-10-28 12:48 EDT, Greg Nichols
no flags Details | Diff
documentbase.py patch to encode text elements in xml as utf-8 (3.78 KB, patch)
2013-11-07 08:51 EST, Greg Nichols
no flags Details | Diff

  None (edit)
Description Brian Brock 2013-10-23 19:47:03 EDT
Description of problem:
the core test completes with a pass, and then hwcert-backend dies with a traceback.

Version-Release number of selected component (if applicable):
1.7.0

How reproducible:


Steps to Reproduce:
1. run hwcert-backend run -t core
2. observe


Actual results:
Description of problem:
the core test completes with a pass, and then hwcert-backend dies with a traceback.

Version-Release number of selected component (if applicable):
1.7.0

How reproducible:


Steps to Reproduce:
1. run hwcert-backend run -t core
2. observe


Actual results:
saveOutput: /var/log/hwcert/runs/2/core/output.log
Return value was 0
Traceback (most recent call last):
  File "/usr/bin/hwcert-backend", line 45, in <module>
    success = hwcertBackend.do(args)
  File "/usr/share/hwcert/lib/hwcert/backend.py", line 182, in do
    result = self.commands[self.command]()
  File "/usr/share/hwcert/lib/hwcert/harness.py", line 393, in doRun
    return self._doRun(tests)
  File "/usr/share/hwcert/lib/hwcert/harness.py", line 540, in _doRun
    self.certification.save(self.environment.getResultsPath())
  File "/usr/share/hwcert/lib/hwcert/documentbase.py", line 281, in save
    file.write(self.document.toxml())
UnicodeEncodeError: 'ascii' codec can't encode characters in position 135152-135154: ordinal not in range(128)

Expected results:
no traceback

Additional info:
Comment 1 Brian Brock 2013-10-23 19:48:25 EDT
Subsequent test runs immediately terminate with:

Error: hwcert is already running (lock file /var/lock/subsys/hwcert found)
Comment 4 Brian Brock 2013-10-23 19:54:44 EDT
traceback during another run on the same system, after cleanup

https://bugzilla.redhat.com/show_bug.cgi?id=1022749
Comment 5 Brian Brock 2013-10-23 20:12:48 EDT
subsequent cycles of "clean" and "run -t core" fail identically.
Comment 6 Greg Nichols 2013-10-23 21:37:19 EDT
looks like some "bad" characters in /var/log/messages.  Here's the traceback with a bit more leading up to it:

checking directory /var/log/hwcert/runs/2/core 
Skipping output.log
Warning: Unicode decode error in /var/log/messages
'ascii' codec can't decode byte 0xe2 in position 69: ordinal not in range(128)
saveOutput: /var/log/hwcert/runs/2/core/output.log
Return value was 0
Traceback (most recent call last):
  File "/usr/bin/hwcert-backend", line 45, in <module>
    success = hwcertBackend.do(args)
  File "/usr/share/hwcert/lib/hwcert/backend.py", line 182, in do
    result = self.commands[self.command]()
  File "/usr/share/hwcert/lib/hwcert/harness.py", line 393, in doRun
    return self._doRun(tests)
  File "/usr/share/hwcert/lib/hwcert/harness.py", line 540, in _doRun
    self.certification.save(self.environment.getResultsPath())
  File "/usr/share/hwcert/lib/hwcert/documentbase.py", line 281, in save
    file.write(self.document.toxml())
UnicodeEncodeError: 'ascii' codec can't encode characters in position 135152-135154: ordinal not in range(128)

Even the passing storage test has similar unicode errors reading /var/log/messages.
Comment 10 Greg Nichols 2013-10-28 12:48:19 EDT
Created attachment 816857 [details]
documentbase.py patch to encode text elements in xml as utf-8


Looking into possible encoding issues, I found that some self-test code was failing in 1.7.0 while passing in 1.6.4 (1.7.0 uses python core XML  - prior releases use PyXML).

The fix for the self test involving unicode 128-255 is to explicitly encode as utf-8 when setting text elements.   This may be a fix for this bug, as it seems to involve encoding issues.   We'd need a reliable reproducer to be sure.
Comment 11 Greg Nichols 2013-11-07 08:51:23 EST
Created attachment 821142 [details]
documentbase.py patch to encode text elements in xml as utf-8
Comment 12 Brian Brock 2014-01-09 20:30:31 EST
reopening, I've seen this on ppc64 at the end of `run -t core`:

Subtest Stress:
Running stress for 10 min.
stress --cpu 12 --io 12 --vm 12 --vm-bytes 128M --timeout 10m
stress: info: [31425] dispatching hogs: 12 cpu, 12 io, 12 vm, 0 hdd
stress: info: [31425] successful run completed in 600s
PASS
copying attachments...
checking directory /var/log/hwcert/runs/1/core
Skipping output.log
saveOutput: /var/log/hwcert/runs/1/core/output.log
Return value was 0
Traceback (most recent call last):
  File "/usr/bin/hwcert-backend", line 45, in <module>
    success = hwcertBackend.do(args)
  File "/usr/share/hwcert/lib/hwcert/backend.py", line 182, in do
    result = self.commands[self.command]()
  File "/usr/share/hwcert/lib/hwcert/harness.py", line 356, in doRun
    return self._doRun(tests)
  File "/usr/share/hwcert/lib/hwcert/harness.py", line 503, in _doRun
    self.certification.save(self.environment.getResultsPath())
  File "/usr/share/hwcert/lib/hwcert/documentbase.py", line 281, in save
    file.write(self.document.toxml())
UnicodeEncodeError: 'ascii' codec can't encode characters in position 118480-118482: ordinal not in range(128)


and then:

$ hwc save
Error: hwcert is already running (lock file /var/lock/subsys/hwcert found)
Override? (y|n) y
response: y
Traceback (most recent call last):
  File "/usr/bin/hwcert-backend", line 45, in <module>
    success = hwcertBackend.do(args)
  File "/usr/share/hwcert/lib/hwcert/backend.py", line 182, in do
    result = self.commands[self.command]()
  File "/usr/share/hwcert/lib/hwcert/backend.py", line 307, in doSave
    self.load()
  File "/usr/share/hwcert/lib/hwcert/harness.py", line 58, in load
    self.certification.load(self.environment.getResultsPath())
  File "/usr/share/hwcert/lib/hwcert/certificationtest.py", line 183, in load
    DocumentBase.load(self, filename)
  File "/usr/share/hwcert/lib/hwcert/documentbase.py", line 275, in load
    self.document = parse(file)
  File "/usr/lib64/python2.7/xml/dom/minidom.py", line 1921, in parse
    return expatbuilder.parse(file)
  File "/usr/lib64/python2.7/xml/dom/expatbuilder.py", line 928, in parse
    result = builder.parseFile(file)
  File "/usr/lib64/python2.7/xml/dom/expatbuilder.py", line 211, in parseFile
    parser.Parse("", True)
xml.parsers.expat.ExpatError: no element found: line 1, column 0


flagging needinfo because this is an old bug.  Are there other checks that can be run for catching similar problems?
Comment 13 Brian Brock 2014-01-09 20:34:04 EST
normally the second traceback (previous comment) will thereafter repeat with each invocation.

hwcert-backend clean breaks this cycle, and allows at least basic commands to run without traceback again.
Comment 14 Brian Brock 2014-01-09 20:40:46 EST
the first traceback (and consequently the second) only occurs for `run -t core` or runs that include  it.
Comment 24 Brian Brock 2014-03-26 17:52:37 EDT

*** This bug has been marked as a duplicate of bug 1041999 ***

Note You need to log in before you can comment on or make changes to this bug.