project-nomad/admin/app/services
Chris Sherwood 4ad7e84a19 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-08 11:19:04 -07:00
..
app_auto_update_service.ts feat(supply-depot): opt-in automatic updates for installed apps 2026-06-07 15:56:42 -07:00
auto_update_service.ts feat(supply-depot): opt-in automatic updates for installed apps 2026-06-07 15:56:42 -07:00
benchmark_service.ts fix(AI): vendor-aware AMD HSA override + benchmark discrete-GPU detection 2026-05-20 10:16:00 -07:00
chat_service.ts fix(AI): qwen2.5 loading on every chat message (#649) 2026-04-21 14:26:28 -07:00
collection_manifest_service.ts fix(content): show selected tier on cards while downloads are in flight 2026-05-20 10:16:00 -07:00
collection_update_service.ts feat(content-updates): show size, surface downloads in Active Downloads 2026-05-20 10:16:00 -07:00
container_registry_service.ts feat(system): add opt-in automatic updates for the core NOMAD app 2026-06-07 15:52:56 -07:00
countries_service.ts feat(Maps): regional map downloads via go-pmtiles extract (#780) 2026-05-20 10:16:00 -07:00
custom_app_guard.ts feat: supply depot 2026-06-06 11:08:52 -07:00
docker_service.ts fix(system): roll back service update when the new container fails to start 2026-06-08 11:19:04 -07:00
docs_service.ts feat(supply-depot): per-app onboarding docs, install fixes, and in-app Docs links 2026-06-06 11:08:52 -07:00
download_service.ts feat(Maps): regional map downloads via go-pmtiles extract (#780) 2026-05-20 10:16:00 -07:00
kiwix_library_service.ts feat(zim): add "Rescan Library" button for sideloaded ZIM files 2026-06-06 11:04:53 -07:00
map_service.ts fix: minor type guarding fixes after axios bump 2026-06-07 21:18:42 +00:00
ollama_service.ts refactor(AI): single source of truth for embedding model name 2026-05-20 10:16:00 -07:00
queue_service.ts fix(queue): singleton QueueService to stop ioredis connection leak 2026-05-20 10:16:00 -07:00
rag_service.ts perf(KB): swap Qdrant full-scroll for facet on source enumeration (#928) 2026-06-06 10:55:20 -07:00
system_service.ts feat(supply-depot): opt-in automatic updates for installed apps 2026-06-07 15:56:42 -07:00
system_update_service.ts feat(system): add opt-in automatic updates for the core NOMAD app 2026-06-07 15:52:56 -07:00
zim_extraction_service.ts fix(RAG): report ZIM ingestion progress in overall-file frame 2026-05-20 10:16:00 -07:00
zim_service.ts feat(zim): add "Rescan Library" button for sideloaded ZIM files 2026-06-06 11:04:53 -07:00