From d4fe94fb7a1de6e1e91ad767fd62603a07ec784f Mon Sep 17 00:00:00 2001 From: "Jokob @NetAlertX" <96159884+jokob-sk@users.noreply.github.com> Date: Tue, 26 May 2026 11:30:53 +0000 Subject: [PATCH] Add error handling for base64 decoding in main function to skip invalid data --- front/plugins/sync/sync.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/front/plugins/sync/sync.py b/front/plugins/sync/sync.py index 757e775b..dc464d52 100755 --- a/front/plugins/sync/sync.py +++ b/front/plugins/sync/sync.py @@ -5,6 +5,7 @@ import sys import requests import json import base64 +import binascii # Define the installation path and extend the system path for plugin imports @@ -139,7 +140,11 @@ def main(): data_base64 = response_json.get('data_base64', '') # Decode base64 data - decoded_data = base64.b64decode(data_base64) + try: + decoded_data = base64.b64decode(data_base64) + except (binascii.Error, ValueError, TypeError) as e: + mylog('none', [f'[{pluginName}] Skipping node "{node_name}": base64 decode failed for data_base64="{data_base64}": {e}']) + continue # Create log file name using node name log_file_name = f'{file_prefix}.{node_name}.log'