# Help with exception in subscriber

I have a rospy implementation of an object tracker in which I m trying to publish the objects tracked. The message in addition to other attributes has two arrays predictions and observation history. This message is filled from a class which maintains the tracks. The tracker node is designed as follows.

1. A callback which gets called by detector and does the tracking
2. A publish loop that keeps publishing the tracked objects from the common class object. This runs at a fixed rate (say 20 Hz)

Now when I run simulation from a rosbag everything works fine upto some time instant (which is not deterministic and keeps changing) after which I no longer receive the messages published by the publisher. Later when I checked the logs I found that the subscriber is getting an exception. The publisher node seems to be working fine without any error. I understood this might be due to race conditions of the common resource and also implemented locking mechanisms. But no luck. Can someone help me understand what the exception is trying to convey?

[rospy.msg][ERROR] 2019-05-28 21:57:34,225: cannot deserialize message: EXCEPTION Traceback (most recent call last):
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/msg.py", line 223, in deserialize_messages
msg_queue.append(data.deserialize(q))
File "/home/v6balasu/catkin_ws/devel/lib/python2.7/dist-packages/anm_msgs/msg/_TrackedObjectList.py", line 378, in deserialize
raise genpy.DeserializationError(e) #most likely buffer underfill
DeserializationError: unpack requires a string argument of length 24

[rospy.internal][ERROR] 2019-05-28 21:57:34,274: Traceback (most recent call last):
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 727, in receive_once
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 394, in read_messages
deserialize_messages(b, msg_queue, self.recv_data_class, queue_size=self.queue_size)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/msg.py", line 245, in deserialize_messages
raise genpy.DeserializationError("cannot deserialize: %s"%str(e))
DeserializationError: cannot deserialize: unpack requires a string argument of length 24


A few lines later I get this TCP header error which also seems to give some clue

[rospy.internal][WARNING] 2019-05-28 21:57:34,280: Unknown error initiating TCP/IP socket to (REDACTED) (http://(REDACTED)/): Traceback (most recent call last):
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 557, in connect