# Consul returning error 509

**URL:** <https://community.fly.io/t/consul-returning-error-509/8767>\
**Category:** General\
**Tags:** consul\
**Created:** [November 18, 2022, 9:11am UTC](https://community.fly.io/t/consul-returning-error-509/8767 "2022-11-18T09:11:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![snorrwe](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/snorrwe/32/7165_2.png) [@snorrwe](https://community.fly.io/u/snorrwe)\
**Post date:** [November 18, 2022, 9:11am UTC](https://community.fly.io/t/consul-returning-error-509/8767/1 "2022-11-18T09:11:01Z")

</div>

I followed the [getting started with LiteFS](https://fly.io/docs/litefs/getting-started/) guide, I have an app in Frankfurt.  
Unfortunately on deploy I see this error:

```auto
fra [info]Using Consul to determine primary
fra [info]cannot init consul: cannot connect to consul: register node "<my-app-name>/litefs": Put "https://consul-fra-2.fly-shared.net/v1/catalog/register": x509: certificate signed by unknown authority

```

After the error Fly attempts to restart but gets the same error, it’s been going on for ~10 hours now.

Any help is appreciated

---

<div class="post-metadata">

**Author:** ![benbjohnson](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/benbjohnson/32/50901_2.png) [@benbjohnson](https://community.fly.io/u/benbjohnson)\
**Post date:** [November 18, 2022, 8:55pm UTC](https://community.fly.io/t/consul-returning-error-509/8767/2 "2022-11-18T20:55:02Z")

</div>

You may need to install certificates in your `Dockerfile`. If you’re running `alpine`, then you’ll need:

```auto
RUN apk add ca-certificates

```

The `curl` install on the `litefs-example` repo installs the certificates as part of its `curl` installation:

> <https://github.com/superfly/litefs-example/blob/main/Dockerfile#LL23C10-L23C10>

---

<div class="post-metadata">

**Author:** ![snorrwe](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/snorrwe/32/7165_2.png) [@snorrwe](https://community.fly.io/u/snorrwe)\
**Post date:** [November 18, 2022, 9:27pm UTC](https://community.fly.io/t/consul-returning-error-509/8767/3 "2022-11-18T21:27:04Z")

</div>

🤦 That was it. Thank you!

---

<div class="post-metadata">

**Author:** ![benbjohnson](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/benbjohnson/32/50901_2.png) [@benbjohnson](https://community.fly.io/u/benbjohnson)\
**Post date:** [November 18, 2022, 9:34pm UTC](https://community.fly.io/t/consul-returning-error-509/8767/4 "2022-11-18T21:34:21Z")

</div>

I’ll add that to our docs. That’s easy to mess up. 😬
