Skip to content

[Bug]: T3 Connect native clients time out after host Mac restart despite healthy relay tunnel #5744

Open

Description

@adameastman1

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

Steps to reproduce

  1. Configure T3 Connect on a Mac mini host and connect successfully from the T3 Code native apps on both macOS and iOS.
  2. Restart the Mac mini.
  3. Relaunch T3 Code on the Mac mini.
  4. Attempt to reconnect from the MacBook Air or iPhone native T3 Code apps.
  5. Both clients enter a reconnect loop and time out reaching the T3 Connect environment endpoint.

This worked normally before the Mac mini restart.

I also completely reset T3 Connect during troubleshooting:

  1. Fully stopped the T3 server and its managed cloudflared process.
  2. Ran npx t3 connect unlink.
  3. Confirmed:
    • Exposure: disabled
    • Environment link: not provisioned
    • Relay: not provisioned
  4. Ran npx t3 connect link.
  5. Started a fresh npx t3 serve instance.
  6. T3 created a new managed tunnel ID and successfully registered all four Cloudflare QUIC connections.
  7. The macOS and iOS native clients still failed in the same way.

The iPhone was also tested on cellular with Wi-Fi and Tailscale disabled, with the same result.

Expected behavior

Expected behavior

After restarting the host Mac and relaunching T3 Code, T3 Connect should restore the remote environment and previously connected native macOS/iOS clients should reconnect.

If the T3 Connect environment is unlinked and relinked successfully and the managed relay tunnel establishes successfully, remote clients should be able to reach the environment again.

Actual behavior

Actual behavior

Both the macOS and iOS native clients repeatedly show:

Failed to connect. Reconnecting... Reason: Remote environment endpoint https://prod-dc8967a9e60a2bb1.t3coderelay.com/.well-known/t3/environment timed out after 10000ms.

The failure began immediately after restarting the Mac mini.

The host itself appears healthy:

  • Local T3 server responds normally.
  • T3 Connect authorization/linking succeeds.
  • A fresh managed Cloudflare tunnel is created.
  • All four QUIC tunnel connections successfully register.
  • The issue occurs from multiple client devices and also from iPhone cellular, so it does not appear to be specific to the LAN or Tailscale.

Running the locally served T3 web interface works; the failure is with native clients connecting through T3 Connect.

Impact

Blocks work completely

Version or commit

t3@0.0.32

Environment

macOS 26.5.1

Logs or stack traces

After refining
T3 Connect
Exposure: enabled
Authorization: stored credential
Environment link: provisioned
Relay: https://relay.t3.codes
Relay client: available via PATH
Path: /opt/homebrew/bin/cloudflared
Version: 2026.5.2

Local back end confirmed healthy

$ curl -I http://127.0.0.1:3773/

HTTP/1.1 200 OK


After completely unlinking 

T3 Connect is disabled locally.
Revoked the relay-side environment record.

T3 Connect
Exposure: disabled
Authorization: stored credential
Environment link: not provisioned
Relay: not provisioned
Publish agent activity: disabled

After linking again and starting the server, T3 successfully created a fresh managed tunnel:

Relay client process started; waiting for tunnel connection

T3 Connect desired link reconciled on startup

Relay client tunnel connection registered
connIndex=0
protocol=quic

Relay client tunnel connection registered
connIndex=1
protocol=quic

Relay client tunnel connection registered
connIndex=2
protocol=quic

Relay client tunnel connection registered
connIndex=3
protocol=quic


During earlier troubleshooting, one shutdown produced:
Failed to release the managed tunnel on shutdown; the next link reuses it

After fully terminating the T3 server and its managed cloudflared child and repeating the unlink/link process, a later shutdown correctly produced:
Released the managed tunnel on shutdown


A new managed tunnel was then created and all four QUIC connections registered successfully, but the native clients continued to time out at:
/.well-known/t3/environment

This may be related to #5031, but that issue describes mobile relay failures following a nightly update. In this case, the trigger was specifically restarting the host Mac, and both the macOS and iOS native clients are affected.

Screenshots, recordings, or supporting files

No response

Workaround

No response

Activity

  1. added
    bug
    needs-triage
    on Aug 8, 2026
  2. maria-rcks commented on Oct 9, 2026

    @maria-rcks
    Collaborator

    Note

    This is an automated response from a bot acting on maria's behalf.
    This issue has had no activity since 2026-08-08.
    Is it still relevant on the current version? If so, your version and OS would help.

  3. added
    needs more info
    and removed
    needs more info
    on Oct 22, 2026
  4. vickylid commented on Nov 22, 2026

    @vickylid

    Still relevant for me, and I think I found the cause plus a workaround.

    Versions: desktop/server 0.1.11 (macOS, Apple Silicon), Android app 2.3.0 (Android 14 / HyperOS), managed cloudflared 2026.10.4.

    Symptom

    Same as described here: the managed tunnel shows all connections registered over QUIC and looks healthy, but the mobile client gets stuck on "Connecting…" when off the LAN (on cellular). Restarting the mobile app or rebooting the phone doesn't help; restarting T3 Code on the host (so it spawns a new cloudflared) fixes it for a while.

    What the logs show

    • Short HTTP requests through the relay keep working: the phone successfully hits /.well-known/t3/environment, /oauth/token and /api/auth/session.
    • The WebSocket rarely gets established, and when it does it dies after ~60 s (/ws 101, duration ~61 s), then the client loops back to "Connecting…".
    • At the same time, cloudflared logs (relay-client.ndjson):
      WRN Serve tunnel error error="datagram manager error: timeout: no recent network activity" connIndex=1
      WRN Connection terminated error="datagram manager error: timeout: no recent network activity" connIndex=1
      
    • In another episode the host's own reachability check (ConnectReachability.probeEndpoint against the public relay URL) timed out every 5 minutes for ~30 min, while cloudflared still reported no disconnect. Nothing restarted the tunnel until I restarted the app manually.

    So it looks like QUIC (UDP) between the host and Cloudflare gets degraded on some networks: short requests survive, but long-lived WebSockets don't, and cloudflared doesn't notice.

    Workaround

    Force cloudflared to use HTTP/2 (TCP) by creating ~/.cloudflared/config.yml (cloudflared reads it on start, the managed process picks it up):

    protocol: http2

    After the managed cloudflared respawned with protocol=http2, the relay connection from the phone has been stable.

    Suggestions

    1. The server already detects this state (the reachability probe against its own relay URL fails repeatedly). After N consecutive failures it could restart the managed cloudflared, and/or fall back to --protocol http2.
    2. Maybe expose the tunnel protocol as a setting (auto / quic / http2) for networks where UDP is unreliable.

    Happy to provide more logs if useful.

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

    bugneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions