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`)