esbuild download timing out on deploy

I tried to deploy an update to my blog today and because I’m on an M1 mac I am using the remote deploy option, but it is timing out on the assets.deploy step and it appears to be stuck trying to download the esbuild binary from npm

I tested if this was a problem with npm, but locally I can download the esbuild in a little less than 500ms.

time curl -v https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.12.18.tgz --output Downloads/esbuild.tgz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 104.16.16.35:443...
* Connected to registry.npmjs.org (104.16.16.35) port 443 (#0)
... omitting details ...
{ [1047 bytes data]
100 3071k  100 3071k    0     0  6909k      0 --:--:-- --:--:-- --:--:-- 7029k
* Connection #0 to host registry.npmjs.org left intact
curl -v  --output Downloads/esbuild.tgz  0.04s user 0.04s system 16% cpu 0.466 total

So maybe npm is throttling the build servers from fly? I know a lot of people in the elixir community have been trying out fly recently

I worked around the problem for now by deleting my deployment project in the fly.io UI, and then re-running fly deploy --remote-only which provisioned a new build machine for me and it was able to build sucessfully :man_shrugging:t4:

It will eventually occur again, either timing out or failing on some file/folder (e.g. .elixir_ls). I had the same problem and others too:

cc @jsierles (sorry for mentioning you everywhere, but might be easier to keep track of everyone with this issue)

This has been happenning to me for the last ~20 hours, I can’t deploy a new version of my app because the esbuild step just hangs. Both with a local and a remote deployment:

fly deploy --remote-only
==> Verifying app config
Validating /Users/guille/repos/app_hive/fly.toml
Platform: machines
✓ Configuration is valid
--> Verified app config
==> Building image
Remote builder fly-builder-quiet-pond-9874 ready
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 163.8s (22/28)
 => [internal] load build definition from Dockerfile                                 0.1s
 => => transferring dockerfile: 2.66kB                                               0.1s
 => [internal] load .dockerignore                                                    0.1s
 => => transferring context: 1.35kB                                                  0.1s
 => [internal] load metadata for docker.io/library/debian:bullseye-20230612-slim     0.6s
 => [internal] load metadata for docker.io/hexpm/elixir:1.15.7-erlang-26.1.2-debian  1.3s
 => [builder  1/17] FROM docker.io/hexpm/elixir:1.15.7-erlang-26.1.2-debian-bullsey  2.5s
 => => resolve docker.io/hexpm/elixir:1.15.7-erlang-26.1.2-debian-bullseye-20230612  0.0s
 => => sha256:33b8f512c96b9c988aab2b6e6ec7cdd1b4b6d38ac56defebd3036 1.57kB / 1.57kB  0.0s
 => => sha256:9858a9721052f8b82c1e27de10c4850bc5c42c8f72ec95ce623b3 3.04MB / 3.04MB  0.4s
 => => sha256:489e004f745243a30783e581e9e5e90647b73d1232577056709 45.22MB / 45.22MB  1.5s
 => => sha256:9bd53a4c74dd754ed7265de51d92e1cca44c8a0cd8abb614e9525 5.36MB / 5.36MB  1.3s
 => => sha256:5c78a569520975784f101479e8163b0e4439fe315fff01597efae5c79 772B / 772B  0.0s
 => => sha256:36dfc09680bfb3ceb5f8d170904e9a738b30ddee67678f5528c20 1.16kB / 1.16kB  0.0s
 => => extracting sha256:9858a9721052f8b82c1e27de10c4850bc5c42c8f72ec95ce623b3e4f56  0.1s
 => => extracting sha256:489e004f745243a30783e581e9e5e90647b73d12325770567097beb663  0.8s
 => => extracting sha256:9bd53a4c74dd754ed7265de51d92e1cca44c8a0cd8abb614e95259e7e4  0.1s
 => [internal] load build context                                                    0.3s
 => => transferring context: 142.47kB                                                0.3s
 => [stage-1 1/6] FROM docker.io/library/debian:bullseye-20230612-slim@sha256:924df  0.0s
 => CACHED [stage-1 2/6] RUN apt-get update -y && apt-get install -y libstdc++6 ope  0.0s
 => CACHED [stage-1 3/6] RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && loca  0.0s
 => CACHED [stage-1 4/6] WORKDIR /app                                                0.0s
 => CACHED [stage-1 5/6] RUN chown nobody /app                                       0.0s
 => [builder  2/17] RUN apt-get update -y && apt-get install -y build-essential gi  18.7s
 => [builder  3/17] WORKDIR /app                                                     0.0s
 => [builder  4/17] RUN mix local.hex --force &&     mix local.rebar --force         1.9s
 => [builder  5/17] COPY mix.exs mix.lock ./                                         0.0s
 => [builder  6/17] RUN mix deps.get --only prod                                     2.5s
 => [builder  7/17] RUN mkdir config                                                 0.2s
 => [builder  8/17] COPY config/config.exs config/prod.exs config/                   0.0s
 => [builder  9/17] RUN mix deps.compile                                            86.0s
 => [builder 10/17] COPY priv priv                                                   0.0s
 => [builder 11/17] COPY lib lib                                                     0.0s
 => [builder 12/17] COPY assets assets                                               0.1s
 => [builder 13/17] RUN mix assets.deploy                                           50.3s
 => => # Rebuilding...
 => => # Done in 743ms.
 => => # 12:15:08.834 [debug] Downloading esbuild from https://registry.npmjs.org/@esbuil
 => => # d/linux-x64/-/linux-x64-0.17.11.tgz

This happens to me with both esbuild 0.7.1 and 0.8.1
I’ve tried destroying the builder and redeploying and still doesn’t work. Any clues?

This issue was opened in the past day as well and it might be related.