Deploy hangs loading context

I’m trying to deploy an app, and it hangs with the timer ticking up at:

 => [internal] load remote build context

If I wait for it to finish, after about 15 minutes it terminates with the error message

 => ERROR [internal] load remote build context                                                                   936.5s
------
 > [internal] load remote build context:
------
Error failed to fetch an image or build from source: error building: error during connect: Post "<big long url>": write unix @->/home/foo/.fly/fly-agent.sock: write: broken pipe

I have deployed this app to fly before.
I have tried deploying it as a new app (different name).
flyctl doctor -a <app name> says everything passes.
I have confirmed I am logged in on the command line.
I tried deleting the builder, a new one is created and I encounter the same issue.
I’ve tried deploying a few times, same result.

I don’t see any obvious error issues in my web dashboard, or status page of fly or aws.

It is a datasette app, and for what it’s worth the author of the library confirms he can deploy correctly.

So that seems to narrow it down to my environment, or my account maybe? The error message doesn’t give me a lot to go on. Any help would be appreciated.

2 Likes

Please check out your .dockerignore. You may have something like node_modules not ignored, and sent a tons of unnecessary files into fly.

My entire app directory is 3 files totaling 8 MB.
I have no dockerignore, no node_modules. The build context is ~half a megabyte.

I haven’t gotten to the bottom of what’s going on, but I have found a workaround.

If you get ERROR [internal] load remote build context when trying to deploy via WSL, try from a different platform.

I was trying to deploy in a WSL instance. I saw the same timeout failure-to-deploy using:

  • Windows 10, WSL2, Ubuntu 20.04 guest
  • Windows 11, WSL2, Ubuntu 22.04 guest

Changing nothing in my app, I was able to successfully deploy using:

  • real Ubuntu 22.10
  • Windows 10 powershell

(With powershell, I did get a series of PermissionErrors when flyctl tried to clean up the temp files, but this was after the deploy had successfully completed)

I had deployed successfully using the WSL instance in the past, so this seems like a regression of some kind. It was working as of September, going by my commit timestamps.

May be a workaround for @abuznego as well.

It could be that your remote builder

which worked in my case.

1 Like

This worked for me as well. I think I may have initially deployed from my mac and then switched to Windows 10 with Ubuntu running in WSL. Deploys would fail from Ubuntu WSL, but worked from Fedora. I deleted the builder from dashboard and now my deploys are working. Thanks!