Cannot deploy any changes to db structure because yarn --frozen-lockfile won't work on temporary machine

Everything was previously working for a long time, but now when I try to deploy and it gets to this line in fly.production.tml:
release_command = ‘yarn --cwd ./ops db:fly-migrate’
it gets stuck running yarn --frozen-lockfile

I’ve tried ssh-ing into dev and prod and running yarn --frozen-lockfile directly and it’s fine. It’s when Fly makes a temporary machine to make db changes before deploying that it has an issue, but I’m a bit stuck on where to go from there because I don’t know how to debug that. I haven’t made any significant changes like to environment variables or anything that would this. I even reverted the changes and pushed the last successful commit and got the same error.

Logs:

Running dxv-dev release_command: yarn --cwd ./ops db:fly-migrate

Created release_command machine e822440f709218

Waiting for e822440f709218 to have state: stopped

Starting machine

Machine e822440f709218 has state: stopped

Waiting for e822440f709218 to have state: started

Waiting for e822440f709218 to have state: started

Machine e822440f709218 has state: started

Waiting for e822440f709218 to have state: destroyed

Machine e822440f709218 has state: destroyed

Waiting for e822440f709218 to get exit event

Error release_command failed running on machine e822440f709218 with exit code 1.

:multiply: release_command failed

Checking logs: fetching the last 100 lines below:

:multiply: Failed: machine e822440f709218 exited with non-zero status of 1

Running Firecracker v1.7.0

2025-04-30T09:40:54Z INFO Starting init (commit: d15e62a13)…

2025-04-30T09:40:54Z INFO Preparing to run: docker-entrypoint.sh yarn --cwd ./ops db:fly-migrate as root

2025-04-30T09:40:54Z INFO [fly api proxy] listening at /.fly/api

2025-04-30T09:40:54Z Machine started in 1.191s

2025-04-30T09:40:54Z 2025/04/30 09:40:54 INFO SSH listening listen_address=[address]:22

2025-04-30T09:40:55Z yarn run v1.22.19

2025-04-30T09:40:55Z $ yarn --frozen-lockfile && yarn db:migrate

2025-04-30T09:40:56Z [1/4] Resolving packages…

2025-04-30T09:40:57Z [2/4] Fetching packages…

2025-04-30T09:42:17Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T09:42:51Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T09:43:25Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T09:43:59Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T09:44:40Z error An unexpected error occurred: “https://registry.npmjs.org/next/-/next-14.1.0.tgz: ESOCKETTIMEDOUT”.

2025-04-30T09:44:40Z info If you think this is a bug, please open a bug report with the information provided in “/app/ops/yarn-error.log”.

2025-04-30T09:44:40Z info Visit yarn install | Yarn for documentation about this command.

2025-04-30T09:56:12Z error Command failed with exit code 1.

2025-04-30T09:56:12Z info Visit yarn run | Yarn for documentation about this command.

2025-04-30T09:56:13Z INFO Main child exited normally with code: 1

Error: release command failed - aborting deployment. machine e822440f709218 exited with non-zero status of 1

Error: Process completed with exit code 1.

That file does not appear to exist.

Ah thanks so much! That’s weird, maybe that version got deleted. I’ve updated all the packages so I shouldn’t be getting that issues anymore - but I am? This file https://registry.npmjs.org/next/-/next-14.2.28.tgz does download a file so I think it exists? I changed the registry to npm instead of yarn to see if it’s help but it didn’t. Been looking at it for a few hours again and I’m still stuck!

Checking logs: fetching the last 100 lines below:

2025-04-30T14:46:03Z 2025-04-30T14:46:03.560558234 [01JT3JJ2FQGTK68QNG39RDX6SM:main] Running Firecracker v1.7.0

2025-04-30T14:46:04Z INFO Starting init (commit: d15e62a13)…

2025-04-30T14:46:04Z INFO Preparing to run: docker-entrypoint.sh yarn --cwd ./ops db:fly-migrate as root

2025-04-30T14:46:04Z INFO [fly api proxy] listening at /.fly/api

2025-04-30T14:46:04Z Machine started in 1.229s

2025-04-30T14:46:04Z 2025/04/30 14:46:04 INFO SSH listening listen_address=[address]:22

2025-04-30T14:46:05Z yarn run v1.22.19

2025-04-30T14:46:05Z $ yarn --frozen-lockfile && yarn db:migrate

2025-04-30T14:46:06Z [1/4] Resolving packages…

2025-04-30T14:46:07Z [2/4] Fetching packages…

2025-04-30T14:47:21Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T14:47:55Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T14:48:29Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T14:49:05Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T14:49:47Z error An unexpected error occurred: “https://registry.npmjs.org/next/-/next-14.2.28.tgz: ESOCKETTIMEDOUT”.

2025-04-30T14:49:47Z info If you think this is a bug, please open a bug report with the information provided in “/app/ops/yarn-error.log”.

2025-04-30T14:49:47Z info Visit yarn install | Yarn for documentation about this command.

2025-04-30T14:53:59Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T14:54:33Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T14:57:04Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T14:57:38Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T14:59:37Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T15:00:44Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T15:01:17Z info There appears to be trouble with your network connection. Retrying…

2025-04-30T15:04:54Z error Command failed with exit code 1.

2025-04-30T15:04:54Z info Visit yarn run | Yarn for documentation about this command.

2025-04-30T15:04:55Z INFO Main child exited normally with code: 1

:multiply: Failed: machine 080266df611d98 exited with non-zero status of 1

Error: release command failed - aborting deployment. machine 080266df611d98 exited with non-zero status of 1

Error: Process completed with exit code 1.

I am not 100% sure what happened here, but is there a reason yarn --frozen-lockfile is run as part of the machine start / release process? It seems like this (installing dependencies) should really be done at the build step inside your Dockerfile, and only yarn db:migrate is required when the machine starts with a new image. yarn --frozen-lockfile depends heavily on npmjs.org, and if anything happens with it, your machine will fail to start.

1 Like