Skip to content

investigate(direct): macOS tailnet-IP listener stalls before peer TLS #341

Closed

Description

@abruption

Update — owner firewall approval, 2026-10-27

After the owner allowed Python.app's incoming connections, fresh fixtures on both Macs completed direct pairing and an authenticated probe with the original released v1.3.1 Homebrew runtime, the same tailnet bind addresses and per-machine ports, and no forwarder or alternate interpreter. This supports pending macOS Application Firewall consent as the blocker in the tested incident. See the before/after evidence.

Remaining tracked work is PR #342's readiness/diagnostic and operator-guidance improvement, targeted at v1.3.2. The PR did not restore these connections; user OS approval did. The issue remains open pending review/merge. The original report below preserves the pre-approval investigation and is not the latest root-cause conclusion.


Summary

A reported macOS Direct-pairing attempt reaches TCP connection establishment but times out at connectionFailure.stage=peer_tls when the receiver listens only on its own tailnet IPv4 address. A separate plain asyncio echo comparison reportedly stalls on the same address without session-peer or TLS, while loopback succeeds. Track the private-address listener compatibility, supported deployment guidance and readiness diagnostics without attributing the cause to session-peer, Tailscale or macOS prematurely.

This is a sanitized operator report plus a read-only source review. The filing maintainer has not inspected the private raw evidence or independently rerun the network, TLS or pairing experiments.

Reported environment

  • session-peer with [relay]: 1.3.1.
  • Two macOS arm64 machines, independent virtual environments and device identities.
  • Homebrew Python 3.14.9, OpenSSL 4.1.0, cryptography 50.0.2 and websockets 17.3, as reported by the operator.
  • Exact macOS builds, Tailscale versions and App Store/standalone/daemon variants were not supplied in this handoff. A Network Extension interaction is a hypothesis, not an established installation variant or root cause.
  • A separate Linux-to-Linux Direct path reportedly returned queued in both directions. This is submission evidence, not confirmation of consumption or ACK, and does not validate macOS.

Reported observations

  1. The macOS receiver runs under a launchAgent, binds only to its own tailnet IPv4 on port 3773, emits ready:true and appears as LISTEN. TCP connection checks succeed from both machines.
  2. The first client pairing returns ok:false, reason:timeout, connectionFailure.stage:peer_tls and retryAllowed:false. The client retains a pending peer; the receiver lists no corresponding peer. No new invitation, blind retry or identity reset was performed afterward. These asymmetric snapshots do not establish a safe retry/recovery operation.
  3. A TLS-only MemoryBIO comparison reportedly completes TLS 1.3 with ALPN session-peer-device-v1 in four iterations, using the current identity only in memory. That comparison does not establish that the live receiver accepted a socket, used identical scheduling/context, or completed pairing.
  4. On the live port, TCP connect and ClientHello transmission succeed, but no response is observed within three seconds. A receiver socket snapshot shows the listening FD without an accepted ESTABLISHED FD; a process sample is idle in kevent. Those are point-in-time observations, not proof that no accept ever occurred or that all blocking causes are excluded.
  5. A separate plain asyncio.start_server echo test with a same-process client reportedly succeeds on 127.0.0.1 under both KqueueSelector and SelectSelector, but times out after two seconds when bound to the machine's own tailnet IPv4 under either selector. This is the strongest reported project-independent counterexample; the exact probe source and timestamps have not been reviewed by the filing maintainer. A self-connection is not equivalent to a remote-peer connection.
  6. The operator reports the app firewall enabled with block-all disabled and the Python executable allowed for incoming connections. This metadata does not rule out every firewall, routing, extension or access-policy interaction. No firewall/ACL/SSH setting, wildcard bind, existing key or device state was changed for this report.

Independently confirmed source behavior

Reviewed published v1.3.1 source 5391365c4896cd7eefa1ba2bbe20b9bed2075d8c:

  • Receiver.listen delegates the supplied host/port to asyncio.start_server; it does not implement a macOS/Tailscale listener adapter.
  • device serve readiness emits ready:true after listener construction. It is startup/listener evidence, not a successful remote accept, peer TLS, authenticated probe or pairing round trip. relayReadyConfirmed:false is separately explicit when this message is emitted.
  • open_channel opens the Direct TCP stream before running the MemoryBIO TLS handshake, then classifies a handshake timeout as peer_tls/timeout. That stage identifies where progress stopped, not which component caused it.
  • Existing connection diagnostics and retry boundaries do not authorize automatically retrying peer-TLS timeouts or replacing uncertain state.

Tailscale's official macOS variant documentation distinguishes App Store Network Extension, standalone System Extension and open-source daemon implementations. This supports recording the exact variant in a reproduction matrix; the documentation does not establish this failure's cause or a validated workaround.

