Repository navigation
Description
What happened
After a clean reboot, this Mac was unreachable over Tailscale for about two hours until I recovered it with physical access. Throughout, the node reported itself healthy: BackendState: Running, Self.Online: true, and a full peer list, while it could not receive a packet.
Up front about the evidence: I have the observed state during the outage, but not the daemon logs explaining why the receive loop stopped — see "The evidence I could not collect" below, which is itself a reportable problem. I have since put a local watchdog in place that captures state at the moment of recurrence, so I can supply better data next time.
Health output during the outage
# Health check:
# - Tailscale could not connect to the 'Chicago' relay server. Your Internet
# connection might be down, or the server might be temporarily unavailable.
# - The MagicSock function ReceiveIPv4 is not running. You might experience
# connectivity issues.
Both were present together, which is presumably why this was a total outage rather than a fallback to relay.
The network itself was fine
tailscale netcheck, run during the outage, was healthy — including the relay named in the warning:
* UDP: true
* IPv4: yes, <redacted>:49971
* MappingVariesByDestIP: false
* PortMapping: UPnP, NAT-PMP
* Nearest DERP: Chicago
* DERP latency:
- ord: 41.7ms (Chicago)
- nyc: 48.1ms
- iad: 62.9ms
[full map responded]
So the STUN/UDP probe reached Chicago at 41.7 ms while the persistent DERP connection was reported down.
Observed vs. inferred
I want to be careful to separate these.
Observed. During the same window, netcheck logged:
portmap: monitor: gateway and self IP changed: gw=<lan-gateway> self=<lan-address>
The extension had been running since boot (PPID 1, uptime matching the boot time), and the machine had reached a logged-in session within the same minute as the reboot.
Inferred, not proven. That the receive loop died because the extension initialized before the primary interface had its address. I do not have a log line showing ReceiveIPv4 exiting, nor the error it exited with, so I cannot rule out that it died later for an unrelated reason. What I can say is that it was down for the entire ~2h window and never retried on its own, and that this followed a boot.
The evidence I could not collect — possibly worth fixing on its own
I tried to recover the daemon logs afterward and could not. On this variant:
/Library/Tailscale/ipn.log..log1.txtandipn.log..log2.txtare zero bytes; they appear to be truncated when the extension restarts — which is exactly what recovery requires.- Nothing from Tailscale appears in the macOS unified log for the window (
log show --predicate 'process CONTAINS[c] "tailscale"'returns no entries). tailscale debug daemon-logsis a live tap, not history.
The practical consequence is that any extension-side failure on macsys is undiagnosable after the fact unless someone catches it live — and this particular failure makes the machine unreachable, so catching it live is exactly what a remote operator cannot do. If persisted local logs survived an extension restart, this report would have had a cause in it.
What does NOT recover it
Both verified on the affected machine:
-
tailscale down && tailscale up— insufficient. It recreates the tunnel interface (the tailnet address goes from bound on nothing to bound on a utun) but leaves the dead receive loop in place. The health warning persisted and pings still timed out. -
pkill -x Tailscalethenopen -a Tailscale— insufficient, and a trap for anyone scripting recovery. It terminates the GUI, but the network system extension survives, so the wedged magicsock is untouched. Measured twice, minutes apart, from an identical baseline:action extension PID pkill -x Tailscale+open -a Tailscale9401 → 9401 (survives) osascript -e 'tell application "Tailscale" to quit'+open -a Tailscale9401 → 25698 (replaced)
What does recover it
Quitting the app through its normal shutdown path (Cmd-Q, or the equivalent Apple Event) tears down and respawns the system extension, and the receive loop comes back. Health goes clean and peers reconnect immediately:
100.x.x.x <peer-phone> ... active; direct <lan-address>:41641, tx 120147420 rx 460324
I have reproduced the quit/relaunch recovery four times since, each time confirming the extension PID changes.
Suggested directions
- Retry the rebind when a receive function is observed down. The health tracker already knows the goroutine has exited — recovery currently requires an out-of-band process restart for a condition the client has already detected and named.
- Rebind on interface-address arrival. The portmap monitor observed
self IP changed; if magicsock rebound on that transition, a boot-ordering race would self-heal regardless of whether that is the trigger here. - Persist local logs across extension restarts (see above) so this class is diagnosable at all on macsys.
Environment
- macOS 26.5.2 (25F84), Darwin 25.5.0, Apple Silicon Mac mini
- Tailscale 1.98.8, standalone/
macsysvariant (io.tailscale.ipn.macsys),1.98.8-t1241b225b-g0520dfda5, go1.26.3 - Network extension:
/Library/SystemExtensions/<uuid>/io.tailscale.ipn.macsys.network-extension.systemextension - No
tailscaledsystem daemon; the extension is activated by the GUI app - Used almost entirely remotely, so this is a hard outage rather than an annoyance
Related
Same symptom class, different platform and trigger: #19504 (iOS — "MagicSock ReceiveIPv4 goroutine stops, data plane dies while control plane stays up"). Also #10976 (Windows, open since Jan 2024) and #13322 (ReceiveDERP).
Happy to run a specific diagnostic matrix, or to attach a tailscale bugreport from the next occurrence — my watchdog now captures local state at the moment the warnable fires, so I should be able to provide a much better-evidenced follow-up.
Activity
croakerbcts commentedon Jul 27, 2026
@jmfoster can you please provide a Bug Report ID, per https://tailscale.com/docs/account/bug-report ? That will help with diagnosis.
bcreane commentedon Aug 8, 2026
The receive goroutine is owned by wireguard-go, and it exits permanently on the first error it considers non-temporary. In
Device.RoutineReceiveIncomingreceive.goNothing restarts the goroutine afterwards. Same class as #19504 (iOS), #10976 (Windows) and #13322 (ReceiveDERP) - shared
wgenginecode rather than anything macOS-specific.The evidence: magicsock logs
Receive func %s exiting with error: %T, %von the way out, so the concrete errno for your outage window is likely already in this node's uploaded logs. A bug report ID per @croakerbcts's request above would let us confirm which one rather than infer it.jmfoster commentedon Aug 9, 2026
Unfortunately I can't produce a bug report ID for this one.
Within a day of filing it I migrated this machine off the
macsysbuild onto theopen-source
tailscaledrunning as a root LaunchDaemon, largely because of point 3above. The node was re-registered in the process and is now on 1.102.2, so a
bugreportgenerated today marks a different node's log stream and would contain nothing from the
outage window. The old logtail ID isn't recoverable locally either — the current
tailscaled.log.confwas created at the migration, and what's left of themacsysspoolis only its own shutdown lines.
NichCodes commentedon Sep 3, 2026
Having the same issue on MacOS with MagicSock and ReceiveIPv4 and wanted to throw in my two cents. (And bug report ID for @croakerbcts, if it helps.)
What I think is happening is that, after a network interface transition (like switching WiFI networks in my case), MagicSock gets stuck in a broken-pipe loop trying to reach peer endpoints on the previous network's local subnet. Recovery keeps on going for several minutes, during which the health check keeps showing the same error:
The logs kicked up over 800 lines of stuff, so I tossed it into all into convenient LLM to ask it to summarize (but I've uploaded the full bug report with
--diagnosticsif you wanna look at the details):Other Details
How to Reproduce Bug
log showformagicsockevents — observe repeatedbroken pipeerrors and amagicsock-receive-func-errorhealth warning that persists for several minutes.OS version
macOS 26.6
Tailscale version
Bug Report ID
BUG-66ff4025c2ac45ae1642ea11d1362c75449a6de214ffa46216d3ebe7e0ec887f-20260903221359Z-ad68545606af63afmadeinoz67 commentedon Sep 4, 2026
Same signature on the App Store variant (
io.tailscale.ipn.macos) at 1.102.3, adding a few data points to this thread. macOS 26.x (Darwin 25.6.0), Apple Silicon.Trigger context differs from yours: not after boot. This incident began with the GUI app hung and the NE session stuck (
scutil --ncshowed the config in Connecting/Disconnecting withConnectCount: 1, ConnectedCount: 0; the packet-tunnel extension was not running at all). After unwedging the session and relaunching the app, the tunnel came up nominally: peer listedactive; direct, andtailscale pingponged at 17–20 ms — while everything inside the tunnel was dead:TCP to the peer's tailnet address and to hosts behind its advertised subnet routes: connection timeouts.
tailscale netcheckhealthy (UDP true, IPv4 yes, low DERP latency).What did not recover it — matches your findings:
tailscale down && tailscale up— insufficient. After one cycle the peer's rx counter moved 0 → ~2.4 KB, but TSMP and all TCP flows stayed dead (~2 h total from onset).killall Tailscalealone leaves the network extension untouched — confirmed, same extension PID before and after.What recovered it:
tailscale down→killall Tailscale→open -a Tailscale→tailscale up. Immediately after: TSMP pong 21 ms, TCP to the peer and to subnet-route targets succeeded, peer counters tx 332 KB / rx 1.8 MB and climbing. I can't isolate which component of the sequence mattered (thedownbefore the kill, the extension respawn, or theup) — only that down/up without the GUI kill in between did not.Third-party filters exonerated by experiment: this machine runs Little Snitch 6.4.1 (network + endpoint-security system extensions) alongside a PIA split-tunnel network extension. Both were active at failure and at recovery — full function was re-verified with filtering re-enabled after the fix. Worth ruling out explicitly since content filters are the obvious first suspect here, and structurally: disco pongs and encrypted payload ride the same UDP 5-tuple from the same process, so a flow-based filter that allows the pong cannot selectively drop the payload inside that flow.
Peer-side exonerated: a phone on the same tailnet (on cellular) could reach the affected Linux peer and its subnet routes throughout the outage — consistent with the failure living in the Mac's local receive path, not the peer or relay fallback.
A cheap discriminator for anyone hitting this:
tailscale ping(disco) vstailscale ping --tsmpvs the peer's tx/rx counters intailscale status. Disco pong + TSMP timeout + peer rx pinned at 0 while tx climbs isolates the failure to the in-tunnel data path while every layer above it reports healthy. A second tailnet device is the fastest way to exonerate the peer, but the TSMP/rx split alone already narrows it.Same evidence gap as yours, I'm afraid: no
tailscale bugreportfrom before recovery, and nothing in the unified log exposing the receive-loop state during the outage (I have the extension's early os_log lines from the initial NE wedge, but nothing diagnostic from the data-plane-dead window). A watchdog now captures state at the moment of recurrence, so a better-evidenced follow-up is possible if it repeats.nikitistik commentedon Sep 15, 2026
I hit this roughly once a day on macOS and I think I have the mechanism, so here it is in case it helps, plus a proposed fix I would like a sanity check on before opening a PR.
Setup: Tailscale 1.102.4 (App Store / macsys build), macOS 27.0, Apple silicon, with Proton VPN (WireGuard, its own utun) installed and Tailscale excluded from it. The deaths line up with Proton connect/disconnect transitions, i.e. the default route moving between
en0and Proton's utun, usually around sleep/wake. My watchdog log has 60 occurrences over 25 days; the only thing that recovers it is restarting the network extension (scutil --nc stop/start Tailscale).tailscale down && tailscale updoes not, matching the report above. I do not yet have the exact errno from the extension's log (it is not kept), I have atailscale debug daemon-logstap running now and will add the "Receive func ReceiveIPv4 exiting with error: ..." line from the next occurrence.Why it never comes back (v1.102.4):
wgengine/magicsockmkReceiveFuncreturns every read error other than truncation to wireguard-go.device/receive.goRoutineReceiveIncoming(around L116-132 in the pinnedtailscale/wireguard-go) returns permanently on any error that is not aTemporary()net.Error. On Darwin that is essentially every errno except EINTR/EMFILE/ENFILE/timeout.Device.Up(the only caller ofBindUpdate) runs once at engine construction inwgengine/userspace.go;Rebind()from the link-change path only swaps the socket insideRebindingUDPConn, and a reader that has already returned never reads the new one.connBindis single-use by design, soBindUpdatewould not work either.health.checkReceiveFuncsLocked, sampled every minute), so "is not running" literally means wireguard-go stopped calling the func. It has no remedy.Proposed fix: treat a non-shutdown read error inside the receive func the way the send path already treats EPIPE/ENOTCONN (
maybeRebindOnError, from #14551): log once, do a throttledRebind()+ReSTUN(), back off (100ms doubling to 5s) and keep reading. The func returnsnet.ErrClosedonly when the Conn or the Bind is closed, so theconn.Bindcontract andDevice.Close's wait on the receive goroutines are unchanged, and closing the Bind wakes a func waiting out a backoff. Rebinds per error burst are bounded (throttled attempts are not charged) so one persistently broken address family cannot keep resetting every peer's endpoints, andRebind/bindSocketno longer install a socket once Close has started. Two clientmetrics count the errors and the rebinds. The change is about 160 lines in magicsock.go plus tests (survive a read error and keep delivering from the rebound socket; return promptly when the Bind closes during a backoff or mid-read; no rebind after close; bounded rebinds). The package passes under-race. Branch: https://github.com/nikitistik/tailscale/tree/magicsock-receive-rebindTwo questions before I send it as a PR: is retry-in-place in the receive func the layer you would want this at, or would you rather see wireguard-go's
RoutineReceiveIncomingkeep going / aBindUpdatepath? And should the persistent-error case eventually raise its own warnable, since during the backoffinCallstays true and the existing "not running" warnable can no longer fire?nikitistik commentedon Sep 19, 2026
Opened #21396 with the change described above, rebased on current main.
wgengine/magicsock: keep receive funcs alive across socket read errors
te316 commentedon Sep 28, 2026
Adding a fast, reliable reproduction on macOS 27.2: with a Mullvad exit node, the receive func dies within 3 to 6 minutes, every time.
Environment
tailscale netcheck: UDP true, IPv6 no, nearest DERP iad)Symptom
Everything works for 3.5 to 5.5 minutes, then all traffic stops at once (web, MagicDNS, and DNS sent directly to 1.1.1.1). The exit node peer's RxBytes freezes while TxBytes keeps rising. Health then shows
The MagicSock function ReceiveIPv4 is not running(1.102.4) orReceiveIPv6 is not running(1.103.310; in one run ReceiveIPv6 was reported about 1.5 minutes before traffic stopped). Turning the exit node off restores connectivity, but the receiver stays dead (Rx counter frozen, warning remains) until the app is quit and relaunched, matching this issue.Runs (each from a freshly relaunched app)
It also still fails with Norton and NordVPN uninstalled (their system extensions terminated), leaving Tailscale's as the only network extension. So this does not need a third-party VPN or route flip to trigger; the exit node traffic alone is enough.
Bug reports, each captured at the moment of failure. The exact
Receive func ... exiting with errorline should be in the uploaded logs:Since it reproduces in minutes, I'm happy to test a build with #21396 (or any other candidate fix) and report back.
5 remaining items
device: retry receive funcs on every read error but net.ErrClosed
ViRb3 commentedon Oct 30, 2026
I think the real trigger is any active content-filter network extension (like Little Snitch 6.5 for me): #22082 (comment)
magicsock: pace UDP receive errors
magicsock: handle and pace UDP receive errors
magicsock: handle and pace UDP receive errors
magicsock: handle and pace UDP receive errors
magicsock: handle UDP read feedback
magicsock: handle UDP read feedback
magicsock: handle UDP read feedback
magicsock: handle UDP read feedback
ViRb3 commentedon Oct 31, 2026
The fix above was just merged in unstable and it solved it for me: https://pkgs.tailscale.com/unstable/Tailscale-1.105.158-macos.pkg
magicsock: handle UDP read feedback
magicsock: handle UDP read feedback (#22146)
nickoneill commentedon Nov 3, 2026
As mentioned above, this is likely a duplicate of #19504 and resolved in 1.104.5. Please retest there and comment on 19504 if your issue is not resolved.