Repository navigation
[Bug]: Windows T3 Connect relay client install fails with EBUSY while staging cloudflared #16945
Description
Activity
- addedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.Issue needs maintainer review and initial categorization.
on Oct 7, 2026 Note
Grok responding on behalf of Julius.
Thanks for the ProcMon capture. Triage: confirmed on current
main. The installer renames the freshly executedcloudflared.exeonce, right after the validation run exits, and nothing retries a transient Windows lock.Mechanism (
packages/shared/src/relayClient.tson main):- The download is checksummed in memory, then written to
.install-XXXX\cloudflared.exeinside a scoped temp directory (L397-L409). - That same file is run as
cloudflared versionto validate it (L422-L425).runCommandwaits only for the exit code (L263-L278). - The very next step renames that executable to
cloudflared.exe.<uuid>.tmp, with a singlefileSystem.renamecall. Any failure becomeswrite_failed/ "Could not stage the relay client." (L427-L431). The second rename into place has the same single-shot shape (L432-L437).
So any process still holding the just-run image without delete sharing makes the install fail outright. That matches the
SHARING VIOLATIONon T3's delete-access open in your log. Your log doesn't show which process held the handle; Defender (MsMpEng.exe) mapping the file just before is a plausible candidate, but it isn't proven. The only retry loop in this installer is for the install lock file (L328-L351), not for the renames. The repo already handles this Windows behaviour elsewhere: the CLI archive smoke test retries cleanup because "Windows can keep t3.exe locked (EBUSY) for a moment" after it exits (scripts/smoke-cli-archive.tsL78-L88).This code is unchanged in behaviour since 0.0.45. The only diffs between
v0.0.45andmainin this file are Effect import renames and a lint-onlycatchTagschange.Fix direction
- Retry both renames on Windows when they fail with
EBUSY/EPERM/EACCES, using a short bounded backoff. The smoke script'sEffect.retrywithSchedule.spacedis the existing pattern. - Or avoid renaming an image that just ran: validate a separate copy, and stage and activate the copy that was never executed.
Workaround
t3 connectskips the installer whenever a file already exists at the managed path (resolve, L236-L243;apps/server/src/cli/connect.tsL247-L249). Until this is fixed, you can install the binary by hand:- Download
cloudflared-windows-amd64.exe2026.5.2. - Check that its SHA-256 is
20b9638f685333d623798e733effbad2487093f15ba592f6c7752360ff3b7ab7(the pinned checksum). - Save it as
%USERPROFILE%\.t3\tools\cloudflared\2026.5.2\win32-x64\cloudflared.exe(that's under the default T3 home; use your own base directory instead if you pass--base-dir). - Rerun
npx t3 connect.
You can also point
T3CODE_CLOUDFLARED_PATHat that file.Related
- fix(shared): validate cloudflared with the version subcommand #9880 (merged) switched the validation run to
cloudflared version. That is the run right before the failing rename, and it was already in 0.0.45. - [Bug]: T3 Connect relay client cannot be installed on Windows ARM64 (no win32-arm64 cloudflared asset) #14836, fix(shared): install the relay client on Windows ARM64 #16715 and fix(shared): install the T3 Connect relay client on Windows ARM64 #14840 add a
win32-arm64asset mapping and don't touch staging. - fix(connect): Restore the pinned relay client before connecting #16607 (open) restructures these two renames but adds no retry, so a fix here should coordinate with it.
- [Bug]: T3 Connect managed endpoint provisioning fails for Windows environment #13681 and [Bug]: T3 Connect managed endpoint provisioning fails repeatedly on Windows 11 #14070 were relay-side
managed_endpoint_provisioning_failederrors, not install failures. They aren't related.
- The download is checksummed in memory, then written to
- addedvia-triageFiled through npx t3 triageFiled through npx t3 triageand removedneeds-triageIssue needs maintainer review and initial categorization.Issue needs maintainer review and initial categorization.
on Oct 7, 2026 Reproduced on Windows 11 Pro with T3 Code (Nightly) desktop
0.0.46-nightly.20261008.2801, using the Settings → Connections toggle rather thannpx t3 connect. The managed relay client is2026.5.2.- 11 consecutive attempts, from 01:48 to 03:07 local time, each left a complete
.install-*\cloudflared.exe(same SHA-256, valid Cloudflare Authenticode signature). Each attempt then failed withEBUSY: resource busy or locked, rename '...\.install-r1b3um\cloudflared.exe' -> '...\win32-x64\cloudflared.exe.<uuid>.tmp'. - Windows Defender real-time protection is the only antivirus. Controlled folder access is off.
- Manual recovery: Moving one staged copy to
win32-x64\cloudflared.exeworks.t3 connect statusthen reportsRelay client: available via managed install. - Preventing a repeat: Adding a Defender exclusion for
%USERPROFILE%\.t3\toolsstops it from recurring.
The Codex CLI 0.161.0 daemon installer failed the same way on this machine. Copying a freshly written binary into its staging folder returned "Access is denied", which also points to Defender holding a transient lock. A short retry on the rename, as proposed above, would cover this case.
- 11 consecutive attempts, from 01:48 to 03:07 local time, each left a complete
Thanks, this fills two gaps in the report. Defender real-time protection is the lock holder, since an exclusion for
%USERPROFILE%\.t3\toolsstops the failure, and the desktop Settings → Connections toggle hits the same staging rename asnpx t3 connect.#16998 covers this case: on Windows it retries both renames on
EBUSY/EPERM/EACCESfor about 10 seconds before reporting the existing error. Its verification held the lock with a PowerShell script, so it has not been run against Defender. A run of the fix on a Defender-only machine would show whether that window is long enough. When a lock outlasts it, the install still fails with the same message and leaves the staged copy under.install-*, as it does today.Written by Claude Fable 5.1 on behalf of ScottN-PV.
- added a commit that references this issue
on Oct 8, 2026
Before submitting
Area
packages/contracts or packages/shared
Steps to reproduce
npx t3 connect.This failed on three separate Windows 11 machines, including personal and corporate networks.
Expected behavior
The relay client installs and T3 Connect setup completes.
Actual behavior
Activation fails with
RelayClientInstallError: Could not stage the relay client.The underlying error isEBUSYwhile renaming the temporarycloudflared.exeto a staging filename. Renaming the file manually later succeeds.Impact
Major degradation or frequent failure
Version or commit
T3 CLI
0.0.45; managed relay client2026.5.2Environment
Windows 11, three separate machines.
Logs or stack traces
Screenshots, recordings, or supporting files
No response
Workaround
No known workaround. A later manual rename succeeds, but rerunning
npx t3 connectfails again.