a month ago
Hello Railway Team,
I'm facing a persistent deployment issue with my project Ration-Authentication. Every deployment fails during the build stage, even after making several configuration changes and multiple redeployments.
Repository: GitHub (connected to Railway)
Issue:
Every deployment fails with "Failed to build an image".
The deployment never reaches the application startup stage.
The failure occurs during the build process.
Diagnosis shown by Railway:
The deployment page reports an infrastructure error stating that the rootDirectory setting was not applied during the Nixpacks build step, causing Railway to scan the repository root instead of the intended backend directory. It also mentions that retrying with the same code and configuration succeeded internally, suggesting the problem may not be caused by my code.
Changes I have already made:
Updated the railway.json configuration.
Replaced the default Nixpacks builder configuration.
Added explicit build and start commands.
Configured Gunicorn to use the virtual environment Python path.
Verified that all required dependencies are listed in requirements.txt.
Triggered multiple redeployments from GitHub.
Confirmed that the latest commits are reaching Railway.
Current behavior:
Build starts.
Image build fails within a few seconds.
Deployment status remains Failed.
The project never becomes healthy or starts the application.
What I need help with:
Determine why Railway is failing to build the image.
Verify whether the correct rootDirectory is being used during deployment.
Check whether the latest railway.json configuration is actually being applied.
Confirm whether this is an infrastructure issue or a project configuration issue.
Advise what changes are still required to successfully deploy the application.
I have attached screenshots of the deployment failure and Railway's diagnostic message for reference.
Thank you for your assistance.