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