Investigation and acceptance

  • Obtain a sanitized, version-pinned plain-TCP reproducer and distinguish same-process/self-tailnet tests from remote-machine connections, both directions, on each actually available macOS/Tailscale variant. Record connect, accept-callback entry, received bytes and timeout separately. Do not claim new experiments from this issue registration.
  • Establish which explicit private-only listener/forwarding patterns actually work on macOS. Any change to listener exposure, forwarding, firewall, access policy, service configuration or Tailscale installation needs its own operator-approved test plan. Do not silently change the bind to 0.0.0.0, enroll trust, weaken certificate/ALPN validation or extend deadlines to conceal an unobserved accept.
  • Clarify startup/listener readiness versus peer TLS, authenticated reachability and paired/native-target readiness in diagnostics/help/docs. Consider bounded metadata-only stage evidence; preserve existing JSON/exit compatibility and avoid addresses, keys, credentials, exception text or message bodies in routine diagnostics.
  • If the project-independent reproducer isolates a Tailscale/macOS problem, link a separately reviewed upstream report with the exact variant/version and minimal probe. If it instead isolates a session-peer defect, implement and regression-test that narrower cause. Do not conflate the possibilities.
  • Preserve the original pending state and no-automatic-retry semantics until an explicit recovery plan establishes what happened. No identity/database reset, new invitation, pairing retry or native send is authorized by filing this issue.

Tracking scope

Priority P2 investigation; no release milestone is promised. The startup-readiness presentation is a session-peer documentation/diagnostic concern even if the underlying socket behavior is external. This is distinct from #161's historical authenticated Relay-route loss and #233's pre-authentication connection-cap issue; neither is reopened or declared resolved by this report.

Personal addresses, home paths, device fingerprints, native session IDs, invitations, private keys and raw private logs are intentionally excluded. No code, service, release or state change was performed during registration.

