17 days ago
My hindi-sikho-backend service repeatedly fails during build preparation.
Error:
“Railpack failed to prepare the build.”
Railway diagnosis says:
“Infrastructure Error”
The same commit and configuration previously built successfully.
Multiple redeployments now fail during build preparation with no useful build logs.
Please investigate the builder/build infrastructure and allow this service to build successfully.
Service: hindi-sikho-backend
Root directory: /server
Builder: Railpack
Healthcheck: /health
5 Replies
17 days ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 17 days ago
milo
could you share the code for this / a way to reproduce this issue?
16 days ago
I've attached the backend source ZIP for reproduction.
Backend path in the repository:
/server
Please reproduce the issue using /server as the root directory.
The deployment fails during Railpack build preparation.
Status changed to Solved avinashcraneop-create • 16 days ago
avinashcraneop-create
I've attached the backend source ZIP for reproduction. Backend path in the repository: /server Please reproduce the issue using /server as the root directory. The deployment fails during Railpack build preparation.
16 days ago
GitHub repository:
https://github.com/avinashcraneop-create/hindi-sikho
Backend code location:
/server
Files:
/server/server.js
/server/package.json
/server/README.md
How to reproduce:
- Deploy the main branch.
- Set Root Directory to /server.
- Builder: Railpack.
- Healthcheck: /health.
- Start the deployment.
The deployment fails before the build starts with:
“Railpack failed to prepare the build”
The log only shows:
“scheduling build on Metal builder”
The same repository/config works for the frontend service, but the backend service fails during build preparation.
Status changed to Awaiting Conductor Response Railway • 16 days ago
milo
could you share the code for this / a way to reproduce this issue?
16 days ago
GitHub repository:
https://github.com/avinashcraneop-create/hindi-sikho
Backend code location:
/server
Files:
/server/server.js
/server/package.json
/server/README.md
How to reproduce:
- Deploy the main branch.
- Set Root Directory to /server.
- Builder: Railpack.
- Healthcheck: /health.
- Start the deployment.
The deployment fails before the build starts with:
“Railpack failed to prepare the build”
The log only shows:
“scheduling build on Metal builder”
The same repository/config works for the frontend service, but the backend service fails during build preparation.
16 days ago
Hi,
I reproduced this from your public repo with /server as the root directory. The current /server/package.json is effectively empty (one newline). In a fresh Railway service, both that file and no package.json failed during Railpack preparation, with only the Metal builder scheduling message in the logs.
I then added a valid package.json with "type": "module", "start": "node server.js", and the dependencies imported by server.js (express, cors, bcryptjs, jsonwebtoken, pg, dotenv). The Railpack build completed successfully.