a month ago
Hi Railway Support,
I'm experiencing a serious bug with the GitHub integration on Railway. After multiple deployments, Railway shows "Deployment successful" in the dashboard, but the running application is actually running an old cached version of my code.
Environment:
- Railway Project: divine-luck (Project ID: 54ce08f7-ee4c-4238-9b4a-b1ab291e8182)
- GitHub Repository: github.com/harrylian8766/harryclaw-backend
- Branch: main
- Service: harryclaw-backend
Problem Description:
When I push new commits to the linked GitHub repository, Railway correctly receives the webhook and creates deployment records. The Railway dashboard shows:
- "Deployment successful"
- The correct new commit SHA
- "via GitHub" as the source
However, the running application does NOT reflect the new code. I have verified this by:
1. Adding a /debug endpoint to the code — it returns 404 (not found), proving the old code is running
2. Changing error messages in the backend — the old error message still appears
3. The health endpoint returns "service": "harryclaw-backend-v2"
even after multiple deployments with newer commits
4. The deployment timestamp on Railway matches the GitHub push time, but Railway is clearly serving a stale container
Evidence:
GitHub Deployments API shows the correct new commit deployed:
- Commit SHA: 7e9e03d21acc (latest)
- Deployment ID: 4292374443
- Status: "success"
- Environment: divine-luck / production
- Created: 2026-04-07T11:06:19Z
But the live API at https://harryclaw-backend-production.up.railway.app still responds with old code that does not include changes from commits after SHA 5e26c671.
What I Have Tried:
1. Multiple GitHub pushes — all create Railway deployment records showing "success"
2. Disconnecting and reconnecting the GitHub repository in Railway Dashboard
3. Deleting and recreating the service (harryclaw-backend) in Railway
4. Waiting 11+ hours — issue persists
5. Redeploying via Railway Dashboard "Redeploy" button
6. Adding railway.json configuration changes (disabledCache, dockerfilePath changes) to force cache invalidation
7. Modifying source code to force Nixpacks rebuild
None of these actions resulted in Railway actually running the new code.
Expected Behavior:
When a new commit is pushed to the linked GitHub repository and Railway creates a deployment record showing "Deployment successful," the running service should reflect the code from that new commit.
Actual Behavior:
Railway creates deployment records showing success, but the running service continues to serve code from an older commit (SHA 5e26c671 or earlier). The discrepancy between the deployment record and the actual running code suggests Railway is either:
1. Caching build artifacts at an infrastructure level and reusing them across deployments, OR
2. Not actually pulling the latest code from GitHub despite creating deployment records
Recent Commits on GitHub (in order):
- 7e9e03d — chore: update DATABASE_URL connection (2026-04-07, latest)
- 053194a — fix: apply owner_id auto-generation fix (2026-04-07)
- 279fc93 — chore: clean railway.json for fresh Nixpacks build (2026-04-07)
- 51a2d80 — fix: complete backend/plan.toml for Nixpacks (2026-04-07)
- 5e26c671 — fix: auto-generate owner_id placeholder in Phase 0 (older, this is what Railway is actually running)
Can you investigate why Railway is creating successful deployment records but not actually deploying the new code from GitHub?
Thank you for your help.
Best regards,
Harry
3 Replies
Status changed to Awaiting Railway Response Railway • about 1 month ago
a month ago
Hey Harry, thanks for the detailed report. This points to a build cache issue where the builder is reusing a cached image layer instead of pulling fresh code. Can you try adding a CACHE_BUST environment variable with any random value to force a full rebuild? If that doesn't work, we'll investigate the build pipeline for your service directly.
Status changed to Awaiting User Response Railway • about 1 month ago
angelo-railway
Hey Harry, thanks for the detailed report. This points to a build cache issue where the builder is reusing a cached image layer instead of pulling fresh code. Can you try adding a `CACHE_BUST` environment variable with any random value to force a full rebuild? If that doesn't work, we'll investigate the build pipeline for your service directly.
a month ago
GitHub Webhook Configuration Issue Symptoms:
• Pushing code to GitHub does not trigger Railway auto-deployment.
• Railway creates a deployment record but does not actually run the new code. Root Cause:
• GitHub webhook is configured, but the Railway webhook endpoint returns a 404 error.
• Configured URL: https://build.railway.app/54ce08f7-ee4c-4238-9b4a-b1ab291e8182
• Actual response: HTTP/2 404 Not Found Solution:
• Railway webhook endpoint updated.
• GitHub webhook configured correctly.
• Pushing code now triggers Railway auto-deployment normally. Verification:
• Webhook configuration check: Successful.
• Webhook events: push, deployment.
• Webhook status: active Issue 3: Build System Configuration Issue Symptoms:
• Railway indicates Nixpacks is deprecated.
• But Railway continues to use Nixpacks instead of Dockerfile.
• This may cause deployment caching issues. Root Cause:
• The issues are: • No railway.toml file explicitly specifies the build method.
• The Dockerfile is located in backend/src/ instead of backend/.
Solutions:
• Add a backend/railway.toml configuration file.
• Explicitly specify the use of Nixpacks builder.
Status changed to Awaiting Railway Response Railway • about 1 month ago
a month ago
Thanks for the thorough investigation. It sounds like the webhook returning 404 at the build endpoint was the core issue, preventing actual builds from running despite GitHub recording successful deployments. Glad to hear pushes are now triggering deployments correctly. For the Dockerfile path, you can set RAILWAY_DOCKERFILE_PATH in your service variables or specify it in a railway.toml file at the root of your repo. Are your deployments now serving the latest code as expected?
Status changed to Awaiting User Response Railway • about 1 month ago
a month ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • about 1 month ago