From 2b14b0dca50e678555dc40b170aa3304617a1500 Mon Sep 17 00:00:00 2001 From: Daan Meijer Date: Mon, 5 Oct 2026 12:17:54 +0200 Subject: [PATCH] seed:node retries 404 from the proxy (seed API restarting) Co-Authored-By: Claude Opus 5.5 --- commands/SeedNode.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/SeedNode.ts b/commands/SeedNode.ts index 19b2bee..76bf2de 100644 --- a/commands/SeedNode.ts +++ b/commands/SeedNode.ts @@ -200,8 +200,9 @@ class SeedApi { if (status >= 200 && status < 300) return text ? JSON.parse(text) : null if (status === 401) throw new Unauthorized('The seed API rejected this node token') if (status === 409) throw new LeaseLost(text) - if (status >= 400 && status < 500) throw new Error(`Seed API ${path}: ${status} ${text.slice(0, 300)}`) - // Network errors and 5xx: storing a batch twice is harmless, so try again. + // 404 comes from the proxy while the seed API restarts (a deploy): this API has no 404s of its own. + if (status >= 400 && status < 500 && status !== 404) throw new Error(`Seed API ${path}: ${status} ${text.slice(0, 300)}`) + // Network errors, 404 and 5xx: storing a batch twice is harmless, so try again. if (attempt >= 8) throw new Error(`Seed API ${path}: ${status || 'no response'} ${text.slice(0, 300)}`) const wait = Math.min(120_000, 2000 * 2 ** (attempt - 1)) this.warn(`Seed API ${path}: ${status || text}; retrying in ${wait / 1000} s`)