a month ago
When building production and staging the same time or staging and staging2 etc concurrently (exact same code) I get frequent build failures. Manually triggering a rebuild fixes the problem, but its becoming annoying at this point.
Code is the same, Code is being built and deployed to different environments and I get failure on one of the environments
1 Replies
Status changed to Awaiting Railway Response Railway • about 2 months ago
Status changed to Open Railway • about 1 month ago
a month ago
This usually happens when the builds aren’t actually as identical as they seem.
Even if the code is the same, one environment can still fail if something in the build is different, usually env vars, cached dependencies, or some build step that is a little flaky. That also explains why hitting rebuild often fixes it.
I’d start by checking whether staging and production really have the same setup during build, not just the same code.
If they do, then I’d look at Railway’s Skipped Builds feature so it can reuse the same build instead of rebuilding the same commit multiple times.
And if your app needs different values during build for each environment, then the safest fix is probably to build once in CI and deploy that same image everywhere.
So basically, same commit does not always mean same build. Usually it means something in the build input or cache is different.