Fly is not working for nodejs since yesterday getting bellow error

A shot in the dark:

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.

1 Like

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 :slight_smile:

1 Like

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


USER node
WORKDIR /home/node

COPY package*.json ./
# RUN npm config set registry
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"]