Railway deploying cached old code despite forced redeployments, disconnect/reconnect, and NIXPACKS_NO_CACHe=1
eaw15678
PROOP

2 months ago

Question: How do I force Railway to completely clear its build cache and deploy the actual current code from GitHub?

I have a Python/FastAPI service (staylio-pipeline) connected to GitHub repo EAW15678/staylio-pipeline (private). The service is consistently deploying old cached code despite the following attempts to force a fresh build:

  • Disconnect/reconnect repo via Settings > Source
  • Added NIXPACKS_NO_CACHE=1 environment variable
  • Made new commits to GitHub to trigger fresh deployments
  • Created a brand new Railway project and connected the same repo

The symptom: Deploy logs show this runtime error when /run is called:

ERROR:main:Pipeline trigger failed: type object 'DeployMode' has no attribute 'BOOKED_SUBDOMAIN'

I have verified that BOOKED_SUBDOMAIN does not exist anywhere in the current GitHub codebase — it was renamed to STAYLIO_SUBDOMAIN in a recent update. The error can only occur if Railway is executing an older version of the code.

The active deployment shows commit hash fa5c7eb1 and the build succeeds, but the running code does not match what is in GitHub at that commit.

Solved$10 Bounty

1 Replies

Status changed to Open Railway about 2 months ago


domehane
FREE

2 months ago

Hello,

your nixpacks_no_cache=1 variable does nothing on railway anymore, railway now uses railpack and the correct variable to disable build cache is NO_CACHE=1. add that to your service environment variables and redeploy. that's the first thing to fix

Hope this help you :)


Status changed to Solved eaw15678 23 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...