Repository navigation
Remote server update fails on Linux when node-pty must compile (no linux-x64 prebuild; opaque error) #6012
Description
Activity
Confirmed another instance of this failure through
t3 triage, with a different native-build trigger and an exact actionable cause.Environment
- Server:
t3code.servicesystemd user background service - Server version:
t3@0.0.37-nightly.20260829.1219 - Target:
t3@0.0.38-nightly.20260831.1236 - Server host: Linux x64, Node
24.20.0 - Client: macOS nightly desktop app
0.0.38-nightly.20260831.1236 - Connection: remote through T3 Connect
Confirmed failure
Three remote-update attempts failed identically. The UI only reported:
Server update failed: Could not prepare t3@0.0.38-nightly.20260831.1236.The server trace recorded
PinnedRuntimeInstallErrorwith npm exit code 1. Matching npm debug logs showednode-pty@1.1.0falling back tonode-gyp rebuild, after which GCC failed with:fatal error: error writing to /tmp/cc*.s: Disk quota exceededThe actionable cause was a per-user quota on
/tmp, not globally exhausted disk space:/tmp: 15.7 GiB tmpfs mounted withusrquota- User-owned data in
/tmp: approximately 12.588 GiB, apparently at the per-user limit dfstill reported approximately 2.9 GiB globally available/homehad approximately 66 GiB free
This is easy to misdiagnose if the updater checks only filesystem-wide free space.
The current error path retains the npm exit code and stdout/stderr lengths in
PinnedRuntimeInstallError, then exposes the genericCould not prepare t3@…wrapper. The useful npm stderr never reaches the remote client.Suggested improvements
- Surface a bounded, sanitized installation diagnostic. Known failures could be classified as temporary-directory quota exceeded, filesystem out of space, missing compiler/toolchain, or permission denied. Raw npm output should remain private because it may contain paths, registry configuration, or credentials.
- Preflight the temporary directory before starting a native build, accounting for per-user quota rather than only
df/statfsfree space. - Consider running pinned-runtime installation with a private
TMPDIRunder the T3 state directory or another user-writable location with sufficient capacity. - For unclassified errors, retain the redacted fallback but direct the operator to the relevant server/npm log.
No workaround was applied during triage.
- Server:
Additional data point: same failure on linux-arm64 with
t3@0.0.40(stable) — so this isn't x64-only.- Host: Linux aarch64 (KVM VM, Ubuntu), Node
24.21.0 npx t3@latest service installsucceeded, butt3code.servicecrash-looped withNodePtyModuleLoadError: Failed to load node-pty for linux-arm64. The bundlednode-pty@1.1.0ships onlydarwin-*/win32-*prebuilds — nolinux-*at all.- Workaround that got the service green:
npx node-gyp rebuildinside~/.t3/runtime/versions/0.0.40/node_modules/node-pty, copybuild/Release/pty.node→prebuilds/linux-arm64/pty.node, restart the service. (This box had make/g++/python3; without a toolchain this path is a dead end, which is the core of this issue.) - Caveat: the fix lives in the per-version runtime dir, so every
service updateneeds it redone until node-pty ships Linux prebuilds (upstream Prebuilt binary for Linux ARM is actually x86-64 microsoft/node-pty#860 → PR UI Bugs when pinging files #857, 1.2.0 line).
+1 for shipping Linux prebuilds (or vendoring the binary) and for surfacing the node-gyp stderr instead of
Could not prepare t3@X.- Host: Linux aarch64 (KVM VM, Ubuntu), Node
Summary
Remote/boot-service self-update can fail on Linux while preparing a pinned
t3@<version>runtime becausenode-ptyhas nolinux-x64prebuild and the native rebuild fails. The desktop/UI only shows:Server update failed: Could not prepare t3@0.0.33.The underlying npm/node-gyp error is not surfaced, so operators have to dig through server npm debug logs and effect traces.
Environment
t3 service,T3CODE_HOMEpinned runtimes underruntime/versions/)0.0.320.0.33g++→ g++-13 (nog++-11package installed)What happens
0.0.33.ensurePinnedRuntimeInstalled→npm install --prefix <staging> --no-fund --no-audit t3@0.0.33.node-pty@1.1.0.node-ptyinstall script:node scripts/prebuild.js || node-gyp rebuild.prebuilds/linux-x64in the published package (only darwin/win32 prebuilds present).g++-11and exited 127.PinnedRuntimeInstallError→ UI:Could not prepare t3@0.0.33.Relevant packaging observation on
node-pty@1.1.0tarball contents: prebuilds exist fordarwin-arm64,darwin-x64,win32-arm64,win32-x64only.Expected
linux-x64prebuilds fornode-pty, or vendor a prebuilt binary for the supported Node ABI).Could not prepare t3@X.Workaround that unblocked us
Why this matters
Headless / remote Linux boxes are a first-class T3 deployment path (
t3 service, Tailscale, mobile/desktop remote control). Forcing an opaque native compile on every server version bump makes remote updates fragile and hard to support.Nice-to-haves
node-ptybuilds across staged versions on the same Node ABI to avoid rebuild thrash.Happy to provide redacted npm debug log excerpts if useful.