Activity

  1. added
    documentation
    question
    priority:P2
    on Oct 27, 2026
  2. abruption commented on Oct 27, 2026

    @abruption
    OwnerAuthor

    Owner-authorized independent two-Mac follow-up — 2026-10-27

    The owner subsequently authorized isolated live pairing reproduction and a fix PR. Existing production identities/pending state, services, firewall/access rules and Tailscale settings were preserved. Each experiment used fresh test identities and a separate non-native policy; failures were not retried using their uncertain state. Wildcard TLS listeners were separately authorized and stopped after at most 20 seconds.

    The reported timeout was independently reproduced with released v1.3.1 on macOS 27.0.1 arm64: mini Network Extension 1.104.1 and MacBook tailscaled 1.104.2, Homebrew Python 3.14.9/OpenSSL 4.1.0, cryptography 50.0.2 and websockets 17.3. Both directions failed at peer_tls/timeout with client pending state. Explicit wildcard listeners also failed, so they are not an established workaround. Plain asyncio Kqueue/Select and raw threaded-socket controls reproduced the accept failure outside session-peer.

    Interpreter controls narrow, but do not establish, causality: the MacBook's python.org Python 3.13.7 passed a self-tailnet control and actual cross-Mac pairing; the mini's system Python passed its applicable plain-TCP control, while uv 3.13.7/Homebrew 3.15.1 failed. Installed Homebrew Python.app signatures failed strict verification; correcting a new mini-only test copy's ad-hoc signature did not fix its TCP test. Neither a minor-version root cause nor a signature-only fix is established.

    Two distinct positive configurations completed actual pairing and authenticated probe, first on released v1.3.1 and then on the candidate: mini client → MacBook python.org receiver on its tailnet address; and the reverse direction through an explicitly selected private TCP byte forwarder into the mini's loopback TLS receiver. The latter preserves opaque TLS but is a forwarded topology, not successful native Homebrew tailnet listening. These results do not promote a general platform/production-forwarding guarantee.

    PR #342 addresses the confirmed startup/diagnostic gap. Its final tested code has per-receiver bounded Direct accept/TLS records and a once-at-normal-close summary. In a new failing native mini fixture the summary recorded accepted=0, tlsCompleted=0, tlsFailed=0; each successful control recorded 3/3/0. All final test receivers closed normally, and native invocations were zero. ready:true is preserved with additive directReadyConfirmed:false; no bind, TLS deadline, authentication, state or automatic-retry behavior changes.

    Pinned experiment record and stateless TCP scaffold distinguish every released/candidate and negative-control result without personal addresses, state paths, fingerprints, native IDs, invitations, keys or raw private logs. Relay tests: 354 pass; focused: 85 pass; documentation: 65 pass. Pre-PR independent CLI and four-language translation reviews are recorded in the PR. PR CI and automatic review are separate pending gates.

    This issue remains open for the underlying inbound-listener behavior and any justified upstream escalation. The PR is an observability/readiness correction, not a claim that the original native listener has been repaired. No merge or release was performed.

  3. abruption commented on Oct 27, 2026

    @abruption
    OwnerAuthor

    Current-head verification

    Head 37e558bf8c268e218ff0898f821c3ccf98c57473: all 28 checks pass, including CI run 40479370317. The latest Codex code re-review completed without findings (receipt); the original experimental-probe finding is fixed and its thread resolved. The initial security review completed without findings on beb467b; production receiver code is identical in the follow-up. A new security verdict for the follow-up head is not asserted.

    The automatic-review timeout defect was reproduced on actual Python 3.9.6 before the fix, then passed as a stalled-loopback regression on Python 3.9 and 3.13. Final local production-code checks remain 354 Relay tests and 65 documentation tests, plus generator/diff/scaffold checks. The added core regression is separate from those counts.

    All owned live-test servers exited normally. After retaining sanitized observations, the 11 owned fixture-state directories on each Mac (test keys, invitations and pending/paired test records), temporary python.org test environment and copied signature-control bundle were removed. The original stage5d identities/pending state, installed runtimes, service and network settings were preserved. The PR worktree remains clean for review.

    The earlier #341 live evidence comment and current experiment record distinguish the failing native listener and successful controlled topologies. #341 stays open; no merge or publication has been performed.

  4. added this to the v1.3.2 milestone on Oct 27, 2026
  5. abruption commented on Oct 27, 2026

    @abruption
    OwnerAuthor

    Firewall approval follow-up — 2026-10-27

    The owner observed the macOS incoming-connection prompt for Python.app and reported allowing it. Before any new receiver-code installation, the same Homebrew Python 3.14.9 raw-TCP controls then passed on both Macs. Fresh pairing fixtures repeated the same tailnet bind addresses and per-machine ports as the earlier released-v1.3.1 failures.

    Released-v1.3.1 receiver after approval Result
    Mac mini Pairing exit 0; client/server paired; authenticated probe successful; receiver exited normally; native calls 0.
    MacBook Pairing exit 0; client/server paired; authenticated probe successful; receiver exited normally; native calls 0.

    Both tests used the existing Homebrew Python 3.14.9/OpenSSL 4.1.0 environments with session-peer 1.3.1, cryptography 50.0.2 and websockets 17.3. No python.org runtime, TCP forwarder, wildcard bind or candidate source override was used. Loaded app.py and cli.py SHA-256 values on both Macs matched the published v1.3.1 tag. These released-runtime trials have no new diagnostic counters; the candidate's earlier zero/3-3-0 summaries must not be substituted for them.

    This before/after comparison supports pending macOS Application Firewall approval as the blocker in this tested incident. Apple's documentation explains that incoming attempts are denied until the alert is answered. The firewall stayed enabled. The owner reported approval; this report does not claim independent inspection of each OS approval entry or a universal explanation for other macOS/Tailscale failures.

    PR #342 remains useful for truthful startup/readiness and accept/TLS diagnostics, but it did not restore these connections: the original released runtime worked after the owner's OS permission action. Earlier negative, signature and forwarded-topology results remain historical observations. No upstream Tailscale/CPython defect is established by this case.

    Existing user pending state was not retried, reset or replaced. Each new experiment used disposable test identities, no native message was sent, and the receiver lifetime was 20 seconds. The updated four-language guidance and experiment record are being added to the existing PR. #341 remains open pending that diagnostic/documentation work; milestone v1.3.2 is unchanged. No merge or publication is authorized or performed by this follow-up.

  6. abruption commented on Oct 27, 2026

    @abruption
    OwnerAuthor

    Firewall follow-up verified

    Documentation-only head 6613f806acdaf53edad3f271ad777c94725e7bae passes all 28 checks, including CI run 40504142742. Its latest Codex code re-review completed without findings. Existing review threads remain resolved; production receiver source is unchanged from the earlier reviewed candidate.

    The owner-approved Python.app firewall prompt was followed by successful two-way direct pairing and authenticated probes on the original released Homebrew runtime and the same bind addresses/ports, with no proxy or alternative interpreter. Both global firewalls remained enabled. This confirms recovery in the tested setup and supports pending app-level firewall approval as the incident's blocker; it is not evidence that the diagnostic PR repaired transport or that all macOS failures share this cause.

    After preserving metadata, the two owned fixture states per Mac, their test keys/invitations and the remote temporary probe directory were removed. All 20-second test receivers exited normally with zero native invocations. Original user pending state and identities were not retried or reset; no operational mesh pairing was silently completed. The owner's OS permission is retained.

    The issue and PR remain open in v1.3.2 for normal review/merge. No merge, release or global runtime installation was performed.

  7. abruption commented on Oct 28, 2026

    @abruption
    OwnerAuthor

    Closing the tracked diagnostic/operator-guidance work after normal merge of #342 and verified publication of v1.3.2, source f5e7c49554ff02771990a151e00b52f2abf3df0a.

    The investigation's before/after evidence supports pending Python.app Application Firewall consent as the blocker in the tested two-Mac incident: pairing and authenticated probes recovered on the original released v1.3.1 with the same per-machine private bind/port after owner approval. The diagnostic code did not restore transport, and this does not establish a universal macOS/Tailscale diagnosis. Original pending state was preserved; no automatic retry or identity reset was added.

    v1.3.2 preserves ready:true, adds directReadyConfirmed:false, and includes opt-in bounded metadata-only accepted/TLS counters and normal-close summary, regression coverage and operator guidance. Final main CI, CodeQL, seven-asset attestations/checksums, PyPI publication and independent fresh wheel/sdist installs passed. Applying optional receiver diagnostics still needs its own environment update and explicit restart; no operational rollout or new native-agent acceptance was performed by this release.

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

    documentationpriority:P2question

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions