Railway Docker cache troubleshooting for Dr. Sophia AI deployments. Covers cache detection, force rebuild methods, version verification, deployment validation. Use when Railway shows old code after deployment, deployments not updating, Docker cache issues, or version mismatches between local and deployed code.
67
80%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./skill-builder-package/examples/railway-troubleshooting/SKILL.mdGuide for detecting and fixing Railway's aggressive Docker caching that can cause old code to deploy even after pushing new changes. This skill provides quick fixes to force rebuilds and verify deployments.
Keywords: Railway, Docker cache, deployment issues, force rebuild, version mismatch, cache busting, Dockerfile, Railway dashboard
Check if Railway is serving old code:
# 1. Check local version
grep "BACKEND_VERSION" backend/backend-proxy-enhanced-current.js
# 2. Check deployed version
curl https://backend-dev-d231.up.railway.app/health | jq .version
# If versions don't match = CACHE PROBLEM!/health endpoint returns old version numberFastest - Takes 30 seconds:
# Edit Dockerfile.unified
# Update the timestamp comment at the top:
# Dr. Jarvis Unified Backend Docker Image
# Force rebuild: Oct 24, 2025 1:30 PM - Fix xyz feature # <-- Update this line
git add Dockerfile.unified
git commit -m "build: Force Railway rebuild - bypass cache"
git push origin devOr use the automated script:
.claude/skills/railway-troubleshooting/scripts/force-rebuild.shMore thorough - Updates version everywhere:
# 1. Update version in backend file (line ~1066)
BACKEND_VERSION = '13.2.8'; # Increment version
# 2. Update console banner
console.log('🔥 DR. JARVIS UNIFIED BACKEND v13.2.8 🔥');
# 3. Update /health endpoint
app.get('/health', (req, res) => {
res.json({
version: '13.2.8', # Update this
...
});
});
# 4. Update Dockerfile comment (as in Method 1)
# 5. Commit all changes
git add -A
git commit -m "build: Force Railway rebuild - v13.2.8"
git push origin devLast resort - Slowest:
After pushing, ALWAYS verify the deployment:
# 1. Wait for Railway to build/deploy (2-3 minutes)
sleep 180
# 2. Check deployed version
curl -s https://backend-dev-d231.up.railway.app/health | python3 -c "
import json, sys
data = json.load(sys.stdin)
print(f'Deployed Version: {data.get(\"version\")}')
print(f'Status: {data.get(\"status\")}')
"
# 3. If wrong version, force rebuild using Method 1Use this to instantly force a rebuild:
echo "# Force rebuild: $(date '+%Y-%m-%d %H:%M')" >> Dockerfile.unified && \
git add Dockerfile.unified && \
git commit -m "build: Force Railway rebuild - bypass cache" && \
git push origin devRun the force rebuild script:
.claude/skills/railway-troubleshooting/scripts/force-rebuild.shThis automatically:
Problem: Prescription PDF button wasn't appearing Root Cause: Railway cached old v11.4, wouldn't deploy new v11.6.1 Solution: Updated Dockerfile comment + version numbers everywhere Result: Forced complete rebuild, new code deployed successfully Time Wasted: 2+ hours debugging a non-existent code issue
Look for these in Railway build logs:
Step 1/10 : FROM node:20-alpine
Step 2/10 : WORKDIR /app
Step 3/10 : COPY package*.json ./Step 3/10 : COPY package*.json ./
---> Using cache # Too much of this = problem
Step 4/10 : RUN npm install
---> Using cacheIf > 70% of steps show "Using cache", force rebuild!
Prevention: Update Dockerfile comment with every push Detection: Check /health endpoint version Quick Fix: Automated force-rebuild script Last Updated: September 24, 2025
93ed392
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.