Railway Support: Zero Runtime Logs / Container Crash Loop
brrylabs
HOBBYOP

2 months ago

Service Details

  • Builder: Dockerfile (previously Railpack/Nixpacks)
  • Runtime: Node.js 22 (node:22) + pnpm 9.15.9
  • Framework: Fastify
  • Port: 3000 (configured in Public Networking)

Problem

The application fails to respond at/ping. Deploy logs are completely empty — no runtime output is captured at all. The only log entries visible are repeated "Stopping Container" messages, indicating a crash loop.

What We've Tried (Chronological)

1. Railpack/Nixpacks Builder (Original)

Build plan showed pnpm run build in the steps, but the build step never executed. Every step showed cached 0ms even after:

  • Disabling cache via dashboard ("Clear Build Cache")
  • Setting NO_CACHE=1 environment variable
  • Setting noCache = true in railway.toml

Build output consistently showed pnpm run build cached 0ms — the TypeScript compilation never ran, meaning the compiled lib/index.js was never produced.

2. Switched to Dockerfile

Created an explicit Dockerfile to bypass Railpack:

dockerfile

FROM node:22
RUN corepack enable && corepack prepare pnpm@9.15.9 --activate
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm run build && ls -la lib/index.js
EXPOSE 3000
CMD ["sh", "-c", "echo BOOT && node -e 'console.log(\"NODE OK\")' && node lib/index.js 2>&1"]

Build succeeds.pnpm run build runs, lib/index.js is verified (29,035 bytes). However:

  • Zero deploy/runtime logs
  • Not even echo BOOT (shell built-in) appears in logs
  • Container status shows "Stopping Container" x4

3. Fixed Port Mismatch

Discovered Public Networking was set to port 8080 while the app listens on 3000. Changed to 3000. Still no response, still zero logs.

4. Minimal Container Test

Replaced Dockerfile CMD with a bare-minimum test — no Node.js, just echo and sleep:

dockerfile

CMD ["sh", "-c", "echo BOOT && sleep 300"]

Build succeeded. Still zero deploy logs. The container cannot even execute echo BOOT and sleep.

Key Observations

  • Build always succeeds — the Docker image is created and pushed (~452 MB)
  • Deploy logs are completely empty across all attempts
  • The container never produces any stdout/stderr visible in Railway's log viewer
  • "Stopping Container" appears 4 times, indicating Railway detects the container exiting
  • Even a trivial echo && sleep CMD produces no output
  • This suggests the container itself is not being started, or Railway's log pipeline is broken for this service
  • The behavior is identical across Nixpacks, Railpack, and Dockerfile builders

Environment

Railway env vars configured

Current Configuration

railway.toml:

toml

[build]
  dockerfilePath = "Dockerfile"

.dockerignore:

node_modules
npm-debug.log
.git
.gitignore
README.md
.env
.nyc_output
coverage
.coverage
.coverage/
lib
*.log
.DS_Store

Request

Please investigate why:

  1. The container produces zero runtime logs — not even a shell echo
  2. The container appears to enter a crash loop ("Stopping Container" x4) despite a valid Docker image
  3. Whether there is a platform-level issue preventing containers from starting on this service

This service was previously working. Any insight into infrastructure changes or issues affecting this service would be appreciated.

Solved

2 Replies

Railway
BOT

2 months ago

Your most recent deployments are crashing on startup because a required environment variable REVENUECAT_API_KEY is missing - the service logs show the error env must have required property 'REVENUECAT_API_KEY' repeating across multiple restart attempts, which is what produces the "Stopping Container" pattern you're seeing.


Status changed to Awaiting User Response Railway about 2 months ago


Status changed to Awaiting Railway Response Railway about 2 months ago


sam-a
EMPLOYEE

2 months ago

Thanks for the detailed investigation steps. The fact that even a minimal echo BOOT && sleep 300 produces zero logs rules out application-level causes like missing environment variables.

To help isolate whether this is infrastructure-specific, can you try changing your service's region temporarily?

  1. Go to your service's Settings → Region
  2. Switch to a different region (e.g., if you're on us-west1, try us-east4)
  3. This will trigger a new deployment on completely different infrastructure

If it works in a different region, that confirms the issue is specific to your current deployment host rather than your code or configuration.

Also, I noticed your latest deployment used Railpack (not your Dockerfile) based on the build output showing ↳ Detected Node and the deploy command ls -la lib/ && head -1 lib/index.js && node lib/index.js. If you want to force Dockerfile usage, make sure your railway.toml has:

[build]
builder = "dockerfile"
dockerfilePath = "Dockerfile"

Let us know if the region change helps — that will guide next steps.


Status changed to Awaiting User Response Railway about 2 months ago


Railway
BOT

a month ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway about 1 month ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...