Skip to content

Frequent disconnection on IOS #17967

Open
Open

Description

@gregwelldone

What is the issue?

Dear all,
I am using tailscale to access HA remotely on IOS 26. It used to work flawlessly but since a few weeks, there is frequent disconnection (using a webpage or HA companion). Remote connexion works perfectly when I access my tailscale network from a PC.
Do you have any idea where the problem come from?

Steps to reproduce

No response

Are there any recent changes that introduced the issue?

No response

OS

IOS

OS version

IOS 26

Tailscale version

1.90.4

Other software

Home Assistant companion

Bug report

No response

Activity

  1. tdalbo92 commented on Nov 18, 2025

    @tdalbo92

    I don’t know if my issue is exactly the same, but I’ve just gotten an iPhone a few weeks ago and I noticed the same behavior. In my case, it’s DNS causing all the hangs and timeouts.

    I’m serving DNS via Tailscale itself, and don’t have any problems with my Linux or android clients.

    Toggling Tailscale off and on again seems to temporarily fix the problem, and it seems fine when I’m actively using the phone, but it gets pretty confused if the phone has been sitting idle for awhile.

    It also does not seem to be related to whether an exit node is being used.

  2. gregwelldone commented on Nov 19, 2025

    @gregwelldone
    Author

    Glad to hear I am not the only one experiencing that glitch.
    From time to time, I see the following warning in Tailscale: MagicSock Function Not Running.
    In Tailscale, VPN On Demand and Detect MagicDNS are on.
    It seems to be the same problem as the one described in this old post which is now closed:
    #14320

  3. jenks6797 commented on Nov 24, 2025

    @jenks6797

    Just adding that I am also experiencing the same frequent disconnects in iOS ever since I started using a mullvad exit node. I either get the MagicSock error mentioned above, or a DNS error. Mostly happens whenever I leave the house and connect to celular and then try to re-connect to wifi. I can usually solve it by toggling Tailscale on and off in the iOS app, but sometimes that doesn't work and I need to disable my exit node as well.

  4. abstractvector commented on Dec 23, 2025

    @abstractvector

    I’m seeing the exact same issue here where it works fine until I open the Home Assistant app on iOS. Within seconds, I lose connectivity - the dashboard will open and show up-to-date data, but within ~5 seconds the connection is lost and I have no internet connectivity in either the HA app or anything else on the phone. The only solution is to disable and re-enable Tailscale and not re-open HA.

    This started happening a few days ago and had been fine until then.

  5. grahams commented on Dec 24, 2025

    @grahams

    I'm running 1.92.3 and I've been traveling for the holidays. I have my Adguard server configured as a global nameserver in the Tailscale admin console.

    At home I use VPN On Demand so I'm usually not relying on Tailscale at home. But the past few days visiting family (where it should remain connected all the time) I've noticed very frequent times where all network gets jammed, and the only way to resolve it is to launch the Tailscale app. At startup it is disconnected but without any intervention with me it quickly connects and then everything on the phone works fine.

    I disabled VPN On Demand altogether but that hasn't seemed to fix anything.

  6. cthulu commented on Dec 28, 2025

    @cthulu

    Same for me, although it used to be more stable before. I actually thought it's my VPN breaking down, but it seems to be related to the HA starting. Could be memory related, as mentioned in some other threads.

  7. gregwelldone commented on Dec 30, 2025

    @gregwelldone
    Author

    Weird but I had an exit node offline from a few weeks. As soon as that exit node went back online, I was able to access the second exit node (the one I couldnt access from IOS) from IOS without any disconnection.
    This behavior was reported to Tailscale.

  8. abstractvector commented on Dec 30, 2025

    @abstractvector

    Weird but I had an exit node offline from a few weeks. As soon as that exit node went back online, I was able to access the second exit node (the one I couldnt access from IOS) from IOS without any disconnection. This behavior was reported to Tailscale.

    Interesting, I had an exit node go offline at right around the same time too. It’s a remote node that I haven’t been able to bring back online yet unfortunately.

  9. shall4 commented on Jan 11, 2026

    @shall4

    I am seeing the same issue and was able to grab the logs from the Home Assistant Companion App following the failure. I fed them to Chat-GPT and came up with the following information:

    1. On iOS 26.2.0 (iPhone 16 Pro Max), enable Tailscale (v1.92.3).

    2. Verify tunnel works by accessing another service over Tailscale (e.g., Blue Iris) — traffic flows normally.

    3. Open Home Assistant iOS Companion App (v2026.1.1) configured to use a direct Tailscale IP only (no MagicDNS).

    4. Home Assistant works normally for ~60 seconds.

    5. After ~60 seconds:

      • Home Assistant traffic stalls (WebSocket stops receiving data).
      • Shortly after, all traffic over the Tailscale tunnel stops, including previously working services.
      • Tailscale UI still shows the tunnel as connected.
    6. Cycling Tailscale off/on in iOS Settings immediately restores connectivity.

    7. Repeating step 3 reproduces the failure consistently.

    Relevant Home Assistant iOS app log excerpts (redacted)

    WebSocket: disconnecting; permanently: default, error:
    Optional(HAKit.HAReconnectManagerError.lateFireReset)

    Adding event: Background fetch activated

    failed request … NSURLErrorDomain Code=-1001 "The request timed out."
    … http://100.x.y.z:8123/api/

    out of time for background task webhook-send
    out of time for background task background-fetch

    Notes

    • MagicDNS is not involved; issue persists using IP-only access.
    • NSURLErrorDomain -1001 indicates timeouts (not DNS, TLS, or connection refusal).
    • Log timing aligns with iOS background execution and precedes tunnel-wide traffic loss.
    • After failure, tunnel appears “connected” but passes no traffic until restarted.
  10. vww1978 commented on Feb 18, 2026

    @vww1978

    I’m seeing the exact same issue here where it works fine until I open the Home Assistant app on iOS. Within seconds, I lose connectivity - the dashboard will open and show up-to-date data, but within ~5 seconds the connection is lost and I have no internet connectivity in either the HA app or anything else on the phone. The only solution is to disable and re-enable Tailscale and not re-open HA.

    This started happening a few days ago and had been fine until then.

    Yes, same for me. Everything works well until I open the HA app and then after a few seconds I loose connectivity.

  11. mikaelSchalin commented on Mar 4, 2026

    @mikaelSchalin

    Yes, same for me.

    iPhone 12 mini, iOS 26.3, Tailscale 1.94.1.

    Connecting to multiple Home Assistant instances via direct Tailscale IPs (e.g. 100.96.167.2:8123). After some seconds/minutes of using HA (app or browser), all Tailscale traffic from the phone stops until I toggle Tailscale off/on or delete/re-add the VPN profile.

    Bug report ID:
    BUG-9aa6f1a1f25d3d70d3dd0088d03fa1fd4bd5e5db9ab3a528ec9c27932fd61595-20260304165634Z-7fdb570

  12. gregwelldone commented on Mar 4, 2026

    @gregwelldone
    Author

    If it is useful, my problem was resolved as soon as all devices running HA were back online. The problem started when one of my HA was offline for a few weeks (my internet was down).

  13. vww1978 commented on Mar 4, 2026

    @vww1978
  14. 2 remaining items

  15. added
    OS-ios
    on Mar 31, 2026
  16. Koff commented on Apr 18, 2026

    @Koff

    I was having a similar issue to the one described here.
    In my case, I have Tailscale, and HomeAssistant. I have 2 instances of HomeAssistant (different homes).

    For months, I had been battling this disconnects where HA iOS app would work for 5-10 seconds upon reconnecting Tailscale, then it would stop working until I forced a disconnect then connect to Tailscale. More annoyingly the issue affected other services besides HomeAssistant.

    Somehow, uninstalling the second home from the HA iOS app fixed this.

  17. zer0rg commented on Sep 17, 2026

    @zer0rg

    Same on me with Orca App (onorca.dev) . I connect to Tailscale open Orca after a few minutes i lose connectivity and i have to disconnect tailscale and connect it again

  18. TG-Techie commented on Oct 22, 2026

    @TG-Techie

    I also experience this often still, on public and beta iOS 26 ; 15 Pro Max (early population hardware rev iirc)

    The MagicSock function ReceivelPv4 is not running. You might experience connectivity issues.
    Code: magicsock-receive-func-error
    Magicsock Function Name: ReceivelPv4
    

    image

  19. luben93 commented on Oct 30, 2026

    @luben93

    Adding another report with the same symptoms, plus a reading of the code that may explain why a stall never heals. The code reading is not confirmed on a device.

    Environment: iPhone 15 Pro Max, iOS 26.6.2, Tailscale iOS app 1.104.2 (problems seen on that version). In Orca the phone is paired with two hosts: a Linux node (running daemon 1.104.1, CLI 1.104.2, running orca serve) that is normally up, and a macOS node (1.104.4) that is normally offline or asleep. I keep the Mac paired on purpose, so an offline peer is a normal state here. Depending on the moment the path is direct over the LAN or via DERP (hel).

    Symptom: the app on the phone is Orca mobile (https://github.com/stablyai/orca), which holds a long-lived WebSocket to the host over its Tailscale address. The connection stalls in place while it is still shown as connected, usually in the middle of streamed output, or right after switching apps. Toggling Tailscale off and on recovers it. It is unpredictable, and the in-app log viewer clears too fast for me to catch the moment, so I have no Receive func line. I have not checked whether other apps stop at the same time. Several of you above fixed this by removing or reviving an offline peer. I won't remove the Mac, since I want to reach it whenever it is on, so if an offline peer is what triggers this (I have not confirmed that the app keeps retrying it), that is a case Tailscale needs to tolerate rather than something I can work around.

    Bug report ID from 2026-10-30 10:58Z (not necessarily taken during a stall): BUG-5c7ddcce96a63a64d3a96b492bf51b2e5c1bad4bea7995bfd110ddc83cfedd3f-20261030105805Z-453abc5bdcf6a400

    What the code does (tailscale/tailscale at 5a05ac1, VERSION 1.105.0, and tailscale/wireguard-go db3888e688e9):

    • The magicsock-receive-func-error warning comes from health.checkReceiveFuncsLocked: it fires when a receive func (ReceiveIPv4) is neither inside a call nor gaining calls between two checks. Nothing acts on it; it only sets the warnable.
    • Conn.mkReceiveFunc returns any ReadBatch error to wireguard-go, and RebindingUDPConn.ReadBatch retries only when the failing pconn is no longer the current one.
    • In wireguard-go RoutineReceiveIncoming, a returned error ends that goroutine for good if it is a non-temporary net.Error, or after 10 consecutive errors (about 3 s with the 333 ms sleeps). Only net.ErrClosed is a normal exit. Nothing restarts it until the Bind is closed and reopened, which is what toggling the tunnel does.
    • The send side already has recovery: Conn.maybeRebindOnError (called from sendUDPBatch and sendUDP) rebinds and re-STUNs on errors known to be healed by it. I found no equivalent on the receive path.

    If that is right, a burst of read errors on the UDP socket (extension suspended, network path change, resource pressure) leaves the tunnel unable to receive while it still looks connected, which matches the stalls here and in the Home Assistant reports. Suggestion: treat non-closing read errors in mkReceiveFunc as retryable (rebind and keep reading), or have the missing state from the health check trigger a rebind instead of only a warning. The error text from Receive func ReceiveIPv4 exiting with error: in the uploaded logs for a bug report taken during a stall would confirm or refute this.

    Happy to test a build or collect more logs.

  20. luben93 commented on Oct 30, 2026

    @luben93

    I opened a draft PR with a possible fix for the receive-side gap described in my earlier comment: #22084

    It makes mkReceiveFunc rebind (throttled, shared with the send path) and retry with a bounded backoff on a read error, instead of returning it to wireguard-go, which would end the receive routine. It is a defensive change: the read error that occurs on iOS is still unconfirmed, so a log line from a stall would help to verify it. Comments on the approach are welcome there.

  21. Inhum commented on Oct 30, 2026

    @Inhum

    I have a related but slightly different issue on an iPhone 13 running iOS 18.7.8, documented in [#21355](#21355).

    In my case, the tunnel is actually stopped by iOS, with:

    stopTunnel: "unhandled reason, NEProviderStopReason.rawValue = 17"

    This happens during outbound uploads, and I have also reproduced it by simply opening certain applications.

    The IPNExtension memory usage in the captured logs was stable at approximately 32–32.5 MB. No Jetsam event or Network Extension crash was observed at the time of the original failure.

    Could you check whether a ReceiveIPv4 read error or receive-goroutine termination occurs before stopTunnel in my bug report?

    I'm wondering whether the receive-side failure addressed by this PR could be related to the subsequent Network Extension teardown, or whether these are separate problems.

    I have a fresh bug report from October 30, 2026, available for investigation.

  22. luben93 commented on Oct 30, 2026

    @luben93

    Thanks for the details. I can't open Tailscale bug reports (only Tailscale staff can look them up by ID), so I can't tell from here whether a ReceiveIPv4 error comes before your stopTunnel. What I can add from the code and from Apple's side:

    • NEProviderStopReason raw value 17 is .internalError, which Apple only describes as the provider encountering an internal error (docs). One developer forum report ties it to the system process nesessionmanager being killed (in that case by jetsam), after which the system tore down the tunnel (thread). That is a single forum reply, not an official explanation.
    • stopTunnel is called by iOS on the app side. I found no handling of it in this repo (tailscale/tailscale), so a receive routine ending would not by itself make iOS stop the tunnel.
    • The failure the PR is aimed at looks different: the tunnel stays up and says connected, but the receive routine has ended, so nothing arrives until the Bind is reopened. In your case the OS stops the tunnel. So I think these are probably separate problems, though I can't rule out a link.

    Two ways to tell them apart:

    1. In your bug report or the app's log viewer, look for Receive func ReceiveIPv4 exiting with error: shortly before the stopTunnel line. If it isn't there, it is likely the separate problem.
    2. With the iPhone attached to a Mac, Console.app (select the device in the sidebar) filtered to nesessionmanager, IPNExtension and jetsam around the failure would show whether nesessionmanager itself was killed. The extension's own ~32 MB stays well under typical limits, which would not show that.

    If you can paste the few log lines around stopTunnel (without IPs or keys), I am happy to look.

  23. Inhum commented on Oct 30, 2026

    @Inhum

    Thanks. I already included an anonymized log excerpt in issue #21355, but I'm reposting the relevant section here.

    These are the lines immediately preceding and following stopTunnel (local timestamps, IPs and node identifiers redacted):

    09:22:38  wg: [<peer-2>] - Received handshake initiation / Sending handshake response
    09:22:38  Accept: ICMPv4{<peer-2-ip>:0 > <this-device-ip>:0} 84
    09:22:38  Accept: ICMPv4{<this-device-ip>:0 > <peer-2-ip>:0} 84
    09:22:39  open-conn-track: timeout opening (TCP <this-device-ip>:57365 => ...)
    09:22:41  swiftNetMon: Path evaluated - unchanged
    09:22:43  stopTunnel: "unhandled reason, NEProviderStopReason.rawValue = 17"
    09:22:43  Persistency maintained for stop reason unhandled reason
    09:22:43  LinkChange: minor
    09:22:43  swiftNetMon: Path evaluated - unchanged
    09:22:43  network update from Swift: connected=true, expensive=false
    09:22:43  wg: Failed to write packets to TUN device: write /dev/tun: destination address required
    09:22:44  wg: Failed to write packets to TUN device: write /dev/tun: bad file descriptor
    09:22:45  wg: Failed to write packets to TUN device: write /dev/tun: bad file descriptor
    09:22:46  wg: Failed to write packets to TUN device: write /dev/tun: bad file descriptor
    09:22:48  wg: [<peer-2>] - Receiving keepalive packet
    

    In this excerpt, I don't see Receive func ReceiveIPv4 exiting with error: before stopTunnel.

    Interestingly, WireGuard handshakes and ICMP traffic were still working shortly before the tunnel was stopped. The network path was also reported as unchanged.

    The first visible anomaly is open-conn-track: timeout opening, approximately 4 seconds before stopTunnel.

    Does this sequence provide any clues about why iOS invokes stopTunnel with reason 17?

    The full bug report is available to Tailscale staff if further investigation is needed.

  24. luben93 commented on Oct 30, 2026

    @luben93

    Thanks, that helps. From your excerpt:

    • No Receive func ... exiting with error before stopTunnel, and the receive path was still alive: handshake initiation/response, ICMP accepted both ways, and a keepalive received at 09:22:48, after the stop. So I think this is a different problem from the receive-routine exit that wgengine/magicsock: rebind and retry when a UDP receive fails #22084 is about.
    • The interesting part is after the stop. Persistency maintained for stop reason unhandled reason suggests the app keeps the Go backend running when it does not recognise the reason. The TUN writes then fail with destination address required and then repeated bad file descriptor, while WireGuard keeps receiving. That looks like the backend running on a TUN fd that iOS has already closed. If the app still shows connected at that point, it would match the "connected but nothing passes until toggled" reports in this issue. That logic is in the iOS app layer, which is not in this repo, so I can't confirm it, but the repeated bad file descriptor seems worth pointing the Tailscale iOS team at.
    • Nothing in the excerpt explains reason 17. The open-conn-track: timeout opening four seconds earlier fits a stalled upload and may be a symptom rather than a cause.

    To look for the system side: on the iPhone, Settings, Privacy & Security, Analytics & Improvements, Analytics Data. Entries named JetsamEvent-*, nesessionmanager-* or IPNExtension-* with a timestamp around 09:22:43 would show whether the system process was killed or crashed.

  25. Inhum commented on Oct 30, 2026

    @Inhum

    Thanks, this clarifies the likely failure boundary.

    I understand that the log excerpt I originally posted shows the aftermath of an iOS-initiated tunnel teardown, rather than a WireGuard receive-side failure.

    I have a fresh reproduction from October 30, 2026, with a bug report generated immediately after the failure:

    BUG-c3190445f66eb600b1792e35c6f28f23337a7da2340b95fed7fed97f338304ca-20261030120529Z-10ddbe7519f8f951

    Could someone from the Tailscale iOS team inspect this report?

    In particular, I'd like to understand:

    1. What caused iOS to invoke stopTunnel with NEProviderStopReasonInternalError (17)?
    2. Was nesessionmanager killed, crashed, or restarted around that time?
    3. Is there any evidence of JETSAM_REASON_MEMORY_HIGHWATER affecting nesessionmanager?
    4. Is the Persistency maintained for stop reason unhandled reason behavior expected, or could the iOS client handle this stop reason differently?

    The IPNExtension crash report from 16:38 on the same day is a separate, earlier incident and should not be correlated with this reproduction.

  26. Inhum commented on Nov 3, 2026

    @Inhum

    I’ve added fresh kernel and provider-lifecycle evidence to #21355: #21355 (comment). It confirms nesessionmanager highwater kills and retained suspended providers.

  27. keithslater commented on Nov 13, 2026

    @keithslater

    Was there any solution? I have the same issue with Orca.

  28. zer0rg commented on Nov 13, 2026

    @zer0rg

    No, I changed to Herdr and now works well. I don't know why the hell this happens with Orca and other services

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-iPadOSOS-iosbug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions