Deployment suddenly fails to make repository snapshot
kgbearder
HOBBYOP

10 months ago

I have made numerous successful deployments and now I am getting "Cannot create code snapshot right now" . I am below size limits

Solved

8 Replies

Railway
BOT

10 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!


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

  1. In your project, run railway link and link your project
  2. Run 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 10 months ago


kgbearder
HOBBYOP

10 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 10 months ago


kgbearder
HOBBYOP

10 months ago

(django_storyteller_env) PS C:\Users\kgbea\OneDrive - Hesketh\Django\StoryPWA> railway up

Indexed

Compressed [====================] 100%

Uploaded

Build Logs: https://railway.com/project/ca2c8489-1ba2-4b89-9049-13100077382c/service/6b2fea20-39ea-4ef1-bd07-44d6e3def0b6?id=45a59d65-b0a3-47e7-90aa-7fd297c1f659&

Build failed

(django_storyteller_env) PS C:\Users\kgbea\OneDrive - Hesketh\Django\StoryPWA>


kgbearder
HOBBYOP

10 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:


kgbearder
HOBBYOP

10 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)


kgbearder
HOBBYOP

10 months ago

Fixed courtesy of VS code github Copilot in Agent mode using Claude sonnet 4


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 10 months ago


Railway
BOT

10 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 10 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...