Service stuck in initializing / taking snapshot of the code for more than 25 minutes.
teodoryantcheff
PROOP

3 months ago

Today I tried deploying a service ("dramatiq workers") with

railway up . --verbose

which resulted in the following in

Failed to parse JSON file railway.workers.json: invalid character '\x00' looking for beginning of value

in the build logs.

The json file (`railway.workers.json` is definitely ok -- utf-8 encoded, lf line endings and all):

teo@jailbreaker-pc:/mnt/e/src/talkx-backend$ cat railway.workers.*

{

"$schema": "https://railway.app/railway.schema.json",

"build": {

"builder": "DOCKERFILE",

"dockerfilePath": "Dockerfile"

},

"deploy": {

"startCommand": "./start-workers.sh",

"restartPolicyType": "ON_FAILURE",

"restartPolicyMaxRetries": 10

}

}

# railway.workers.toml

[build]

builder = "DOCKERFILE"

dockerfilePath = "Dockerfile"

[deploy]

startCommand = "./start-workers.sh"

restartPolicyType = "ON_FAILURE"

restartPolicyMaxRetries = 10teo@jailbreaker-pc:/mnt/e/src/talkx-backend$

teo@jailbreaker-pc:/mnt/e/src/talkx-backend$ railway service status

Service: dramatiq workers

Deployment: 4d676049-7527-4180-b2c0-ee7cc735ecb7

Status: INITIALIZING

teo@jailbreaker-pc:/mnt/e/src/talkx-backend$

and

teo@jailbreaker-pc:/mnt/e/src/talkx-backend$ cat railway.workers.json | jq .

{

"$schema": "https://railway.app/railway.schema.json",

"build": {

"builder": "DOCKERFILE",

"dockerfilePath": "Dockerfile"

},

"deploy": {

"startCommand": "./start-workers.sh",

"restartPolicyType": "ON_FAILURE",

"restartPolicyMaxRetries": 10

}

}

teo@jailbreaker-pc:/mnt/e/src/talkx-backend$

Then I tried making a .toml version of the same file and changing the Config-as-code Railway Config File to that.

Which also did not work, at all. And after some google searches and many errors like this

teo@jailbreaker-pc:/mnt/e/src/talkx-backend$ railway up . --verbose

Indexed Compressed [====================] 100% >>>>> prefix not found <<<<<<<<

teo@jailbreaker-pc:/mnt/e/src/talkx-backend$ railway whoami

Logged in as t*****.********@gmail.com 👋

teo@jailbreaker-pc:/mnt/e/src/talkx-backend$

later, I tried redeploying the service that was already deployed via the web ui.

And that ended up in the "creating snapshot" state.

Please advise.

Many Thanks in advance,

Teo

Solved

3 Replies

sam-a
EMPLOYEE

3 months ago

Your config files appear to contain null bytes (\x00) when they reach our platform, which is causing both the JSON and TOML parse failures. Since the files are valid locally, this is likely related to running `railway up` from a WSL Windows mount path (`/mnt/e/...`), which can introduce encoding artifacts during file upload. The deployment is stuck in INITIALIZING because the snapshot could never be created, and the subsequent redeploy attempts fail because there is no snapshot to redeploy from. To unblock yourself, try removing the stuck deployment, then re-deploying. You could also try copying your project files to the native WSL filesystem (e.g., `~/src/` instead of `/mnt/e/src/`) and running `railway up` from there, as native WSL paths avoid the Windows filesystem translation layer. We are filing this as a bug to investigate further. Let us know if you are still stuck and we can escalate.


Status changed to Awaiting User Response Railway • 3 months ago


teodoryantcheff
PROOP

3 months ago

Will do and will report back. Thanks!


Status changed to Awaiting Railway Response Railway • 3 months ago


teodoryantcheff
PROOP

3 months ago

Ok, so now running with a "native" wsl disk:

teo@jailbreaker-pc:~/talkx-backend$ railway up . --verbose
  Indexed
  Compressed [====================] 100%
 prefix not found

After link-ing many times, logging out, logging in, etc, etc, found a help thread here saying that "detaching" would help.

teo@jailbreaker-pc:~/talkx-backend$ railway up --detach

and it did ! 🙂

So, ultimately my problem is kinda solved but there are areas of improvement of the cli tool you may want to take a look at.

teo@jailbreaker-pc:/mnt/e/src/talkx-backend$ railway --version
railway 4.30.5
teo@jailbreaker-pc:/mnt/e/src/talkx-backend$

installed using

bash <(curl -fsSL cli.new)

sys info. if useful for debugging:

teo@jailbreaker-pc:/mnt/e/src/talkx-backend$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.4 LTS
Release:        24.04
Codename:       noble
teo@jailbreaker-pc:/mnt/e/src/talkx-backend$ uname -a
Linux jailbreaker-pc 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
teo@jailbreaker-pc:/mnt/e/src/talkx-backend$

The physical drive is an SSD. Been using this setup for at least several years, and while disk performance is wsl's Achille's heel, I've never had issues with data corruption.

In any case -- many thanks for your assistance, Sam !

Teo


Status changed to Solved jake • 3 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...