Unable to download Node distribution

Posted this same question to paid support since I’m on a plan, but it’s been 12 hours and no response yet, so posting it here to in the hopes that someone knows anything about it.

Remote builder fly-builder-xxx-yyy ready
==> Building image with Buildpacks
--> docker host: 20.10.12 linux x86_64
20: Pulling from heroku/buildpacks
Digest: sha256:zzz
Status: Image is up to date for heroku/buildpacks:20
20-cnb: Pulling from heroku/heroku
Digest: sha256:zzz
Status: Image is up to date for heroku/heroku:20-cnb
Warning: Platform requested deprecated API '0.6'
===> DETECTING
Warning: Buildpack 'heroku/ruby@0.0.0' requests deprecated API '0.4'
Warning: Buildpack 'heroku/python@0.0.0' requests deprecated API '0.4'
Warning: Buildpack 'heroku/scala@0.0.0' requests deprecated API '0.4'
Warning: Buildpack 'heroku/php@0.0.0' requests deprecated API '0.4'
Warning: Buildpack 'heroku/go@0.0.0' requests deprecated API '0.4'
Warning: Buildpack 'heroku/nodejs-function@0.9.18' requests deprecated API '0.2'
Warning: Buildpack 'heroku/nodejs@0.5.14' requests deprecated API '0.2'
Warning: Buildpack 'heroku/gradle@0.0.0' requests deprecated API '0.4'
2 of 4 buildpacks participating
heroku/nodejs-engine 0.8.15
heroku/nodejs-yarn   0.3.2
===> ANALYZING
Previous image with name "registry.fly.io/xxx-yyy:cache" not found
===> RESTORING
===> BUILDING

[Heroku Node.js Engine Buildpack]

[Checking Node.js version]
Detected Node.js version range: 16.19.0
Resolved Node.js version: 16.19.0

[Installing Node.js distribution]
Downloading Node.js 16.19.0

It gets stuck here for a few hours and then finally responds with

[Error: Node.js engine distribution error]
Couldn't download Node.js distribution: IO error while downloading file: Connection reset by peer (os error 104)
ERROR: failed to build: exit status 1
Error failed to fetch an image or build from source: executing lifecycle: failed with status code: 51

Trying this same step locally with --local-only works, meaning that I can download Node 16.19.0 just fine. (I ended up just building it with buildx locally and deploying it like that, but I’d love to go back to having the build be done remotely if at all possible.) I’ve also tried it with various other Node versions, no luck.

Any ideas? I haven’t changed any of the build/deployment code in a while and started failing about 1-2 days ago.

Facing the same issue. Unfortunately, I face one or the other issue with Flyio very frequently :frowning:

Hi,

Strange :thinking:

I don’t know why the builder app is unable to fetch that. A possible solution (bypass) could be building the app in a different way. I don’t know if you have a Dockerfile (and sibling .dockerignore) for your app but I’ve always found that approach more reliable than the buildpacks. It gives you complete control over the base image.

This was an example repo using one. I wouldn’t copy this exactly (e.g it uses V1, and Fly are now on V2 aka Machines, plus its Dockerfile needs updating to be npm install --omit=dev). But it shows the basic idea (of using a Dockerfile to control the build):

We also have a tool that will generate a Dockerfile for you: GitHub - fly-apps/dockerfile-node: Dockerfile generator for Node.js

See also: Dockerfiles · Fly Docs