Repository navigation
[Bug]: WSL-only mode stuck on "Connecting to WSL..." forever when the WSL backend keeps crashing on startup #14393
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 Sep 30, 2026 Triage
Confirmed on current
main. In wsl-only mode, the "Connecting to WSL…" splash stays up until the primary backend reports ready, and it has no controls, so a backend that never becomes ready leaves you no way back to Settings. Preflight failures are already capped (MAX_PREFLIGHT_FAILURE_ATTEMPTS), andhandlePrimaryPreflightFailurefalls back to Windows. A backend that passes preflight and then dies isn't capped:scheduleRestartonly limits the delay (500ms, doubling, up to 10s), never the number of attempts, which matches the ~10s restart loop. A process that stays up but never answers is the other loop:probeReadinesskeeps retrying on a 60s budget for as long as the child is alive.The two crashes in your log explain why preflight passes and the process still exits:
-
The staged runtime's readiness check runs
t3 --versionwith stderr discarded (runtime_entry_runs). Any dynamic-linker failure, including the missinglibatomic.so.1on Ubuntu 22.04, gets reported as "WSL runtime archive does not contain a working t3 executable", and the install falls through to the mounted server tree. That fitslibatomic1making./t3 --versionwork. The archive can be intact while the binary still can't run on that distro, and the linker error never reachesdesktop.trace.ndjson. -
The mounted tree is the Windows server sidecar (
server.asarextracted underwsl-server-tree), installed for win32, soffi-rs's optional@yuuang/ffi-rs-linux-x64-gnubinding isn't in it. Server startuprequires@ff-labs/fff-nodefromWorkspaceSearchIndex.ts, which loadsffi-rs, and Linux Node throwsMODULE_NOT_FOUND. The mounted-tree preflight onlyrequiresnode-pty(whose Linux prebuild ships inside that package), so preflight reports ready and the exit is treated as an unexpected crash rather than a preflight failure. The code comment saying this fallback is recoverable doesn't hold for this tree.
This isn't a duplicate of open issue #3709 (login-shell Node older than 22.16 exits 0 before binding), closed issue #4535 (slow
/mnt/cboot; the readiness probe now retries while the process is alive), closed issue #5967 (same splash, but no logs), or open issue #13738 (dual mode with a healthy backend that Windows can't reach at the NAT address). Those can show the same splash, but the lockout here comes from an uncapped failure after preflight in wsl-only mode.An in-memory Windows fallback after repeated startup failures is the right recovery. It has the same shape as the non-fatal preflight path (
applyWslWindowsFallbackInMemory), sowslOnlystays set for the next launch. It needs to cover both loops: exits before ready, and a live process whose readiness probes keep failing (the iptables case). That fallback won't make the staged runtime run withoutlibatomic.so.1, and it won't make the Windows sidecar loadffi-rson Linux. Those are separate fixes.-
- addedacceptedfeature request acceptedfeature request acceptedvia-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 Sep 30, 2026 Same crash loop here on T3 Code 0.0.46-nightly.20261007.2761, Windows 11, WSL Ubuntu 22.04.1, Node v24.21.0 via nvm.
libatomic1was not installed.One more data point for the fallback path:
ffi-rsis not the only native package with missing Linux binaries inwsl-server-tree. The tree only ships the win32 variants of:@yuuang/ffi-rs(missing@yuuang/ffi-rs-linux-x64-gnu@1.3.7)@napi-rs/keyring(missing@napi-rs/keyring-linux-x64-gnu@1.3.0)@ff-labs/fff-node(missing@ff-labs/fff-bin-linux-x64-gnu@0.9.4)
node-ptyis fine since it bundles prebuilds for all platforms.After unpacking those three into
wsl-server-tree/<version>/node_modules, all modules load in WSL Node and the backend starts. So a fix for the fallback tree needs to include all three Linux packages (and probably the-muslvariants for Alpine distros), not justffi-rs.Same symptom here on T3 Code 0.0.45 (Windows 11, WSL 2.6.1, Debian 12 bookworm). Root cause was a missing
libatomic1package in the distro. Posting the full chain in case it helps others.Symptoms
- Stuck on "Connecting to WSL…" forever
server-child.logloops on:Error: Cannot find module '@yuuang/ffi-rs-linux-x64-gnu'(require stack inwsl-server-tree/0.0.45/node_modules/ffi-rs/index.js)desktop.trace.ndjson:Could not stage the WSL runtime; launching from the mounted server tree instead.with reasonWSL runtime installation failed (exit 1): WSL runtime archive does not contain a working t3 executable
What's actually happening
- The staged runtime binary
~/.t3/wsl-runtime/sha256-…/t3is dynamically linked againstlibatomic.so.1(visible inldd). The default Debian 12 WSL image doesn't includelibatomic1, so the binary can't start and staging fails. - T3 then falls back to the mounted Windows server tree (
%USERPROFILE%\.t3\userdata\wsl-server-tree\<version>), which only contains the win32 native bindings (@yuuang/ffi-rs-win32-*), so the backend crashes on the missing Linux binding and gets restarted in a loop.
The Node version was fine here (v24.21.0 was selected), so this is not the #3611 problem.
Fix
sudo apt-get update sudo apt-get install -y libatomic1
Then quit T3 Code completely (including the tray icon) and start it again. You can check that the staged runtime works with:
~/.t3/wsl-runtime/sha256-*/t3 --version
Gotcha: if apt refuses with "Unmet dependencies" because of some other broken package (in my case a half-installed
google-chrome-stable), apt won't install anything until that's resolved. Runsudo apt --fix-broken installor remove the broken package first.Suggestion: "archive does not contain a working t3 executable" hides the real loader error. Surfacing the stderr of the probe (e.g.
error while loading shared libraries: libatomic.so.1) or checking forlibatomic.so.1during preflight would make this self-explanatory.- added a commit that references this issue
on Oct 9, 2026
Before submitting
Area
apps/desktop
Steps to reproduce
libatomic.so.1, which my Ubuntu 22.04 didn't have. So it fell back to the mounted server tree, and that died withCannot find module '@yuuang/ffi-rs-linux-x64-gnu'.You can also hit it by making the backend unreachable instead of crashing, e.g.
sudo iptables -I INPUT -p tcp --dport <port> -j DROPinside the distro before launching.Expected behavior
If the WSL backend can't come up, the app should show an error and fall back to the Windows backend for that launch, like it already does when the WSL preflight fails. At minimum it should get me to a window where I can turn WSL-only off.
Actual behavior
The splash never closes. It has no buttons, and clicking the taskbar icon just brings the splash back, so there's no way to reach Settings. The logs show the backend exiting with code 1 and being restarted every ~10s with no limit. One session had 62 restarts in 13 minutes before I killed it. The only way out was ending it in Task Manager and setting
"wslOnly": falseindesktop-settings.jsonby hand.From reading the code on main (0fcd5f9): the splash only closes once the primary backend reports ready. WSL preflight failures fall back to Windows, but once preflight passes there's no limit:
scheduleRestartwith no attempt cap (DesktopBackendManager.ts#L900)I have a small fix: after 3 consecutive startup failures in wsl-only mode, show an error and use the existing in-memory Windows fallback for that launch. The desktop tests pass with it, and the new test hangs without it. I'll open a PR and link it here.
Probably related: #3709, #4535, #5967, #13738
Impact
Blocks work completely
Version or commit
0.0.44 (Windows desktop)
Environment
Windows 10 22H2 (19045.6466), WSL 3.0.1.0 (NAT), Ubuntu 22.04
Logs or stack traces
Screenshots, recordings, or supporting files
No response
Workaround
Kill T3 Code in Task Manager, set
"wslOnly": falsein%USERPROFILE%\.t3\userdata\desktop-settings.json, and relaunch.In my case,
sudo apt-get install -y libatomic1in the distro also fixed the crash itself.