Skip to content

Entrypoint integrity check: detect 0-byte server.js before supervisord starts #3542

Description

@Yeraze

Problem

docker compose pull can cache a corrupt image layer, resulting in a 0-byte dist/server/server.js. Node.js exits silently with code 0, supervisord retries until FATAL, and the container appears to crash-loop with no actionable error message. The root cause (corrupt/incomplete pull) is not surfaced to the user.

Observed in the wild on 2026-06-18 — docker rmi + fresh pull resolved it.

Proposed Fix: Entrypoint Integrity Check

Before handing off to supervisord, the container entrypoint should verify that dist/server/server.js exists and is non-zero in size. If the check fails, emit a clear human-readable error and exit non-zero so the failure is immediately visible in docker compose logs.

Example shell check to add to entrypoint:

if [ ! -s /app/dist/server/server.js ]; then
  echo "❌ FATAL: /app/dist/server/server.js is missing or empty — image may be corrupt."
  echo "   Fix: docker rmi ghcr.io/yeraze/meshmonitor && docker compose pull && docker compose up -d"
  exit 1
fi

Why This Over Other Options

  • SHA digest pinning — rejects corrupt pulls at the cost of manual digest updates every release.
  • Compose healthcheck — surfaces failure faster via docker compose ps but doesn't explain why.
  • Entrypoint check (recommended) — lowest friction, actionable error message, zero ongoing maintenance cost.

Steps to Reproduce

  1. Run docker compose pull while network is unstable or image layer is partially cached.
  2. Start the stack — meshmonitor exits immediately with code 0, supervisord enters FATAL.
  3. docker compose logs meshmonitor shows no error beyond "exited: meshmonitor (exit status 0; not expected)".

Authored by NodeZero 0️⃣

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions