Skip to content
Deploy failed: Failed to snapshot repository. Please try again in a few minutes.
pnwguy
OP

3 hours ago

Deployment is failing repeatedly from Azure DevOps via cli to a non-production evironment. I've tried re-deploying five times, still no luck.

Command using for deployment from Azure DevOps:

npx -y @railway/[email protected] up --ci --service "$(railwayService)" --environment "QA" --message "ADO $(Build.BuildNumber) $(Build.SourceVersion)"

Error:

Deployment failed during initialization process.

Initialization > Snapshot code. Failed to snapshot repository.

Please try again in a few minutes.

Diagnosis:

Try redeploying in a few minutes. This deployment failed while Railway was fetching the source code, before any build or deploy step ran, and no logs explain why.

Solved

10 Replies

Railway
BOT

2 hours ago

All four of today's railway up attempts to QA, between 17:18 UTC and 20:10 UTC, failed at the code snapshot step about 8 seconds in. Because no build ever started, there are no build logs. Each railway up is already a fresh deployment, so running it again unchanged, as you've done several times, isn't going to give a different result.

Since every fresh upload fails at the moment your code is captured, what's in the uploaded directory is the next thing to check. Unusually long file or folder names are one known way an upload can fail, and git ls-files | tr '/' '\n' | awk 'length($0)>255' will list any.


Status changed to Awaiting User Response Railway • about 3 hours ago


Railway

All four of today's `railway up` attempts to QA, between 17:18 UTC and 20:10 UTC, failed at the code snapshot step about 8 seconds in. Because no build ever started, there are no build logs. Each `railway up` is already a fresh deployment, so running it again unchanged, as you've done several times, isn't going to give a different result. Since every fresh upload fails at the moment your code is captured, what's in the uploaded directory is the next thing to check. Unusually long file or folder names are one known way an upload can fail, and `git ls-files | tr '/' '\n' | awk 'length($0)>255'` will list any.

pnwguy
OP

2 hours ago

git ls-files | tr '/' '\n' | awk 'length($0)>255' returns no results. Further, we have a different environment "dev" that deployed successfully.


Status changed to Awaiting Railway Response Railway • about 2 hours ago


Railway
BOT

2 hours ago

Thanks for running that. With no over-length paths in the repository, that cause is ruled out.

The QA attempts at 17:18, 18:41, 18:56 and 20:10 UTC all stopped at the snapshot step, before any build started, so their build logs are empty. A successful dev deploy means the CLI and your account can upload, but it doesn't explain why QA fails.

To narrow this down, please share the full CLI output from one failing QA pipeline run, with secrets redacted. Please also tell us whether the QA job uploads the same directory and checkout as the dev job, and roughly how large that directory is.


Status changed to Awaiting User Response Railway • about 2 hours ago


Railway

Thanks for running that. With no over-length paths in the repository, that cause is ruled out. The QA attempts at 17:18, 18:41, 18:56 and 20:10 UTC all stopped at the snapshot step, before any build started, so their build logs are empty. A successful dev deploy means the CLI and your account can upload, but it doesn't explain why QA fails. To narrow this down, please share the full CLI output from one failing QA pipeline run, with secrets redacted. Please also tell us whether the QA job uploads the same directory and checkout as the dev job, and roughly how large that directory is.

pnwguy
OP

2 hours ago

the source folder size is about 20 MB.

Command line output:

2026-11-17T20:10:49.8712109Z npx -y @railway/[email protected] up --ci --service "c4bfb034-65b9-4496-bddb-4d267bdc0246" --environment "QA" --message "ADO 20261117.1-[QA] "

2026-11-17T20:10:49.8712505Z ========================== Starting Command Output ===========================

2026-11-17T20:10:49.8757441Z [command]/usr/bin/bash --noprofile --norc /home/runner/work/_temp/da0bd17b-001b-4a2d-9182-c10b02f8a185.sh

2026-11-17T20:10:55.0921638Z npm warn deprecated [email protected]: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]

2026-11-17T20:10:55.0931425Z npm warn deprecated [email protected]: Use your platform's native DOMException instead

2026-11-17T20:10:56.3196066Z Indexing...

2026-11-17T20:10:57.1947757Z Uploading...

2026-11-17T20:10:59.6796391Z Deployment: https://railway.com/project/a38254be-5205-4909-b731-514e1ddabb2f/service/c4bfb034-65b9-4496-bddb-4d267bdc0246?id=d866573e-6584-4d60-8a67-7e8d24339408

2026-11-17T20:10:59.6797377Z CI mode enabled

2026-11-17T20:11:06.3373412Z Deploy failed: Failed to snapshot repository. Please try again in a few minutes.

2026-11-17T20:11:06.4467299Z

2026-11-17T20:11:06.4510941Z ##[error]Bash exited with code '1'.


Status changed to Awaiting Railway Response Railway • about 2 hours ago


Railway
BOT

2 hours ago

Thanks for the output. It shows the upload completed and the deployment was created, then it failed at the code snapshot step about 8 seconds later with the same error. No build started, so there are no build logs for it. A 20 MB upload is ordinary, and since dev deploys successfully with the same CLI, nothing you've sent points to a problem with your pipeline command.

To compare the two environments, please tell us whether the QA job runs railway up from the same checkout and working directory as the dev job, and whether QA's service settings differ from dev's, especially the root directory. Please also tell us whether running railway up --service against the same service with --environment "QA" from a local machine fails the same way.


Status changed to Awaiting User Response Railway • about 2 hours ago


pnwguy
OP

2 hours ago

Yes, root directory for both environments are the same. Running railway up --service --environment "QA" from my local machine resulted in same exact error.


Status changed to Awaiting Railway Response Railway • about 2 hours ago


Railway
BOT

2 hours ago

Since the same failure happens from your local machine, your Azure DevOps pipeline isn't the cause. The latest QA attempt again stopped at the code snapshot step after about 8 seconds, before any build started.

We compared the QA and dev settings for this service. Both build from the root directory with the same builder. One difference stands out: QA is set to read a config file at /railway.json, and dev has no config file path set. Please confirm whether a railway.json file is at the root of the directory you're uploading. If it isn't there, or you don't need it for QA, clear the config file path in QA's service settings and run railway up to QA again.


Status changed to Awaiting User Response Railway • about 2 hours ago


pnwguy
OP

2 hours ago

is there a config or flag or setting that says to read /railway.json, or does it only happen if the file exists?


Status changed to Awaiting Railway Response Railway • about 2 hours ago


Railway
BOT

2 hours ago

Both, and they are two separate mechanisms. There is a per-environment service setting, Railway Config File, that tells us which config file path to read. In QA it is currently set to /railway.json, and in dev it is empty. That path is a stored setting, so it applies whether or not the file exists in what you upload.

When the setting is empty, as in dev, we still look for a railway.json or railway.toml at the root of the uploaded source by default and use it only if one is present.

To make QA match dev, clear the Railway Config File field in the QA environment's service settings. You can also leave it set if you add a railway.json at the root of the directory you upload. Config as Code is deprecated, and existing files keep working until 2026-12-01 (docs).


Status changed to Awaiting User Response Railway • about 2 hours ago


pnwguy
OP

an hour ago

Well butter my biscuit - that was the issue. Clearing out the /railway.json value resolved it, probably because the file didn't exist. You deserve a raise. Please file a suggestion to raise a better error message.


Status changed to Awaiting Railway Response Railway • about 1 hour ago


Status changed to Solved Railway • about 1 hour ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...