Skip to content

fix(queen): drop the duplicate npm ci that Nixpacks cannot delete - #744

Merged
gHashTag merged 2 commits into
mainfrom
fix/queen-nixpacks-buildcommand
Aug 14, 2026
Merged

gHashTag merged 2 commits into
mainfrom
fix/queen-nixpacks-buildcommand

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

The queen has never deployed

All 13 deployments of the trinity service (project overflowing-renewal, env production) failed. Zero successes.

The first ten failed on the root Dockerfile, which runs find /app/.zig-cache in a fresh runtime stage where /app does not exist — and, having no COPY --from=builder, never ran the builder stage at all.

With the service pointed at apps/queen-web and Nixpacks, the failure moved here:

npm error EBUSY: resource busy or locked, rmdir '/app/node_modules/.cache'
Build Failed: ... "npm ci && npm run build" ... exit code: 240

Cause

Nixpacks mounts a build cache at /app/node_modules/.cache and already runs npm ci in its own install phase:

║ install    │ npm ci                        ║
║ build      │ npm ci && npm run build       ║

Our buildCommand ran npm ci a second time. npm ci deletes node_modules wholesale before installing, and it cannot rmdir the mounted cache directory — so it aborts with EBUSY.

Fix

buildCommand: "npm ci && npm run build" → "npm run build". One line.

Verification

The application was never the problem. Against this exact tree, locally:

command result
npm ci 73 packages, exit 0
npm run build 83 modules transformed, 253.49 kB bundle, exit 0

One thing worth knowing

This file overrides service settings made through the API or dashboard. Setting buildCommand on the service instance had no effect while this line said otherwise — the build kept using the value from here. That cost two deployments to establish.

The queen has never deployed. Every one of the 13 deployments on this service
failed, and the last three failed here:

  npm error EBUSY: resource busy or locked, rmdir '/app/node_modules/.cache'
  exit code: 240

Nixpacks mounts a build cache at /app/node_modules/.cache and already runs
`npm ci` in its own install phase. Our buildCommand ran `npm ci` a second time,
and `npm ci` deletes node_modules wholesale before installing -- it cannot
rmdir the mounted cache, so it aborts.

Verified locally against this exact tree: `npm ci` installs 73 packages and
`npm run build` emits 83 modules / 253 kB, both exit 0. The application was
never the problem.

Note for whoever changes this next: this file OVERRIDES the service settings
set through the API or dashboard. Setting buildCommand on the service instance
had no effect while this line said otherwise -- the build kept using the value
from here.

Королева не деплоилась ни разу: все 13 деплоев упали. Nixpacks монтирует кэш
в /app/node_modules/.cache и сам выполняет npm ci; наша команда сборки
запускала npm ci повторно, а он сносит node_modules целиком и не может
удалить примонтированный каталог. Локально та же версия собирается чисто.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The build now succeeds; the deploy failed at the healthcheck with
"1/1 replicas never became healthy". The container starts and listens:

  > vite preview --host 0.0.0.0 --port ${PORT:-8080}
  ➜  Local: http://localhost:8080/

so the process is alive and the probe still cannot reach it. `vite preview`
is a development preview server: Vite 6 rejects requests whose Host header it
does not recognise, which is exactly what a platform healthcheck sends. Vite's
own documentation says it is not meant to serve production traffic.

Nixpacks had already detected a static build and provisioned Caddy for it:

  ║ caddy   │ pkgs: caddy, cmds: caddy fmt --overwrite /assets/Caddyfile ║

Our startCommand overrode that. Dropping it hands the built `dist` back to
Caddy, which is what the generated plan intended.

Сборка проходит, падал healthcheck. vite preview — это dev-сервер: Vite 6
отклоняет запросы с незнакомым Host, а именно такой шлёт проверка платформы.
Nixpacks уже поднял Caddy для статики, но наш startCommand его перебивал.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@gHashTag
gHashTag merged commit 8cc5b33 into main Aug 14, 2026
15 of 28 checks passed

This branch had an error being deployed

1 failed deployment
overflowing-renewal / production — 6edc6484 Deployed Aug 13, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant