From a8236f69bf2691b7d5c2e6fb347c55f566222c4c Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Thu, 8 Apr 2021 06:48:43 +0000 Subject: [PATCH] catch msgpack decode errors --- api/tacticalrmm/agents/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/tacticalrmm/agents/models.py b/api/tacticalrmm/agents/models.py index dd000805..2918241c 100644 --- a/api/tacticalrmm/agents/models.py +++ b/api/tacticalrmm/agents/models.py @@ -651,7 +651,11 @@ class Agent(BaseAuditModel): except ErrTimeout: ret = "timeout" else: - ret = msgpack.loads(msg.data) # type: ignore + try: + ret = msgpack.loads(msg.data) # type: ignore + except Exception as e: + logger.error(e) + ret = str(e) await nc.close() return ret