Bug 7009 - poor error handling for callers of create_user_socket
Summary: poor error handling for callers of create_user_socket
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.3.1
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Peter Åstrand
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-12 10:17 CEST by Pierre Ossman
Modified: 2020-04-22 11:04 CEST (History)
2 users (show)

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2017-07-12 10:17:16 CEST
It rarely fails, but when it does it will return an empty string. However none of our callers check for this and will instead throw an exception when failing to open the socket.

We have callers in:

./tladm/modules/thinlinc/tlwebadm/status.py
./vsm/thinlinc-login
./webaccess/modules/thinlinc/tlwebaccess/main.py
Comment 2 Pierre Ossman cendio 2017-07-12 10:19:13 CEST
Example backtrace:

> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: ----------------------------------------
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: Traceback (most recent call last):
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "/opt/thinlinc/sbin/tlwebaccess", line 327, in post_or_get
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: i1I11i1iI , ooO00OO0 = getattr ( OoOO , action ) ( iI1Iii , OooOoooOo , i1I11i1iI )
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "/opt/thinlinc/modules/thinlinc/tlwebaccess/main.py", line 142, in do_GET
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: self . _GET_METHODS . get ( page_name , self . error_404 ) ( query ) )
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "/opt/thinlinc/modules/thinlinc/tlwebaccess/main.py", line 324, in home
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: return self . check_authenticated ( iI1ii1Ii , i1i , Oo000o , o00oOO0o )
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "/opt/thinlinc/modules/thinlinc/tlwebaccess/main.py", line 398, in check_authenticated
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: return self . thinlinc_login ( username , iiIi1IIi1I , screen_size_array )
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "/opt/thinlinc/modules/thinlinc/tlwebaccess/main.py", line 498, in thinlinc_login
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: oO00O000oO0 = O0O0OOOOoo . get_capabilities ( { } )
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in_call_
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: return self._send(self._name, args)
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: verbose=self.__verbose
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "/opt/thinlinc/modules/thinlinc/vsm/unixxmlrpc.py", line 41, in request
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: request_body , verbose )
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "/usr/lib64/python2.6/xmlrpclib.py", line 1235, in request
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: self.send_content(h, request_body)
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "/usr/lib64/python2.6/xmlrpclib.py", line 1349, in send_content
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: connection.endheaders()
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "/usr/lib64/python2.6/httplib.py", line 908, in endheaders
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: self._send_output()
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "/usr/lib64/python2.6/httplib.py", line 780, in _send_output
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: self.send(msg)
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "/usr/lib64/python2.6/httplib.py", line 739, in send
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: self.connect()
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "/opt/thinlinc/modules/thinlinc/vsm/unixxmlrpc.py", line 24, in connect
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: self . sock . connect ( self . host )
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: File "<string>", line 1, in connect
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: error: [Errno 2] No such file or directory
> 2017-06-27 05:13:01 ERROR tlwebaccess[13589]: ----------------------------------------

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