Error: failed to fetch an image or build from source: error building: failed to receive status: rpc

Hi there,

I am attempting to deploy a Flask-based machine learning application, and I have followed the instructions in the documentation to execute ‘fly deploy’. However, after multiple attempts, the deployment fails consistently when transferring context, reaching 600~700MB. Below is the error message provided:

Error: failed to fetch an image or build from source: error building: failed to receive status: rpc error: code = Unavailable desc = error reading from server: read unix @->C:\Users\\fly-agent.sock: wsarecv: An existing connection was forcibly closed by the remote host.ocker/dockerfile:1

Here is my Dockfile and the result of running ‘fly doctor’.


syntax = docker/dockerfile:1


FROM python:${PYTHON_VERSION}-slim

LABEL fly_launch_runtime=“flask”


COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt

COPY . .


CMD [ “python3”, “-m” , “flask”, “run”, “–host=”, “–port=8080”]

fly doctor:

Testing authentication token… PASSED
Testing flyctl agent… PASSED
Testing local Docker instance… Nope
Pinging WireGuard gateway (give us a sec)… PASSED
Testing WireGuard DNS… PASSED
Testing WireGuard Flaps… PASSED

App specific checks for js-test-cold-shadow-4331:
Checking that app has ip addresses allocated… Nope
No ip addresses assigned to this app. If the app is not intended to receive traffic, this is fine.
Otherwise, it likely means that the services configuration is not correctly setup to receive http, tls, tcp, or udp traffic.
Fly Launch configuration (fly.toml) · Fly Docs
No public ipv4 or ipv6 ip addresses allocated to app js-test-cold-shadow-4331

Build checks for js-test-cold-shadow-4331:
Checking docker context size (this may take little bit)… PASSED (1.6 GB)
Checking for .dockerignore… Nope
Found no .dockerignore to limit docker context size. Large docker contexts can slow down builds.
Create a .dockerignore file to indicate which files and directories may be ignored when building the docker image for this app.
More info at: Dockerfile reference | Docker Docs

Has anyone encountered a similar issue and found a solution? I believe it might be a network-related problem, but I haven’t been able to find a corresponding solution. Thank you.

same issue

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