From 757f5b3f0dea58e4a458ad99eca3b6f510f2febf Mon Sep 17 00:00:00 2001 From: master <> Date: Mon, 16 Mar 2026 22:25:16 +0200 Subject: [PATCH] Fix registry search 500: handle non-JSON Harbor fixture response Harbor fixture returns plain text, not JSON. The RegistrySearchEndpoints deserialization crashed with an unhandled JsonException causing 500 on every /api/v1/registries/images/search request. This blocked the release creation wizard at Step 2 (Components). Fix: catch JsonException and return empty results gracefully. The release wizard now shows "no results" instead of silently failing. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../Endpoints/RegistrySearchEndpoints.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Platform/StellaOps.Platform.WebService/Endpoints/RegistrySearchEndpoints.cs b/src/Platform/StellaOps.Platform.WebService/Endpoints/RegistrySearchEndpoints.cs index 3949877b1..a7a14e948 100644 --- a/src/Platform/StellaOps.Platform.WebService/Endpoints/RegistrySearchEndpoints.cs +++ b/src/Platform/StellaOps.Platform.WebService/Endpoints/RegistrySearchEndpoints.cs @@ -109,6 +109,17 @@ public static class RegistrySearchEndpoints RegistryId = "harbor-fixture" }); } + catch (JsonException jex) + { + logger.LogWarning(jex, "Harbor returned non-JSON response for query '{Query}'", query); + + return Results.Ok(new RegistrySearchResponse + { + Items = [], + TotalCount = 0, + RegistryId = "harbor-fixture" + }); + } catch (Exception ex) when (ex is HttpRequestException or TaskCanceledException or OperationCanceledException) { logger.LogWarning(ex, "Harbor registry unreachable during image search for query '{Query}'", query);