Bug 5666 - bad traceback formatting in logs
Summary: bad traceback formatting in logs
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Other (show other bugs)
Version: pre-1.0
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Peter Åstrand
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-01 16:38 CEST by Pierre Ossman
Modified: 2023-11-20 17:18 CET (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2015-10-01 16:38:34 CEST
Some traceback logging fails to account for the fact that tracebacks consist of multiple line. So we have this code:

            self.log.error("Unhandled exception trying to unbind ports for display %d on VSM Agent %s: %s %s %s. Marking agent as down." % \
                               (self.display, self.url[1],
                                exception, info, format_exc()))

Which would seem like it produces a single line. But instead we get this mess:

2015-10-01 15:42:11 ERROR vsmserver.session: Unhandled exception trying to unbind ports for display 1 on VSM Agent 127.0.0.1:904: <type 'exceptions.TypeError'> 'NoneType' object has no attribute '__getitem__' Tr
aceback (most recent call last):
  File "/opt/thinlinc/modules/thinlinc/vsm/async.py", line 112, in iii11
    obj . handle_read_event ( )
  File "/usr/lib64/python2.7/asyncore.py", line 449, in handle_read_event
    self.handle_read()
  File "/usr/lib64/python2.7/asynchat.py", line 147, in handle_read
    self.found_terminator()
  File "/opt/thinlinc/modules/thinlinc/vsm/xmlrpc.py", line 405, in found_terminator
    self . handle_response ( )
  File "/opt/thinlinc/modules/thinlinc/vsm/xmlrpc.py", line 437, in handle_response
    self . handle_returnvalue ( )
  File "/opt/thinlinc/modules/thinlinc/vsm/call_unbindports.py", line 41, in handle_returnvalue
    self . callback ( )
  File "/opt/thinlinc/modules/thinlinc/vsm/loginhandler_common.py", line 71, in run_sessionscripts
    self . send_response ( )
  File "/opt/thinlinc/modules/thinlinc/vsm/loginhandler_common.py", line 88, in send_response
    oOOoo ) [ 'sessionkey' ]
TypeError: 'NoneType' object has no attribute '__getitem__'
. Marking agent as down.
Comment 4 Pierre Ossman cendio 2023-11-20 17:18:42 CET
This issue is mostly resolved now that we've consolidated all traceback printing in vsmserver and vsmagent. There are a few other cases in the tree, but they all handle this correctly, except for the status module in tlwebadm.

I'm not even sure if it's appropriate for that to output tracebacks as they end up being part of the page shown to the user, not as part of the log.

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