# Deploys failing

**URL:** <https://community.fly.io/t/deploys-failing/908>\
**Category:** General\
**Created:** [March 10, 2021, 5:27pm UTC](https://community.fly.io/t/deploys-failing/908 "2021-03-10T17:27:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/greg/32/2119_2.png) [@greg](https://community.fly.io/u/greg)\
**Post date:** [March 10, 2021, 5:27pm UTC](https://community.fly.io/t/deploys-failing/908/1 "2021-03-10T17:27:48Z")

</div>

Hey,

Are there any issues with the remote builder at the moment? Trying a deploy and getting an error:

```
INFO Remote only, hooking you up with a remote Docker builder...                                                                                                 
INFO Waiting for remote builder (fly-builder-lively-frog-1262) to become available...                                                                            
INFO Remote builder is ready to build!                                                                                                                           
Error failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: Error creating ssh client: ssh: handshake failed: EOF
```

---

<div class="post-metadata">

**Author:** ![michael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/michael/32/16_2.png) [@michael](https://community.fly.io/u/michael)\
**Post date:** [March 10, 2021, 5:31pm UTC](https://community.fly.io/t/deploys-failing/908/2 "2021-03-10T17:31:26Z")

</div>

Are you using the latest version of flyctl?

---

<div class="post-metadata">

**Author:** ![greg](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/greg/32/2119_2.png) [@greg](https://community.fly.io/u/greg)\
**Post date:** [March 10, 2021, 5:39pm UTC](https://community.fly.io/t/deploys-failing/908/3 "2021-03-10T17:39:21Z")

</div>

Yep, assuming this is it? I added a check in the CI script to show the version after the last issue deploying where I wasn’t sure:

```
Check it is the latest version                                                                                                                                                                                                                                                                 
Executing command: /root/.fly/bin/flyctl version                                                                                                                 
flyctl v0.0.186 linux/amd64 Commit: 5cd602b BuildDate: 2021-03-08T20:28:34Z
```

---

<div class="post-metadata">

**Author:** ![michael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/michael/32/16_2.png) [@michael](https://community.fly.io/u/michael)\
**Post date:** [March 10, 2021, 6:22pm UTC](https://community.fly.io/t/deploys-failing/908/4 "2021-03-10T18:22:32Z")

</div>

Yeah that’s the latest, but I can’t reproduce. Does it continue to error if you try again?

---

<div class="post-metadata">

**Author:** ![greg](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/greg/32/2119_2.png) [@greg](https://community.fly.io/u/greg)\
**Post date:** [March 10, 2021, 6:28pm UTC](https://community.fly.io/t/deploys-failing/908/5 "2021-03-10T18:28:26Z")

</div>

I’ll try it again.

I wondered if something had changed, but sounds like not. Maybe it’s a random error with the builder if you aren’t getting it too.

---

<div class="post-metadata">

**Author:** ![greg](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/greg/32/2119_2.png) [@greg](https://community.fly.io/u/greg)\
**Post date:** [March 10, 2021, 6:33pm UTC](https://community.fly.io/t/deploys-failing/908/6 "2021-03-10T18:33:20Z")

</div>

Hmm failed again. For a different reason this time though:

INFO Remote only, hooking you up with a remote Docker builder…  
INFO Waiting for remote builder (fly-builder-lively-frog-1262) to become available…  
INFO Remote builder is ready to build!  
Error error during connect: Post “http://%2Fvar%2Frun%2Fdocker.sock/v1.40/build?buildargs=null&buildid=upload-request%3A681da772fb5fa53223675a1e03833b9724302649d  
d36c5c9eee6e751ff2d6b03&cachefrom=null&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=&labels=null&memory=0&memswap=0&networ  
kmode=&rm=0&shmsize=0&target=&ulimits=null&version=2”: Error creating ssh client: ssh: handshake failed: EOF

---

<div class="post-metadata">

**Author:** ![michael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/michael/32/16_2.png) [@michael](https://community.fly.io/u/michael)\
**Post date:** [March 10, 2021, 6:33pm UTC](https://community.fly.io/t/deploys-failing/908/7 "2021-03-10T18:33:30Z")

</div>

We changed how flyctl connects to remote builders this past week to get buildpacks working, among other fixes. It’s using ssh now through a proxy in the builder instead of an http proxy. It seems to be working nicely except for intermittent issues like this a few people have reported. I’d like to get those fixed asap though.

---

<div class="post-metadata">

**Author:** ![michael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/michael/32/16_2.png) [@michael](https://community.fly.io/u/michael)\
**Post date:** [March 10, 2021, 6:34pm UTC](https://community.fly.io/t/deploys-failing/908/8 "2021-03-10T18:34:24Z")

</div>

Do you have any `DOCKER_*` variables in your env?

---

<div class="post-metadata">

**Author:** ![greg](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/greg/32/2119_2.png) [@greg](https://community.fly.io/u/greg)\
**Post date:** [March 10, 2021, 6:36pm UTC](https://community.fly.io/t/deploys-failing/908/9 "2021-03-10T18:36:27Z")

</div>

Not in my env. I don’t know what the CI system adds though behind the scenes.

Can you restart the remote builder app it gets assigned? That frog one? 🙂 Or kill it and so make a new one next time it tries to deploy? Since I’m using the latest flyctl, could that old remote builder be the issue? Not sure how that bit works at your end.

---

<div class="post-metadata">

**Author:** ![michael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/michael/32/16_2.png) [@michael](https://community.fly.io/u/michael)\
**Post date:** [March 10, 2021, 6:43pm UTC](https://community.fly.io/t/deploys-failing/908/10 "2021-03-10T18:43:49Z")

</div>

Oh interesting, what CI system is this?

These builders are just fly apps created in your org, you can delete it with `flyctl apps destroy fly-builder-lively-frog-1262` and it’ll create a new one on the next build.

---

<div class="post-metadata">

**Author:** ![greg](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/greg/32/2119_2.png) [@greg](https://community.fly.io/u/greg)\
**Post date:** [March 10, 2021, 6:47pm UTC](https://community.fly.io/t/deploys-failing/908/11 "2021-03-10T18:47:13Z")

</div>

It’s Codefresh. Trying it out.

Ah … interesting. I didn’t know I controlled that. Ok, great, I’ll try deleting it and see what happens on the next deploy.

---

<div class="post-metadata">

**Author:** ![michael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/michael/32/16_2.png) [@michael](https://community.fly.io/u/michael)\
**Post date:** [March 10, 2021, 6:50pm UTC](https://community.fly.io/t/deploys-failing/908/12 "2021-03-10T18:50:37Z")

</div>

I _think_ there’s a bug that’s causing flyctl to create a remote builder because `--remote-only` is on but infer settings for the local daemon because Codefresh has docker installed locally. Out of curiosity, why do you have the `--remote-only` flag in CI if it has docker?

---

<div class="post-metadata">

**Author:** ![greg](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/greg/32/2119_2.png) [@greg](https://community.fly.io/u/greg)\
**Post date:** [March 10, 2021, 7:07pm UTC](https://community.fly.io/t/deploys-failing/908/13 "2021-03-10T19:07:08Z")

</div>

Ah. Well this caused me some confusion too!

I think, unless it has changed, that their docker daemon is _not_ available in the way fly needs it to be.

In that … Codefresh can build docker images and deploy them, but only to a registry. And so under _that_ set up, the flyctl would need to support being passed an already-made image (in a remote registry). So, not a fly-managed registry. And I don’t believe that currently is allowed? At least it wasn’t supported a while back.

The docker daemon within Codefresh is apparently not intended to be used via a system-style call, ie directly e.g I noticed they say “By default, and for security reasons, the Docker Daemon is not exposed to freestyle steps running on our SaaS environments. In other words, this approach **cannot** be used in our SaaS Runtime Environments.”

So maybe it is causing flyctl confusion too.

But the good news is that I’ve tried another deploy, which will have made a new remote builder to replace that one I just destroyed, and the deploy worked 🙂

---

<div class="post-metadata">

**Author:** ![michael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/michael/32/16_2.png) [@michael](https://community.fly.io/u/michael)\
**Post date:** [March 10, 2021, 7:16pm UTC](https://community.fly.io/t/deploys-failing/908/14 "2021-03-10T19:16:46Z")

</div>

I’m glad a new builder worked but I’m not sure why 🙂 I’m setting up a test on Codefresh now, hopefully I can get to the bottom of this.

You can use the system docker to build if you’d like. Not sure this works on Codefresh, but it does on BuildKite, CircleCI, and GitHub. Here’s an example :

```auto
# authenticate docker to fly
flyctl docker auth

# build the app with docker & tag for your repo
docker build -t registry.fly.io/your-app:build-id ./path/to/app

# push the build to fly
docker push registry.fly.io/your-app:build-id

# deploy the image
flyctl deploy --image registry.fly.io/your-app:build-id

```

That image flag can be a local image or an image in a registry that fly can pull from to deploy. We need to document that better.

---

<div class="post-metadata">

**Author:** ![greg](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/greg/32/2119_2.png) [@greg](https://community.fly.io/u/greg)\
**Post date:** [March 10, 2021, 7:27pm UTC](https://community.fly.io/t/deploys-failing/908/15 "2021-03-10T19:27:53Z")

</div>

Interesting, yes, I wondered how fly integrates/authenticates with a private registry.

So:

1. I spoke too soon about it being fixed. That deploy _did_ work. But the next one I tried did not. ☹ So maybe if I keep deleting the remote builder app, _then_ deploy, it will work. At least for now. As I got the same error:

INFO Remote only, hooking you up with a remote Docker builder…  
INFO Waiting for remote builder (fly-builder-black-dust-4017) to become available…  
INFO Remote builder is ready to build!  
Error error during connect: Post “http://%2Fvar%2Frun%2Fdocker.sock/v1.40/build?buildargs=%7B%22STAGE%22%3A%22dev%22%7D&buildid=6d047673fd1e73f1e576b4bbde705c0db  
00451d582fdae20c09e4a224fe5602d&cachefrom=null&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=&labels=null&memory=0&memswap=  
0&networkmode=&remote=upload-request&rm=0&session=w6mvmoyta8e5yvot2zwm614cj&shmsize=0&[t=registry.fly.io](http://t=registry.fly.io)…&ulimits  
=null&version=2”: Error creating ssh client: ssh: handshake failed: EOF

1. Yeah, your commands make sense but I’m not quite sure how that approach works with Codefresh. Unless it is simple as translating them into Codefresh-speak. Since … as I read their docs, you can’t do a system call like **docker xyz**. Instead you have to turn it into their yml, which they then run on their docker daemon. You aren’t supposed to call docker directly. At least from their warning. So maybe that would work. It would be good to get the remote builder working, but like you say, if Codefresh provide docker and you can use it, it would avoid the need for the builder.

---

<div class="post-metadata">

**Author:** ![greg](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/greg/32/2119_2.png) [@greg](https://community.fly.io/u/greg)\
**Post date:** [March 10, 2021, 7:36pm UTC](https://community.fly.io/t/deploys-failing/908/16 "2021-03-10T19:36:31Z")

</div>

As a bonus, I did try removing that **–remote-only** flag to see what would happen. And yes, as suspected, Codefresh does not provide direct access to its docker daemon. As you get this message:

INFO Local docker unavailable, hooking you up with a remote Docker builder…

---

<div class="post-metadata">

**Author:** ![michael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/michael/32/16_2.png) [@michael](https://community.fly.io/u/michael)\
**Post date:** [March 10, 2021, 7:37pm UTC](https://community.fly.io/t/deploys-failing/908/17 "2021-03-10T19:37:32Z")

</div>

Good to know, thanks! We’re digging through a few possible causes, I’ll keep you posted.

---

<div class="post-metadata">

**Author:** ![michael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/michael/32/16_2.png) [@michael](https://community.fly.io/u/michael)\
**Post date:** [March 26, 2021, 10:10pm UTC](https://community.fly.io/t/deploys-failing/908/18 "2021-03-26T22:10:07Z")

</div>

@greg just letting you know we shipped a bunch of improvements to flyctl’s build+deploy code and remote builders this week. Try it out and let us know if you’re still having issues.

---

<div class="post-metadata">

**Author:** ![greg](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/greg/32/2119_2.png) [@greg](https://community.fly.io/u/greg)\
**Post date:** [March 26, 2021, 10:52pm UTC](https://community.fly.io/t/deploys-failing/908/19 "2021-03-26T22:52:27Z")

</div>

@michael Thanks.

I tried some deploys earlier today. The first failed:

```
Remote builder fly-builder-cold-glitter-7018 ready                                                                                                               
Error error connecting to docker: Error waiting for remote builder app: context canceled 

```

… so I deleted that builder app, as I’ve done before. And since then all deploys have worked 🙂

---

<div class="post-metadata">

**Author:** ![michael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/michael/32/16_2.png) [@michael](https://community.fly.io/u/michael)\
**Post date:** [March 26, 2021, 10:58pm UTC](https://community.fly.io/t/deploys-failing/908/20 "2021-03-26T22:58:35Z")

</div>

Thanks for following up! Looks like some builders weren’t getting the latest changes. I just purged them so you should be good next time.
