You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pubsub.subscribe does not validate that topic is not None. If and when then topic is None, there are circumstances (e.g., pushing the subscriptions to external hosts) where it will crash the platform due to an unhandled exception in the pubsub service.
To Reproduce
Call pubsub.subscribe with None as the topic and external_platforms=True (it may happen if external_platforms==False as well, but I haven't tested this). This results in the untimely death of the process:
2023-08-21 20:47:16,469 () volttron.platform.main ERROR: Unhandled exception in router loop
Traceback (most recent call last):
File "/code/volttron/volttron/platform/main.py", line 842, in zmq_router
service_notifier=notifier).run()
File "/code/volttron/volttron/platform/vip/router.py", line 112, in run
self.poll_sockets()
File "/code/volttron/volttron/platform/main.py", line 512, in poll_sockets
self.route(deserialize_frames(frames))
File "/code/volttron/volttron/platform/vip/router.py", line 308, in route
response = self.handle_subsystem(frames, user_id)
File "/code/volttron/volttron/platform/main.py", line 484, in handle_subsystem
result = self.pubsub.handle_subsystem(frames, user_id)
File "/code/volttron/volttron/platform/vip/pubsubservice.py", line 633, in handle_subsystem
result = self._peer_publish(frames, user_id)
File "/code/volttron/volttron/platform/vip/pubsubservice.py", line 314, in _peer_publish
return self._distribute(frames, user_id)
File "/code/volttron/volttron/platform/vip/pubsubservice.py", line 405, in _distribute
external_count = self._distribute_external(frames)
File "/code/volttron/volttron/platform/vip/pubsubservice.py", line 474, in _distribute_external
if topic.startswith(prefix):
TypeError: startswith first arg must be str or a tuple of str, not NoneType
Expected behavior
A handled exception should be raised and caught when a subscription for the topic None is received.
The text was updated successfully, but these errors were encountered:
pubsub.subscribe does not validate that topic is not None. If and when then topic is None, there are circumstances (e.g., pushing the subscriptions to external hosts) where it will crash the platform due to an unhandled exception in the pubsub service.
To Reproduce
Call pubsub.subscribe with None as the topic and external_platforms=True (it may happen if external_platforms==False as well, but I haven't tested this). This results in the untimely death of the process:
2023-08-21 20:47:16,469 () volttron.platform.main ERROR: Unhandled exception in router loop
Traceback (most recent call last):
File "/code/volttron/volttron/platform/main.py", line 842, in zmq_router
service_notifier=notifier).run()
File "/code/volttron/volttron/platform/vip/router.py", line 112, in run
self.poll_sockets()
File "/code/volttron/volttron/platform/main.py", line 512, in poll_sockets
self.route(deserialize_frames(frames))
File "/code/volttron/volttron/platform/vip/router.py", line 308, in route
response = self.handle_subsystem(frames, user_id)
File "/code/volttron/volttron/platform/main.py", line 484, in handle_subsystem
result = self.pubsub.handle_subsystem(frames, user_id)
File "/code/volttron/volttron/platform/vip/pubsubservice.py", line 633, in handle_subsystem
result = self._peer_publish(frames, user_id)
File "/code/volttron/volttron/platform/vip/pubsubservice.py", line 314, in _peer_publish
return self._distribute(frames, user_id)
File "/code/volttron/volttron/platform/vip/pubsubservice.py", line 405, in _distribute
external_count = self._distribute_external(frames)
File "/code/volttron/volttron/platform/vip/pubsubservice.py", line 474, in _distribute_external
if topic.startswith(prefix):
TypeError: startswith first arg must be str or a tuple of str, not NoneType
Expected behavior
A handled exception should be raised and caught when a subscription for the topic None is received.
The text was updated successfully, but these errors were encountered: