From 2fd26581eb3da76c695a1f420a59336ab41390da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Mon, 1 Jun 2026 16:18:24 +0100 Subject: [PATCH] fix(ns-api): guard ports-check migration against non-JSON last_probe_result The 20260415 migration cast last_probe_result::jsonb guarded only by a btrim non-empty check, so any row with non-JSON text aborted the whole migration. Add the same last_probe_result ~ '^[\[{]' guard the follow-up 20260519133000 migration uses, directly to both UPDATEs here. --- .../migrations_pg/20260415000000_gateways_ports_check.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nym-node-status-api/nym-node-status-api/migrations_pg/20260415000000_gateways_ports_check.sql b/nym-node-status-api/nym-node-status-api/migrations_pg/20260415000000_gateways_ports_check.sql index e521cb2aa5..f506b093f5 100644 --- a/nym-node-status-api/nym-node-status-api/migrations_pg/20260415000000_gateways_ports_check.sql +++ b/nym-node-status-api/nym-node-status-api/migrations_pg/20260415000000_gateways_ports_check.sql @@ -4,6 +4,7 @@ UPDATE gateways SET ports_check = (last_probe_result::jsonb -> 'ports_check') WHERE last_probe_result IS NOT NULL AND btrim(last_probe_result) <> '' + AND last_probe_result ~ '^[\[{]' AND last_probe_result::jsonb ? 'ports_check' AND ports_check IS NULL; @@ -11,4 +12,5 @@ UPDATE gateways SET last_probe_result = (last_probe_result::jsonb - 'ports_check')::text WHERE last_probe_result IS NOT NULL AND btrim(last_probe_result) <> '' + AND last_probe_result ~ '^[\[{]' AND last_probe_result::jsonb ? 'ports_check'; \ No newline at end of file