# Adding a sidecar to an app ruins Consul connectivity

**URL:** <https://community.fly.io/t/adding-a-sidecar-to-an-app-ruins-consul-connectivity/28914>\
**Category:** Questions / Help\
**Tags:** consul, machines, litefs, containers\
**Created:** [October 25, 2026, 1:53am UTC](https://community.fly.io/t/adding-a-sidecar-to-an-app-ruins-consul-connectivity/28914 "2026-10-25T01:53:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![c43721](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/c43721/32/51148_2.png) [@c43721](https://community.fly.io/u/c43721)\
**Post date:** [October 25, 2026, 1:53am UTC](https://community.fly.io/t/adding-a-sidecar-to-an-app-ruins-consul-connectivity/28914/1 "2026-10-25T01:53:40Z")

</div>

I have an app that used to just run one machine with no added sidecars. It used Consul for LiteFS. When I tried to add a sidecar, I noticed that the machine would not start due to the following log:

ord [info]level=INFO msg=“cannot fetch cluster ID from “consul” lease, retrying: Get “[http://127.0.0.1:8500/v1/kv/litefs/[app]/clusterid\](http://127.0.0.1:8500/v1/kv/litefs/%5Bapp%5D/clusterid%5C)”: dial tcp 127.0.0.1:8500: connect: connection refused”

I’ve tried to do the normal `fly consul detach` then `fly consul attach` with no luck. I recovered by deleting the machine, retattaching consul, then deploying again to get a fresh machine. Then it worked normally.

---

<div class="post-metadata">

**Author:** ![c43721](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/c43721/32/51148_2.png) [@c43721](https://community.fly.io/u/c43721)\
**Post date:** [October 25, 2026, 2:19am UTC](https://community.fly.io/t/adding-a-sidecar-to-an-app-ruins-consul-connectivity/28914/2 "2026-10-25T02:19:08Z")

</div>

So I detached consul, deleted the old machine, attached consul, then recreated the machine again and now I have a valid URL.

I think when I ran with a sidecar (was trying to run `cloudflared` along my app) it ended up disconnecting from Consul. I tried again in isolation and found that if I added a sidecar, it would ruin consul.

Example:

```auto
[containers]
  tunnel = { image = "cloudflare/cloudflared:latest", cmd = ["tunnel", "--no-autoupdate", "run"], secret_env = ["TUNNEL_TOKEN"] }

```

I used the cli-config.json method too, and that didn’t work.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg) [@system](https://community.fly.io/u/system)\
**Post date:** [November 4, 2026, 2:27am UTC](https://community.fly.io/t/adding-a-sidecar-to-an-app-ruins-consul-connectivity/28914/4 "2026-11-04T02:27:45Z")

</div>

Closed on November 4, 2026, 2:27am UTC

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