# UDP not responding as expected

**URL:** <https://community.fly.io/t/udp-not-responding-as-expected/11656>\
**Category:** Questions / Help\
**Tags:** login-only\
**Created:** [March 18, 2023, 6:52pm UTC](https://community.fly.io/t/udp-not-responding-as-expected/11656 "2023-03-18T18:52:47Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![max1486](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@max1486](https://community.fly.io/u/max1486)\
**Post date:** [March 18, 2023, 6:52pm UTC](https://community.fly.io/t/udp-not-responding-as-expected/11656/1 "2023-03-18T18:52:47Z")

</div>

Yes, we’re also having issues with proxying DNS requests through Fly IAD. It has been broken for about 5 hours.

@thomas

---

<div class="post-metadata">

**Author:** ![max1486](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@max1486](https://community.fly.io/u/max1486)\
**Post date:** [March 20, 2023, 2:37pm UTC](https://community.fly.io/t/udp-not-responding-as-expected/11656/2 "2023-03-20T14:37:46Z")

</div>

This still is broken.

---

<div class="post-metadata">

**Author:** ![max1486](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@max1486](https://community.fly.io/u/max1486)\
**Post date:** [March 21, 2023, 2:43am UTC](https://community.fly.io/t/udp-not-responding-as-expected/11656/3 "2023-03-21T02:43:36Z")

</div>

I have no log lines that I could really provide from a Fly point of view, as I am not running containers in IAD. Any user that is located in Ashburn however, is unable to connect via UDP.

See below:

```auto
[root@us100 ~]# dig A speedypage.dev @ns1.srvcp.com +tcp

; <<>> DiG 9.11.36-RedHat-9.11.36-5.el8_7.2 <<>> A speedypage.dev @ns1.srvcp.com +tcp
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28028
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;speedypage.dev. IN A

;; ANSWER SECTION:
speedypage.dev. 14400 IN A 103.163.187.2

;; Query time: 26 msec
;; SERVER: 37.16.25.85#53(37.16.25.85)
;; WHEN: Tue Mar 21 03:58:27 GMT 2023
;; MSG SIZE rcvd: 59

```

The above is DIG TCP, which returns as expected. If I then remove +tcp, so DIG uses UDP (and doesn’t have a built in failover mechanism), it times out:

```auto
[root@us100 ~]# dig A speedypage.dev @ns1.srvcp.com

; <<>> DiG 9.11.36-RedHat-9.11.36-5.el8_7.2 <<>> A speedypage.dev @ns1.srvcp.com
;; global options: +cmd
;; connection timed out; no servers could be reached

```

---

<div class="post-metadata">

**Author:** ![max1486](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@max1486](https://community.fly.io/u/max1486)\
**Post date:** [March 22, 2023, 3:17pm UTC](https://community.fly.io/t/udp-not-responding-as-expected/11656/4 "2023-03-22T15:17:56Z")

</div>

@thomas @kurt

---

<div class="post-metadata">

**Author:** ![kurt](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/kurt/32/43757_2.png) [@kurt](https://community.fly.io/u/kurt)\
**Post date:** [March 22, 2023, 3:31pm UTC](https://community.fly.io/t/udp-not-responding-as-expected/11656/5 "2023-03-22T15:31:55Z")

</div>

It seems to work fine from here: [DNS Checker - DNS Check Propagation Tool](https://dnschecker.org/#A/speedypage.dev)

It’s possible it’s failing from one specific region. You can see which region you’re hitting at [debug.fly.dev](http://debug.fly.dev), or possibly with MTR.

Note that UDP will only work for special IPs from within our network. It doesn’t look like you’re trying from a fly hosted VM, but that’s worth knowing.

And last, we only have spotty staff coverage on the forum. If you need one of us to help troubleshoot specific app problems, it would be best to upgrade to a paid plan and use email support. This is probably worthwhile for any UDP service you care about, there’s a lot of weird quirkiness in our UDP stack.

---

<div class="post-metadata">

**Author:** ![dstotijn](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/dstotijn/32/10751_2.png) [@dstotijn](https://community.fly.io/u/dstotijn)\
**Post date:** [March 23, 2023, 11:26pm UTC](https://community.fly.io/t/udp-not-responding-as-expected/11656/6 "2023-03-23T23:26:16Z")

</div>

Hi, I’m having a similar issue with UDP for a DNS service I’m trying to run on [Fly.io](http://Fly.io). Incoming packets are being read, but responses don’t seem to be received. I’m binding on `fly-global-services:53`, and connecting via a dedicated IPv4 address. [https://debug.fly.dev/](https://debug.fly.dev/) yields `Fly-Region: ams`.

Any help on this would be greatly appreciated! I’m about 8+ hours in debugging this. FWIW: I’m serving DNS using [GitHub - miekg/dns: DNS library in Go](https://github.com/miekg/dns). I’m not 100% sure if this library replies to the `fly-global-services` address (as stressed in [Running Fly.io Apps On UDP and TCP · Fly Docs](https://fly.io/docs/app-guides/udp-and-tcp/#the-fly-global-services-address)), but I would be surprised if it didn’t, given it’s using the same `net.ListenPacket` as in [the example repo](https://github.com/fly-apps/udp-echo-/blob/main/main.go#L45).

---

<div class="post-metadata">

**Author:** ![max1486](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@max1486](https://community.fly.io/u/max1486)\
**Post date:** [March 24, 2023, 12:13am UTC](https://community.fly.io/t/udp-not-responding-as-expected/11656/7 "2023-03-24T00:13:19Z")

</div>

This isn’t a specific app problem. UDP connectivity is not working in your IAD/Virginia location. The diagnosis I posted above shows a UDP connection, and a TCP one. UDP fails, TCP works. DIG does not re-try when UDP fails, while the tester you linked probably does.

Please note this has been working for nearly a year+ now, and seeing as others in IAD are having the same problem, I am inclined to think there is nothing wrong with the UDP implementation in this place at a fundamental level, more likely something just specific to this location.

[debug.fly.dev](http://debug.fly.dev) brings me to Fly/620fe63b, which is fly-region: iad.

---

<div class="post-metadata">

**Author:** ![kurt](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/kurt/32/43757_2.png) [@kurt](https://community.fly.io/u/kurt)\
**Post date:** [March 24, 2023, 2:23am UTC](https://community.fly.io/t/udp-not-responding-as-expected/11656/8 "2023-03-24T02:23:40Z")

</div>

Try this and see if you get a response: `dig txt debug.fly @debug.ipv4.fly.dev +short`.

I tested your app and I think the VM in `ewr` may not be responding to UDP reliably. Our TCP proxy is getting a lot of errors trying to talk to it (75% of these are from your ewr instance, 25% from sin):

```auto
could not proxy TCP data to/from instance: failed to copy (direction=server->client, error=Broken pipe (os error 32))

```

TCP continues to work because we detect issues like this and route TCP to other instances. UDP is dumber, and is easier to lose.

---

<div class="post-metadata">

**Author:** ![max1486](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@max1486](https://community.fly.io/u/max1486)\
**Post date:** [March 24, 2023, 2:42am UTC](https://community.fly.io/t/udp-not-responding-as-expected/11656/9 "2023-03-24T02:42:41Z")

</div>

I killed the EWR container previously and unfortunately it made no difference

```auto
# dig txt debug.fly @debug.ipv4.fly.dev +short

; <<>> DiG 9.11.36-RedHat-9.11.36-5.el8_7.2 <<>> txt debug.fly @debug.ipv4.fly.dev +short
;; global options: +cmd
;; connection timed out; no servers could be reached

```

---

<div class="post-metadata">

**Author:** ![thomas](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/thomas/32/40188_2.png) [@thomas](https://community.fly.io/u/thomas)\
**Post date:** [March 27, 2023, 6:54pm UTC](https://community.fly.io/t/udp-not-responding-as-expected/11656/10 "2023-03-27T18:54:40Z")

</div>

> [@max1486](#):
>
> `ns1.srvcp.com`

Quick update: I’m doing a bunch more digging on this today and we found something sus on one of our IAD edges, which we’re making ineligible right now. I’m in the middle of debugging this, but I’ll post more when I’ve got more; just so you know we’re on this.

---

<div class="post-metadata">

**Author:** ![thomas](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/thomas/32/40188_2.png) [@thomas](https://community.fly.io/u/thomas)\
**Post date:** [March 27, 2023, 7:49pm UTC](https://community.fly.io/t/udp-not-responding-as-expected/11656/11 "2023-03-27T19:49:01Z")

</div>

OK, this was tricky, but we think we’ve tracked down what’s happened: the process that updates our BPF routes for UDP services was getting CPU-throttled by `systemd`, which had the effect of wedging some stale routes for a small number of services. We tracked this down to ~5 edges (out of several hundred hosts).

In response:

- We’ve got an alert set up across the fleet for this condition ever recurring

- We’ve CPU-unthrottled the updating process, which should prevent it from recurring in the first place

- We’re planning on rewriting this process to use `corrosion`, our internal service discovery system, rather than Consul; it’s Consul tooling friction that’s burning all this CPU to begin with.

---

<div class="post-metadata">

**Author:** ![max1486](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@max1486](https://community.fly.io/u/max1486)\
**Post date:** [March 27, 2023, 8:03pm UTC](https://community.fly.io/t/udp-not-responding-as-expected/11656/12 "2023-03-27T20:03:42Z")

</div>

It’s fixed.

Thank you Thomas! Second time now you’ve saved the day re: UDP 🙂

---

<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:** [April 3, 2023, 8:04pm UTC](https://community.fly.io/t/udp-not-responding-as-expected/11656/13 "2023-04-03T20:04:27Z")

</div>

Closed on April 3, 2023, 8:04pm UTC

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