4 months ago
I have made numerous successful deployments and now I am getting "Cannot create code snapshot right now" . I am below size limits
8 Replies
4 months ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
4 months ago
Hey!
Could you try using the Railway CLI to trigger a deployment?
You will need to:
1. Install the CLI: https://docs.railway.com/guides/cli#installing-the-cli
2. Run railway login
In your project, run
railway linkand link your projectRun
railway up --verbose
Once you do that, could you please share the CLI output? It's likely that you've made a recent change which includes one or many large files. You can ignore these files by creating a .railwayignore file
Status changed to Awaiting User Response Railway • 4 months ago
4 months ago
(django_storyteller_env) PS C:\Users\kgbea\OneDrive - Hesketh\Django\StoryPWA> railway link
> Select a team kgbearder's Projects
> Select a project faithful-cat
> Select an environment production
> Select a service storyteller
(django_storyteller_env) PS C:\Users\kgbea\OneDrive - Hesketh\Django\StoryPWA> railway up --verbose
error: unexpected argument '--verbose' found
tip: a similar argument exists: '--version'
Usage: railway.exe up --version [PATH]
For more information, try '--help'.
(django_storyteller_env) PS C:\Users\kgbea\OneDrive - Hesketh\Django\StoryPWA>
Status changed to Awaiting Railway Response Railway • 4 months ago
4 months ago
(django_storyteller_env) PS C:\Users\kgbea\OneDrive - Hesketh\Django\StoryPWA> railway up
Indexed
Compressed [====================] 100%
Uploaded
Build failed
(django_storyteller_env) PS C:\Users\kgbea\OneDrive - Hesketh\Django\StoryPWA>
4 months ago
Earlier investigation -ignore file has been created : Excellent detective work!
That Railway support thread reveals the exact issue - your repository is likely too large for Railway to snapshot.
The Real Problem:
Size Limit: Railway has a ~15MB upload limit
Your Project: Probably exceeds this due to the docs folder with all those Word files
Solution: Exclude unnecessary files from Railway deployment
Let's check your current repository size and create a .railwayignore file:
Get-ChildItem -Recurse | Measure-Object -Property Length -Sum |
Select-Object @{Name="Size(MB)";Expression={[math]::Round($_.Sum/
1MB,2)}}
Interesting! Your project is only 6.45MB, which is well under the 15MB limit. But let's check what's taking up the most space:
Get-ChildItem -Directory | ForEach-Object { $size = (Get-ChildItem
$_.FullName -Recurse | Measure-Object -Property Length -Sum).Sum;
[PSCustomObject]@{Folder=$_.Name; "Size(MB)"=[math]::Round($size/
1MB,2)} } | Sort-Object "Size(MB)" -Descending
Perfect! Now I can see the breakdown:
staticfiles: 3.31MB (generated files, not needed in source)
docs: 2.85MB (documentation with Word files)
storyteller: 0.06MB (your Django app)
Let's create a .railwayignore file to exclude unnecessary files and reduce the upload size:
4 months ago
EXCELLENT! The deployment is now working!
What Fixed It
Removing the conflicting Railway configuration files (railway.toml, railway.json, nixpacks.toml) allowed Nixpacks to use its auto-detection properly, just like in the previous successful build.
Current Status
Build: Successfully completed (173.53 seconds)
Container: Starting successfully
Gunicorn: Running on port 8080
Django: Loading (though with a minor staticfiles warning)
4 months ago
Fixed courtesy of VS code github Copilot in Agent mode using Claude sonnet 4
4 months ago
Glad to see that you managed to solve the issue 
I'm marking this thread as solved. Feel free to re-open if you have any more questions.
Status changed to Awaiting User Response Railway • 4 months ago
3 months 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 • 3 months ago