There appears to be trouble with your network connection. Retrying...

I’m trying to deploy my Node.js app but when is installing the packages, I get this error:

=> [builder 3/5] RUN yarn cache clean && yarn install --production=false 197.2s
=> => # at Socket._onTimeout (node:net:609:8)
=> => # at listOnTimeout (node:internal/timers:594:17)
=> => # at process.processTimers (node:internal/timers:529:7)
=> => # info Visit yarn install | Yarn for documentation about this command.
=> => # info There appears to be trouble with your network connection. Retrying…
=> => # info There appears to be trouble with your network connection. Retrying…

This is my fly config:

app = "lucira-ai-development"
primary_region = "sea"

[env]
  NODE_ENV="production"
  SERVER_PORT=8080

[[services]]
  internal_port = 80
  processes = ["app"]
  protocol = "tcp"

  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

[[vm]]
  memory = "4gb"
  cpu_kind = "shared"
  cpus = 4

Does your app build and run locally in Docker?

I’m just running the fly deploy command

Righto, I would get it working in Docker first; if it won’t work in Docker then it definitely won’t work in Fly. This is a good intermediate test.

I just built the Dockerfile and it is working fine, this is what i have:

FROM debian:bullseye AS base

ARG NODE_VERSION=22.13.0
ARG YARN_VERSION=1.22.22

RUN apt-get update; apt install -y curl wget python-is-python3 pkg-config build-essential nginx
RUN curl https://get.volta.sh | bash
ENV VOLTA_HOME=/root/.volta
ENV PATH=/root/.volta/bin:$PATH
RUN volta install node@${NODE_VERSION} yarn@${YARN_VERSION}

FROM base AS builder
WORKDIR /app
ENV NODE_ENV=production
COPY . .
RUN yarn cache clean && yarn install --production=false
RUN yarn run build
RUN yarn run generate

FROM base AS runner
WORKDIR /app

LABEL fly_launch_runtime="nodejs"

RUN apt-get update \
  && apt-get install -y wget gnupg \
  && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/googlechrome-linux-keyring.gpg \
  && sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/googlechrome-linux-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
  && apt-get update \
  && apt-get install -y google-chrome-stable --no-install-recommends \
  && rm -rf /var/lib/apt/lists/*

COPY --from=builder /root/.volta /root/.volta
COPY --from=builder /app /app
COPY --from=builder /app/nginx.development.conf /etc/nginx/nginx.conf

ENV NODE_ENV=production
ENV PATH=/root/.volta/bin:$PATH
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

EXPOSE 80

ENTRYPOINT ["/entrypoint.sh"]

Hi Andrés,

If you’re still seeing issues (problem with network connection, retrying) can you please try a non-Depot builder?

fly deploy --depot=false

Let me know if that helps.

  • Daniel

Same issue here. Using fly deploy --depot=false still returns There appears to be trouble with your network connection. Retrying...

It works after adding --network-timeout=300000 (5 minutes) to my yarn install commands in Docker. I don’t use the --depot=false argument for fly deploy.

The deployment takes 10 minutes to complete, where it used to be 2-4 minutes. This is hopefully just some temporary network issues.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.