From 8a056a381b114b599870686fd246e8daf052145b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Murat=20=C3=96ZDEM=C4=B0R?= Date: Fri, 26 Jun 2026 23:23:02 +0300 Subject: [PATCH 1/6] fix(monitoring): prevent Vault crash and DNS null error - Vault: Wrap resp.json() in a try-except block to prevent JSONDecodeError when hitting an HTML error page (e.g. 502/503). This prevents the entire agent from crashing and missing heartbeats. - Uptime Kuma DNS: Explicitly set dns_resolve_server to 1.1.1.1 in Python API payload to prevent Uptime Kuma backend from crashing on null properties. --- health-agent/scripts/setup_uptime_kuma.py | 2 ++ health-agent/src/health_agent/checks/http.py | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/health-agent/scripts/setup_uptime_kuma.py b/health-agent/scripts/setup_uptime_kuma.py index 8a9294e..985f5d5 100644 --- a/health-agent/scripts/setup_uptime_kuma.py +++ b/health-agent/scripts/setup_uptime_kuma.py @@ -261,6 +261,7 @@ def setup_uptime_kuma(dry_run=False, only=None): "hostname": hostname, "port": 53, "accepted_statuscodes": ["200-299"], + "dns_resolve_server": "1.1.1.1", "dns_resolve_type": dns_resolve_type, "interval": interval, } @@ -280,6 +281,7 @@ def setup_uptime_kuma(dry_run=False, only=None): "hostname": hostname, "port": 53, "accepted_statuscodes": ["200-299"], + "dns_resolve_server": "1.1.1.1", "dns_resolve_type": dns_resolve_type, "interval": interval, } diff --git a/health-agent/src/health_agent/checks/http.py b/health-agent/src/health_agent/checks/http.py index 5191392..257d721 100644 --- a/health-agent/src/health_agent/checks/http.py +++ b/health-agent/src/health_agent/checks/http.py @@ -140,11 +140,14 @@ def check_vault(): max_ping = max(max_ping, ms) if resp is not None: - data = resp.json() - if not data.get("sealed"): - unsealed_count += 1 - else: - errors.append(f"{node} SEALED") + try: + data = resp.json() + if not data.get("sealed"): + unsealed_count += 1 + else: + errors.append(f"{node} SEALED") + except Exception as e: + errors.append(f"{node} invalid response: {resp.status_code}") else: errors.append(f"{node} unreachable: {err}") From c1cda0b38a5d80ab1b2645665e3291bfec3c843c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Murat=20=C3=96ZDEM=C4=B0R?= Date: Fri, 26 Jun 2026 23:31:39 +0300 Subject: [PATCH 2/6] health-agent redeploy with new image --- health-agent/deploy/prod.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/health-agent/deploy/prod.env b/health-agent/deploy/prod.env index 4073bf7..4524d24 100644 --- a/health-agent/deploy/prod.env +++ b/health-agent/deploy/prod.env @@ -1,2 +1,2 @@ -SOURCE_IMAGE_DIGEST=registry.tarla.io/iklimco/health-agent@sha256:196bb9b1cbb7acd7cd8671f7a3e9e3f0078a0c74658c66c9c22881fa66d75242 +SOURCE_IMAGE_DIGEST=registry.tarla.io/iklimco/health-agent@sha256:94acbcf645676451ed24846f672d83f8491961ef478e0ee90554395ce0f4ac52 PROD_IMAGE_TAG=0.1.0 \ No newline at end of file From a7ecfc4b2db6b5a080f82bff5460e574603af759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Murat=20=C3=96ZDEM=C4=B0R?= Date: Fri, 26 Jun 2026 23:46:08 +0300 Subject: [PATCH 3/6] fix(monitoring): add missing url property to DNS monitors The Node.js backend of Uptime Kuma 2.4.0 seems to crash on DNS monitors with 'Cannot read properties of null (reading length)' if the 'url' field is not explicitly set, because the API defaults it to null instead of 'https://' like the UI does. --- health-agent/scripts/setup_uptime_kuma.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/health-agent/scripts/setup_uptime_kuma.py b/health-agent/scripts/setup_uptime_kuma.py index 985f5d5..65b0726 100644 --- a/health-agent/scripts/setup_uptime_kuma.py +++ b/health-agent/scripts/setup_uptime_kuma.py @@ -264,6 +264,7 @@ def setup_uptime_kuma(dry_run=False, only=None): "dns_resolve_server": "1.1.1.1", "dns_resolve_type": dns_resolve_type, "interval": interval, + "url": "https://", } if parent_group_id is not None: kwargs["parent"] = parent_group_id @@ -284,6 +285,7 @@ def setup_uptime_kuma(dry_run=False, only=None): "dns_resolve_server": "1.1.1.1", "dns_resolve_type": dns_resolve_type, "interval": interval, + "url": "https://", } if parent_group_id is not None: kwargs["parent"] = parent_group_id From 6f3bf6cef10748ae734393634bceba74ba7c8af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Murat=20=C3=96ZDEM=C4=B0R?= Date: Fri, 26 Jun 2026 23:48:58 +0300 Subject: [PATCH 4/6] health-agent redeploy with new image --- health-agent/deploy/prod.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/health-agent/deploy/prod.env b/health-agent/deploy/prod.env index 4524d24..a46b398 100644 --- a/health-agent/deploy/prod.env +++ b/health-agent/deploy/prod.env @@ -1,2 +1,2 @@ -SOURCE_IMAGE_DIGEST=registry.tarla.io/iklimco/health-agent@sha256:94acbcf645676451ed24846f672d83f8491961ef478e0ee90554395ce0f4ac52 +SOURCE_IMAGE_DIGEST=registry.tarla.io/iklimco/health-agent@sha256:9144295dc252f612a2572b24728c7f52e833a7f919588e1b9bbe3676d731c092 PROD_IMAGE_TAG=0.1.0 \ No newline at end of file From c2908824921b0886966b1831f6f73742ad829f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Murat=20=C3=96ZDEM=C4=B0R?= Date: Fri, 26 Jun 2026 23:54:20 +0300 Subject: [PATCH 5/6] fix(monitoring): add missing conditions array to DNS monitors Uptime Kuma 1.23+ evaluates monitor.conditions.length internally. While HTTP monitors seem to bypass this check safely if conditions is null, DNS monitors crash the NodeJS backend with 'Cannot read properties of null (reading length)' if conditions is not explicitly initialized as an empty array. --- health-agent/scripts/setup_uptime_kuma.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/health-agent/scripts/setup_uptime_kuma.py b/health-agent/scripts/setup_uptime_kuma.py index 65b0726..d34830c 100644 --- a/health-agent/scripts/setup_uptime_kuma.py +++ b/health-agent/scripts/setup_uptime_kuma.py @@ -265,6 +265,7 @@ def setup_uptime_kuma(dry_run=False, only=None): "dns_resolve_type": dns_resolve_type, "interval": interval, "url": "https://", + "conditions": [], } if parent_group_id is not None: kwargs["parent"] = parent_group_id @@ -286,6 +287,7 @@ def setup_uptime_kuma(dry_run=False, only=None): "dns_resolve_type": dns_resolve_type, "interval": interval, "url": "https://", + "conditions": [], } if parent_group_id is not None: kwargs["parent"] = parent_group_id From 30fe75d38323745080995c450a3e05b671904e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Murat=20=C3=96ZDEM=C4=B0R?= Date: Fri, 26 Jun 2026 23:56:44 +0300 Subject: [PATCH 6/6] health-agent redeploy with new image --- health-agent/deploy/prod.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/health-agent/deploy/prod.env b/health-agent/deploy/prod.env index a46b398..1d6240f 100644 --- a/health-agent/deploy/prod.env +++ b/health-agent/deploy/prod.env @@ -1,2 +1,2 @@ -SOURCE_IMAGE_DIGEST=registry.tarla.io/iklimco/health-agent@sha256:9144295dc252f612a2572b24728c7f52e833a7f919588e1b9bbe3676d731c092 +SOURCE_IMAGE_DIGEST=registry.tarla.io/iklimco/health-agent@sha256:651733aa901c5a8736495c4c9535599629fb8e0c40b472028020569733865813 PROD_IMAGE_TAG=0.1.0 \ No newline at end of file