Urgent: Deployment Failure on Railway (Nixpacks + Node.js 22) - Need Help Debugging
aidotokihisa11
HOBBYOP

a year ago

Hello everyone,

I'm encountering a critical deployment failure on Railway and would greatly appreciate your expertise in debugging this issue. Here's a complete breakdown of the problem:

šŸš€ Project Overview

šŸ”„ Error Description

The build fails silently during the image creation phase with no clear error message. The process stops abruptly after the COPY . /app command in Nixpacks.

šŸ“œ Complete Logs

Nixpacks Output:

[Region: us-west1]
[stage-0 3/8] COPY .nixpacks/nixpkgs-*.nix āœ” 19s
[stage-0 8/8] COPY . /app
# Process terminates here with no further output

Railway UI Error:

- Deployment failed during build process
! Build > Build image: Failed to build an image
- Deploy: Not started
- Post-deploy: Not started

šŸ›  Troubleshooting Attempts

AttemptResultRebuild without cacheSame failureDowngrade to Node.js 20Identical behaviorVerified file permissionsNo issues foundLocal build with nixpacks build .

šŸ” Technical Analysis

Project Structure:

bot-discord/
ā”œā”€ā”€ .nixpacks/
│   └── nixpkgs-*.nix
ā”œā”€ā”€ node_modules/ (38MB)
ā”œā”€ā”€ src/
ā”œā”€ā”€ package.json
└── index.js

Key Config Files:

package.json:

{
  "scripts": {
    "start": "node index.js",
    "build": ""
  }
}

.nixpacks/nixpkgs-*.nix:

{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
  buildInputs = [ pkgs.nodejs-22_x pkgs.npm ];
}

ā“ Hypotheses

  1. Size Limitations:
    • 38MB node_modules causing timeout during copy
    • Possible memory limits exceeded (2GB default on Railway?)
  2. Compatibility Issues:
    • Node.js 22 too new for Nixpacks
    • Known issues with npm 9.x
  3. Configuration Problems:
    • Empty build script in package.json
    • Missing files in Docker context

šŸ†˜ Specific Requests for Help

  1. How to access complete build logs?
    • Are there hidden Docker/Nixpacks logs on Railway?
    • CLI command to get verbose output?
  2. Alternative solutions:
    • Working Dockerfile example for Node.js 22
    • Optimal Nixpacks configuration for recent Node.js
  3. Advanced debugging:
    • How to reproduce Railway's build constraints locally?
    • Tools to monitor memory usage during build?

Final Appeal

I've been stuck on this for days and would deeply appreciate any assistance. I'm available to:

  • Provide temporary project access
  • Run additional tests
  • Supply more information as needed

Thank you in advance for your time and expertise!

$10 Bounty

1 Replies

sim
FREE

a year ago

Give Railpack a try — it could handle the build differently and help get things moving.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...