Bug 1451770

Summary: Exception thrown while handling exception in /usr/share/rhn/osad/jabber_lib.py
Product: Red Hat Satellite 5 Reporter: Lukáš Hellebrandt <lhellebr>
Component: ServerAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED ERRATA QA Contact: Pavel Studeník <pstudeni>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: pstudeni, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: osad-5.11.63-14-sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-05 13:57:18 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:
Bug Depends On:    
Bug Blocks: 1450111, 1450940    

Description Lukáš Hellebrandt 2017-05-17 13:31:01 UTC
Description of problem:
Exception thrown while handling exception in /usr/share/rhn/osad/jabber_lib.py

How reproducible:
Deterministic

Steps to Reproduce:
Cause problems with SSL connection to DB, for example use reproducer from OP of bug 1451656

Actual results:
***
Starting osa-dispatcher: Spacewalk 13194 2017/05/17 15:25:56 +02:00: ('Error caught:',)

ERROR: unhandled exception occurred: (can't write str to text stream).
***

Expected results:
Exception handled correctly and without causing another exception

Comment 1 Lukáš Hellebrandt 2017-05-17 13:36:47 UTC
The issue is caused in line 164 of /usr/share/rhn/osad/jabber_lib.py by log_error(extract_traceback()), try commenting out exception catching at the end of /usr/sbin/osa-dispatcher:

Traceback (most recent call last):
  File "/usr/sbin/osa-dispatcher", line 37, in <module>
    sys.exit(mod.main() or 0)
  File "/usr/share/rhn/osad/osa_dispatcher.py", line 37, in main
    return Runner().main()
  File "/usr/share/rhn/osad/jabber_lib.py", line 164, in main
    log_error(extract_traceback())
  File "/usr/share/rhn/osad/jabber_lib.py", line 1531, in extract_traceback
    traceback.print_exc(None, sio)
  File "/usr/lib64/python2.6/traceback.py", line 233, in print_exc
    print_exception(etype, value, tb, limit, file)
  File "/usr/lib64/python2.6/traceback.py", line 124, in print_exception
    _print(file, 'Traceback (most recent call last):')
  File "/usr/lib64/python2.6/traceback.py", line 13, in _print
    file.write(str+terminator)
  File "/usr/lib64/python2.6/io.py", line 1515, in write
    s.__class__.__name__)
TypeError: can't write str to text stream

Comment 2 Tomáš Kašpárek 2017-10-09 10:08:29 UTC
spacewalk.git(master): 479863b4797bef88721b6f5d189b358c06113c94

Comment 7 Pavel Studeník 2018-01-24 13:48:01 UTC
Verified with osa-dispatcher-5.11.63-14.el6sat.noarch in our automation.

Comment 10 errata-xmlrpc 2018-02-05 13:57:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0274