[Bug]: iOS app usage is followed by Tailscale ReceiveIPv4 failure; Safari stays stable
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/mobile
Steps to reproduce
- Connect an iPhone running iOS 27.0.1 to a T3 Code server through Tailscale.
- Open the native T3 Code iOS app (version 2.1.0) and use a remote environment.
- After roughly 2–3 minutes, the app can no longer reach the server.
- Check Tailscale on the iPhone: it still says “Connected”, but reports “MagicSock Function Not Running” for ReceiveIPv4. Connections to other devices on the tailnet also time out.
- Turn Tailscale off and on. Connectivity returns temporarily, then the problem recurs when using the native app.
Comparison: Using T3 Code in Safari on the same iPhone over the same Tailscale connection appears to remain stable. I have observed the native-app problem on both Wi‑Fi and cellular.
Expected behavior
The native iOS app should maintain its connection to the server without disrupting Tailscale connectivity on the iPhone.
Actual behavior
After roughly 2–3 minutes of native-app use, T3 Code loses its connection to the server. Tailscale still displays “Connected” but shows a ReceiveIPv4 MagicSock warning. Other tailnet connections from the iPhone also time out. Toggling Tailscale restores connectivity only temporarily. I have not observed the same failure while using T3 Code in Safari on the same iPhone and tailnet.
Impact
Major degradation or frequent failure
Version or commit
T3 Code iOS app 2.1.0.
Environment
iPhone running iOS 27.0.1; T3 Code native iOS app 2.1.0; remote T3 Code server reached over Tailscale. Tested on both Wi‑Fi and cellular. Comparison client: Safari on the same iPhone, using the same Tailscale connection.
Logs or stack traces
Tailscale warning on the iPhone:
MagicSock Function Not Running
Function: ReceiveIPv4
Code: magicsock-receive-func-error
During a failure, the Tailscale log repeatedly showed WireGuard handshake attempts that did not complete, “UDP is blocked” in netcheck, and connection timeouts to tailnet peers. I do not have a T3 Code iOS stack trace.
Screenshots, recordings, or supporting files
No response
Workaround
Using T3 Code in Safari on the same iPhone over Tailscale appears stable. Toggling Tailscale off and on restores the native app temporarily, but the failure recurs.
Hitting the same thing (iOS 27.2, Tailscale 1.104.2). For me it only happens when one of my environments is on a machine that's asleep. With that PC asleep and the app open, Tailscale died within ~2 min every time (4/4). PC awake, or app closed: no issues.
Looks like the real bug is in Tailscale: tailscale/tailscale#19504, possible fix in tailscale/tailscale#21902. Every failure lined up with sendto: host is down errors to the sleeping machine, which matches what that PR describes.
The app makes it worse by hammering unreachable environments with retries though. Backing off on those would probably avoid it.
Workaround: disable the environment for any machine that's offline.
2. Hitting the same thing (iOS 27.2, Tailscale 1.104.2). For me it only happens when one of my environments is on a machine that's asleep. With that PC asleep and the app open, Tailscale died within ~2 min every time (4/4). PC awake, or app closed: no issues. Looks like the real bug is in Tailscale: tailscale/tailscale#19504, possible fix in tailscale/tailscale#21902. Every failure lined up with
sendto: host is downerrors to the sleeping machine, which matches what that PR describes. The app makes it worse by hammering unreachable environments with retries though. Backing off on those would probably avoid it. Workaround: disable the environment for any machine that's offline.
Update: after removing the MacBook environment from the T3 Code iOS app and keeping only my always-on server, I have not experienced any further Tailscale failures. Previously, the native app would trigger the failure after roughly 2–3 minutes. This supports the offline-environment hypothesis reported above, although I have not confirmed the underlying mechanism.
Confirming this on iOS 26.5 with Tailscale 1.104.2, and sharing what we found about the cause.
What we saw: with saved environments pointing at tailnet machines that are powered off, the T3 iOS app goes to "Reconnecting…" within a few minutes, and Tailscale shows "MagicSock function not running" (ReceiveIPv4) while the VPN still says Connected. Only toggling Tailscale recovers it, until the next failure. With the offline environments disabled it stayed stable for ~35 min; re-enabling them reproduced it within ~6 min.
Why it happens: this is a Tailscale bug, not a T3 one. Tailscale uses one shared UDP socket for every peer, and its receive function (mkReceiveFunc in wgengine/magicsock) returns on any read error other than truncation; wireguard-go never restarts it. So once that loop exits, the phone can still send but can no longer receive from any peer, which is why the always-on machine becomes unreachable too. A peer's logs during the failure showed exactly that: the phone kept sending disco pings and WireGuard handshake initiations, but retransmitted the same initiation (handshake replay) because it never received the responses.
Status upstream: Tailscale has a fix open in tailscale/tailscale#21902 (keeps the receive funcs alive across these read errors). We posted an iOS bug report captured during a failure, with this reproduction, here: https://github.com/tailscale/tailscale/pull/21902#issuecomment-6455823372. Related iOS issue: tailscale/tailscale#19504.
Same failure on iPadOS, with a server-side view in case it helps.
Setup
- iPad mini (6th gen, Wi-Fi + Cellular), iPadOS 27, T3 Code app 2.1.0, Tailscale for iOS 1.104.4 (reinstalled from the App Store on 2026-10-29).
- Three environments paired with direct pairing links over Tailscale Serve HTTPS, without a T3 Connect tunnel: an always-on Linux server (
t30.1.5-nightly.20261029.3867 as a background service, Tailscale 1.104.2) and two Linux desktop hosts that were powered off.
What I saw
- For the always-on server, the app reported
Remote environment endpoint https://<host>:8443/.well-known/t3/environment timed out after 10000ms(Route: Direct). A local curl on the server returned HTTP 200 in ~9 ms, and the slowest server span in the preceding 30 minutes was 342 ms. - During failures, the server's tailscaled logged
magicsock: new contact: peer=[…] cached=false via=derpfor the iPad every 3–6 s.tailscale pingto the iPad timed out, and every ICMP probe over the tunnel was lost. - Healthy periods after toggling Tailscale, or after reinstalling the Tailscale app, lasted ~20–90 s before failing the same way.
- Cellular only (Wi-Fi off) stayed healthy for 22 consecutive samples over ~1.5 min, relayed through DERP. Wi-Fi only failed after ~1.5 min and recovered after ~40 s. With Wi-Fi and cellular enabled, it failed after ~1 min and stayed down for over 2 min.
Workaround After disabling both offline environments in Settings → Environments and toggling Tailscale once, 60/60 probes succeeded over ~3.3 min, all direct over the LAN, median 24 ms.