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

5 months 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?)

  1. Compatibility Issues:

    • Node.js 22 too new for Nixpacks

    • Known issues with npm 9.x

  1. 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?

  1. Alternative solutions:

    • Working Dockerfile example for Node.js 22

    • Optimal Nixpacks configuration for recent Node.js

  1. 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

5 months ago

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


Loading...