A shot in the dark:
- See if local builds work:
fly launch --local-only <other-args>
- Or: Destroy the builder, then retry
flyctl apps destroy -y fly-builder-holy-dew-9242
- Or: Destroy wireguard tunnels, then recreate them: Fly-Builder can't connect to Docker - #5 by mhostetler
- Or: Clone the builder to another region, then retry: remote builder machine stuck in created state - #6 by ray-chen
What region are you in? It might be an npm issue, but their status page says everything’s ok.
I noticed you tried
npm config delete proxy so we can rule that out. Perhaps try making the npm connection timeout higher?
# values are in ms npm config set fetch-retry-mintimeout 60000 # 1 min (default=10sec) npm config set fetch-retry-maxtimeout 180000 # 3 min (default=10sec)
You can also try
npm config set loglevel verbose to see if anything’s going wonky.
I have tried to deploy it to another region but getting the same error. I think they must have messed up docker build command.
I am using Singapore region
Have you tried increasing fetch-retry timeouts?
I’ve found it’s just better to build with Docker in your local machine. It’s much faster, you can catch errors early on, can run the image locally to test things out, have more control, etc.
And yeah sometimes the Fly builder is not all that reliable
Yes, I tried with
--local-only and it is working properly. Still waiting for fix from Fly.
Thank you for your suggestions.
And yes, Fly builder is not that reliable.
Have you tried @ray-chen’s suggestion (increasing fetch-retry-mintimeout and fetch-retry-maxtimeout)?
Yes, but didn’t work. For now, building with local docker demon is only option IMO.
Can you share a stripped down Dockerfile that I can try to reproduce the issue with?
sure, but I also tried with default Dockerfile that also didn’t work.
Does it working for you?
# Dockerfile FROM node:18.14-alpine as builder ENV NODE_ENV build USER node WORKDIR /home/node COPY package*.json ./ COPY tsconfig.build.json ./ # RUN npm config set registry http://registry.npmjs.org/ ENV NODE_ENV production RUN npm install COPY --chown=node:node . . RUN npm run build \ && npm prune --production # --- FROM node:18.14-alpine ENV NODE_ENV production USER node WORKDIR /home/node COPY --from=builder --chown=node:node /home/node/package*.json ./ COPY --from=builder --chown=node:node /home/node/node_modules/ ./node_modules/ COPY --from=builder --chown=node:node /home/node/dist/ ./dist/ CMD ["node", "dist/src/main.js"]