NoneType object has no attribute timeout
Sometimes, when I call a custom service, I'll get the exception:
Exception in thread Thread-3 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 754, in run
File "/usr/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 154, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'timeout'
However, it's nondeterministic. A second call may return the same exception or fail. Since the traceback doesn't include any file from my application, I'm not sure how to debug this. What's causing this error?