Repository navigation
[Bug]: T3 Connect runs any cloudflared on PATH without a version check; Homebrew 2023.8.2 crash-loops on --output #13964
Description
Activity
Triage
Confirmed on current
main. This is a real bug, and it is not a duplicate of #7447 or #8844.RelayClient.resolvetreats any executable namedcloudflaredonPATHas available, and it labels that binaryversion: CLOUDFLARED_VERSION(2026.5.2) without running it. The desktop link flow andt3 connectboth skip the managed install when status isavailable, andinstallreturns early in that case. The connector then spawns whatever was resolved:tunnel --no-autoupdate --loglevel info --output default run--outputexists in cloudflared 2025.6.1 and later. Homebrew2023.8.2exits immediately withflag provided but not defined: -output. The supervisor backoff matches the pid cadence in the report: immediate, then 1s, 2s, 4s, 8s, 16s, 32s, then 60s. Placing the pinned binary at~/.t3/tools/cloudflared/2026.5.2/<platform>/cloudflaredworks because the managed path is checked beforePATH, and the next reconcile picks it up without an app restart.brew upgrade cloudflaredalso works until the nextCLOUDFLARED_VERSIONbump, which changes the managed directory and falls through toPATHagain.--output defaultwas added in #9386 so the connector keeps seeing classic text (Registered tunnel connection,ERR/WRN/FTL/PNC, and the tunnel-rejection lines). That flag is right for the pinned binary. It is not safe to pass to an arbitraryPATHbinary. The same hole exists forT3CODE_CLOUDFLARED_PATH: an override is accepted with no version check and is also reported as2026.5.2.The phone's
endpoint_request_failedis the relay failing to mint against a tunnel that never registered. The host reports the connector asrunningas soon as spawn succeeds, andIncorrect Usageis logged at debug because it has noERR/WRN/FTL/PNCtoken. That status gap is the same class of problem as #7447, not this bug. #8844 is the same phone error on Windows, with no confirmedPATHbinary.upstream_unavailablefromrecoverManagedCloudTunnelis the relay's provisioning error, throttled to once every two minutes. It follows from the connector never staying up.Fix: a
PATHbinary must not count as available while the managed copy is missing. Install the pinned build, and keepPATHonly as a fallback when this platform has no managed asset. If aPATHorT3CODE_CLOUDFLARED_PATHbinary is still used, runcloudflared version(not--version; the pinned Windows build rejects--version) and skip anything older than 2025.6.1. Report that version, notCLOUDFLARED_VERSION.The workaround in the report is the right one.
- addedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.via-triageFiled through npx t3 triageFiled through npx t3 triage
on Sep 27, 2026 Confirmed on T3 Code (Nightly) 0.0.46-nightly.20261004.2648, macOS arm64 — same crash loop with Homebrew cloudflared 2025.5.0 on PATH. Symptoms identical: spawned with
--output default, exits onflag provided but not defined: -output, restarts every ~60s with zero output logged, iOS app showsRelay could not reach the environment endpointwhile the Connections UI reports the environment as available.Workaround verified: manually downloading the pinned 2026.5.2 darwin-arm64 release (sha256
ba94054c9fd4297645093d59d51442e5e546d07bb0516120e694a13d5b216d38) into~/.t3/tools/cloudflared/2026.5.2/darwin-arm64/cloudflaredmakes resolution prefer the managed binary; tunnel registered within seconds and the phone connects.One more observation supporting a fix: since the PATH fallback reports
version: CLOUDFLARED_VERSIONwithout running it, T3 never even attempts to download the managed copy — the presence of anycloudflaredon PATH permanently suppresses installation of a working one.Confirmed on stable 0.0.45 (desktop, macOS arm64) with Homebrew
cloudflared2025.2.0 on PATH. Same crash loop:flag provided but not defined: -output, respawn at 1s → 60s backoff, never registers; other devices showendpoint_request_failed.Workaround:
brew upgrade cloudflared(2026.10.0 works). The server picked up the new binary on the next retry, no restart needed.Reacted by Moosa ShahThank you @notgiorgi and @JorgeMenaDev! This identified the problem on my Mac too: stable desktop 0.0.45 on macOS arm64, with Homebrew cloudflared 2025.2.1 rejecting
--outputand the phone showingendpoint_request_failed.I used the original post's workaround and installed the checksum-verified pinned 2026.5.2 binary under
~/.t3/tools/cloudflared/2026.5.2/darwin-arm64/, leaving my other Homebrew tunnels unchanged. T3 picked it up automatically on the next retry, and its readiness endpoint now reports HTTP 200 with 4 active connections. No app restart was needed. Thanks for documenting this!I've been having this issue for a while and thought it was because of getting a new phone
Before submitting
Area
packages/contracts or packages/shared
Steps to reproduce
cloudflaredon PATH. Mine was2023.8.2, installed in 2023 and never upgraded.~/.t3/tools/cloudflared/2026.5.2/darwin-arm64/cloudflaredabsent).Expected behavior
T3 runs a
cloudflaredthat supports the flags it passes, either its pinned managed copy or a PATH binary it has checked. If the tunnel can't stay up, the host and the phone say so.Actual behavior
The phone shows
Failed to connect. Reconnecting... Reason: Relay could not reach the environment endpoint (endpoint_request_failed)forever. My other Mac, on the same account, connects fine.The relay error hides the real problem.
RelayClient.resolvechecks the override env var, then the managed path, then anycloudflaredon PATH. It doesn't check the PATH binary's version, and it reportsversion: CLOUDFLARED_VERSIONfor it anyway:t3code/packages/shared/src/relayClient.ts
Lines 224 to 262 in de251fc
Because a PATH binary counts as available, the managed copy never gets installed. The server then spawns it with
--output default:t3code/apps/server/src/cloud/ManagedEndpointRuntime.ts
Line 315 in de251fc
cloudflared 2023.8.2doesn't have that flag, so it exits right away:The supervisor restarts it with backoff (1, 2, 4, 8, 16, 32 s, then every 60 s) and nothing registers.
recoverManagedCloudTunnelgetsRelay internal error: upstream_unavailableevery 2 minutes. None of this reaches the UI. I found it by readingserver.trace.ndjsonand running the binary by hand.Impact
Blocks work completely
Version or commit
T3 Code (Nightly) 0.0.43-nightly.20260926.2282; code refs at main @ de251fc
Environment
macOS 27.0 (Darwin 27.0.0) arm64, MacBook Pro. Homebrew cloudflared 2023.8.2 on PATH. T3 Connect iOS app.
Logs or stack traces
Relay trace ID from the phone:
00dd36630a221ea911bd41bf682473b5.Workaround
Put T3's pinned binary at the managed path.
resolvechecks it before PATH, and the server picks it up on its next restart attempt, with no app restart:brew upgrade cloudflaredalso works. It breaks again whenever T3 bumpsCLOUDFLARED_VERSION, though, because the managed path changes and T3 falls back to PATH.Possible fixes
cloudflared, and keep PATH only as a fallback.cloudflared --versionon a PATH candidate and skip it below a minimum version. Report the real version, notCLOUDFLARED_VERSION.endpoint_request_faileddoesn't point to the host.Related but different causes: #7447 (tunnel counted as running while unreachable), #8844 (same phone error on Windows, maybe the same PATH issue).