Skip to content

Linux AppImage: mount dirs from earlier launches pile up on the server PATH; a dead one makes every git spawn fail with ENOTCONN #18790

Closed

Description

@Derpedyea

What happened

Starting a new thread in a project failed with "workspace prep failed ENOTCONN".

Diagnosis

Every git spawn from the server failed with Error: spawn ENOTCONN (worktree prep, GitManager.branchPullRequest.remotes, ThreadPullRequestServiceV2.synchronize).

  • The server process's PATH held 8 AppImage mount dirs (<cache>/t3code/tmp/.mount_T3-Cod* and …/usr/sbin), one per launch going back 5 days. All of them came before /usr/bin.
  • 6 AppImage runtime processes from earlier launches (Oct 7–12) were still alive, each keeping its mount alive. The oldest mount was dead: ls returned Transport endpoint is not connected.
  • PATH lookup during spawn stops at the first error other than ENOENT/EACCES/ENOTDIR. The dead mount returns ENOTCONN, so the search ended before /usr/bin/git. Reproduced with the server's exact PATH: env PATH="$SERVER_PATH" git --version → env: 'git': Transport endpoint is not connected.
  • How it piles up: each new instance inherits the previous instance's environment (PATH already including the old mount), and the AppImage runtime adds its own APPDIR in front. Evidence: an Oct 11 runtime process had 4 mounts on PATH, and the Oct 12 one had 7 plus its own. Nightly auto-updates relaunch roughly daily. Inferred, not confirmed: the updater/relaunch path starts the new AppImage with process.env as is.
  • Source (v0.0.46-nightly.20261012.3021, same on main): stripAppImageRuntimeEnv in apps/server/src/terminal/Manager.ts removes only the current APPDIR segments, and only for terminal PTYs. Nothing cleans .mount_* segments from earlier launches out of the desktop/server process env. DesktopShellEnvironment.installPosixEnvironment merges the login-shell PATH with the inherited process.env.PATH, which keeps the stale entries.

Suggested fix: at desktop startup, remove every PATH (and LD_LIBRARY_PATH/XDG_DATA_DIRS) segment that is under any .mount_* AppImage mount except the current APPDIR. Do this before the server is spawned, and also scrub the env passed to relaunch/update.

Steps to reproduce

  1. Linux, run the AppImage build from a desktop launcher.
  2. Restart it several times in a way that hands down the env (in-app relaunch or nightly auto-update).
  3. Inspect the server's PATH: tr '\0' '\n' < /proc/<server-pid>/environ | grep ^PATH=. It shows one .mount_T3-* pair per earlier launch.
  4. Kill the AppImage runtime of one older launch (or wait for it to die). Its mount turns into ENOTCONN.
  5. Start a thread / worktree. Workspace prep fails with spawn ENOTCONN.

Version

0.0.46-nightly.20261012.3021 (desktop AppImage)

Environment

CachyOS Linux x64 (kernel 7.2.8), Wayland, Node v26.8.2, git 2.55.0

Evidence

runGitCommand  git.cwd=<home>/.t3/worktrees/<project>/t3-918b8cb8
  exit: Failure  Error: spawn ENOTCONN
    at ChildProcess.spawn (node:internal/child_process:458:11)
    at Module.spawn (node:child_process:813:9)
    at runGitCommand (…/apps/server/dist/binCli-*.mjs:120805:5)
    at GitManager.branchPullRequest.remotes (…)

ThreadPullRequestServiceV2.synchronize  event: "thread branch pull request lookup failed"  cause: Error: spawn ENOTCONN

Server PATH (excerpt):
  <home>/.local/bin : … : <cache>/t3code/tmp/.mount_T3-CodDlgiNJ : …/usr/sbin
  : .mount_T3-CodbBAAcc : .mount_T3-CodBcobcf : .mount_T3-CodJKbOcO : .mount_T3-CodkdaOdj
  : .mount_T3-CodFHbFnM : .mount_T3-CodloMHfl : .mount_T3-CodGLOGmC (dead) : /usr/local/bin : /usr/bin …

$ ls <cache>/t3code/tmp/.mount_T3-CodGLOGmC
ls: cannot open directory: Transport endpoint is not connected

Related issues

#14259 (AppImage mount disappears, children die with SIGBUS) is a related way an AppImage mount can die, but the bug there is the main process exiting. Here the main process stays alive and stale mounts pile up on PATH. Not a duplicate.

Fix applied or workaround

fusermount3 -uz on the dead mount (it becomes an empty dir, so PATH lookup skips it). Git spawns worked again right away with no restart. Lasting workaround: fully quit and relaunch from the desktop launcher so the app starts with a fresh environment.

Filed by

Claude Code (claude-opus-5-5) via t3 triage

Activity

  1. Derpedyea commented on Oct 12, 2026

    @Derpedyea
    ContributorAuthor

    This was done via t3 code triage.

  2. juliusmarminge commented on Oct 12, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    Thanks for the detailed diagnosis. I checked it against main:

    I'm accepting this as a bug. The fix belongs at desktop startup, before the server is spawned: remove every PATH / LD_LIBRARY_PATH / XDG_DATA_DIRS segment under any AppImage .mount_* dir other than the current APPDIR, and apply the same scrub to the env used for relaunch/update. Ideally this lives in the shared helper from #16679 so terminals and agents get it too.

    Workaround until then: fully quit T3 Code and start it from the desktop launcher so it gets a fresh environment, or fusermount3 -uz the dead mount.

  3. added
    acceptedfeature request accepted
    bugSomething is broken or behaving incorrectly.
    via-triageFiled through npx t3 triage
    on Oct 12, 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

    acceptedfeature request acceptedbugSomething 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