Skip to content

[Bug]: Cold WSL startup exceeds wslpath timeout and falls back to Windows backend #14348

Closed

Description

@satyalyadav

Before submitting

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

Area

apps/desktop

Steps to reproduce

  1. On Windows 11, configure T3 Code 0.0.44 to use an Ubuntu WSL 2 backend in WSL-only mode.
  2. Start T3 Code while the distro is stopped and its systemd startup takes more than 10 seconds. On this machine, a Windows-side wsl.exe -d Ubuntu --exec /usr/bin/wslpath -u <existing Windows path> completes successfully in about 12.2–12.6 seconds from a cold distro.
  3. Observe repeated wslpath conversion failed preflight errors and the modal saying WSL backend is still unavailable; T3 Code falls back to the Windows backend for this launch.
  4. Keep an Ubuntu process running, repeat the same conversion, and start T3 Code again. The conversion takes about 0.4 seconds; T3 Code starts the Linux backend successfully.

The affected Windows paths existed, and /mnt/c/Users/... was mounted inside Ubuntu. The direct wslpath command returned the correct /mnt/c/... path with exit code 0.

Expected behavior

Cold WSL startup should not be reported as a path conversion failure. T3 Code should allow a slow distro enough time to start, or surface a timeout-specific explanation and retry without losing the requested WSL backend for the launch.

Actual behavior

desktop.wsl.windowsToWslPath repeatedly takes about 10.4 seconds and yields wslpath conversion failed for ..., even though the same conversion succeeds if allowed about 12 seconds. After its retry window, T3 Code shows WSL backend is still unavailable and uses Windows. Prewarming Ubuntu makes the WSL backend start normally. After the successful launch, the Linux server listens on 0.0.0.0:3773, and /.well-known/t3/environment returns HTTP 200 from both WSL and Windows localhost.

Impact

Major degradation or frequent failure. A cold distro prevents the selected WSL-only backend from starting until Ubuntu is kept running manually.

Version or commit

T3 Code desktop 0.0.44

Environment

Windows 11 x64, build 26200.9550; WSL 2.9.12.0; default distro Ubuntu, WSL 2, systemd=true.

Logs or stack traces

desktop.wsl.preWarm: approximately 10.4 s
desktop.wsl.windowsToWslPath: approximately 10.4 s per attempt
desktop.backendConfiguration.wslPreflight:
  Could not stage the WSL runtime; launching from the mounted server tree instead.
  reason: wslpath conversion failed for <T3 install>\resources\wsl-runtime.tar.gz
desktop.backendInstance.scheduleRestartFiber:
  reason: wslpath conversion failed for <user profile>\.t3\userdata\wsl-server-tree\0.0.44

Direct Windows-side command with the distro cold:
  wsl.exe -d Ubuntu --exec /usr/bin/wslpath -u <same existing Windows path>
  exit=0; elapsed=12.2–12.6 s; output=/mnt/c/Users/.../0.0.44

Same command while an Ubuntu process keeps the distro running:
  exit=0; elapsed=0.4 s; same output

Ubuntu journal during cold starts:
  WSL (2 - init-systemd(Ubuntu)) ERROR: WaitForBootProcess:3594: /sbin/init failed to start within 10000ms

The current source defines WSLPATH_TIMEOUT = Duration.seconds(10) in DesktopWslEnvironment.ts. The error message does not distinguish command timeout from a real conversion failure.

Workaround

Start Ubuntu and keep a process running before launching T3 Code. Once T3 Code's Linux server starts, the extra process is no longer needed.

Related reports

Activity

  1. juliusmarminge commented on Sep 30, 2026

    @juliusmarminge
    Member

    Triage

    Confirmed against current main (v0.0.44 plus later commits). This is not a path-conversion failure, and it is not a duplicate of open issue #8297 or closed issue #4535.

    In apps/desktop/src/wsl/DesktopWslEnvironment.ts, both PRE_WARM_TIMEOUT and WSLPATH_TIMEOUT are 10 seconds. WSL-only startup awaits preWarm (wsl.exe -d <distro> -- true) and then windowsToWslPath (wsl.exe -d <distro> -- wslpath -u <path>). Each call is interrupted at 10 seconds. windowsToWslPath then collapses three different outcomes into Option.none(): the timeout, a non-zero exit, and empty stdout. stderr is discarded. Callers in prepareWslRuntimeImpl and resolveMountedAppRoot both report that as wslpath conversion failed for ….

    That matches the timings here. A cold wslpath that is allowed to finish returns exit 0 in about 12.2–12.6 seconds, with the correct /mnt/c/... path. The desktop spans stop at about 10.4 seconds, which is the timeout plus child teardown (PROCESS_TERMINATE_GRACE is 1 second), not wslpath rejecting the path. The same command takes about 0.4 seconds once Ubuntu is already running.

    The failure is classified as non-fatal, so DesktopBackendManager retries it up to WSL_TRANSIENT_PREFLIGHT_RETRY_LIMIT (12), and then DesktopBackendPool shows "WSL backend is still unavailable" and applies the in-memory Windows fallback for that launch. The retries never help if every attempt is killed before systemd finishes: preWarm is killed at 10 seconds, and the following wslpath starts cold and is killed again. The Ubuntu journal line (/sbin/init failed to start within 10000ms) is WSL's own boot wait, and it lines up with that same 10-second cutoff.

    Open issue #8297 has the same error string for a different cause: automount is disabled there, so wslpath really exits 1. This report has automount working. Closed issue #4535 is the later 60-second HTTP readiness timeout, after preflight has already succeeded.

    Worth fixing in two parts: let the first cold boot finish (the 10-second caps on preWarm and wslpath are shorter than a slow systemd start), and report a timeout separately from a real wslpath failure so a permanent conversion error does not look like a slow boot. A fast non-zero wslpath exit still returns immediately, so a longer timeout would not slow down the #8297 case.

  2. added
    bugSomething is broken or behaving incorrectly.
    via-triageFiled through npx t3 triage
    on Sep 30, 2026
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

    bugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions