project-nomad/admin/app
Chris Sherwood 277d7ce747 fix(system): roll back service update when the new container fails to start
The service update path stopped and renamed the old container aside before
the new one was confirmed running, but only wired up rollback if
createContainer threw or the 5s health check failed. A throw from
newContainer.start() itself (bad device/GPU config, host port already bound,
image incompatibility) bubbled straight to the outer catch, which returned a
generic 400 and never restored the old container, leaving the service down.

Retrying then wedged: the failed new container still held the service name, so
the next attempt's rename to `<name>_old` collided with the leftover from the
first attempt and threw the same error every time.

- Wrap newContainer.start() so a start failure removes the half-created
  container and rolls back to the previous one.
- Clear any stale `<name>_old` before renaming so retries can't collide.
- Dedupe the three rollback sites into a single rollbackToOld() helper (also
  removes a non-null assertion in the create-failure path that could itself
  throw when no `_old` existed).

Refs #949

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 15:20:10 -07:00
..
controllers fix(rag): improve context-reliance hedging and use heading metadata at query time 2026-06-03 21:58:28 -07:00
exceptions fix(Docs): documentation renderer fixes 2025-12-23 16:00:33 -08:00
jobs fix(KB): respect Manual ingest policy on post-download dispatch 2026-05-20 10:16:00 -07:00
middleware fix(API): skip compression for Server-Sent Events (#798) 2026-05-20 10:16:00 -07:00
models fix(models): correct inverted belongsTo keys on ChatMessage.session (#921) 2026-05-20 10:16:00 -07:00
services fix(system): roll back service update when the new container fails to start 2026-06-05 15:20:10 -07:00
utils refactor(KB): move FileWarning to shared types/rag following existing convention 2026-05-20 10:16:00 -07:00
validators fix(security): canonicalize hostnames to block IPv4-mapped IPv6 IMDS bypass 2026-05-20 10:16:00 -07:00