[Bug]: "This T3 home is unavailable" after reboot with no T3 server running; fixed by moving server-owner.sqlite-journal and server-runtime.json

未关闭
#35,347 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
sqlite, typescript
领域
databases, desktop

调研方向

Start in the apps/desktop area and trace startup checks for server-owner.sqlite, server-owner.sqlite-journal, and server-runtime.json. Reproduce or inspect how an abrupt exit leaves these files when no server is running, then identify why startup reports a live owner. Done when a stale ownership state no longer blocks launch while a genuinely running server still prevents conflicting access.

由索引模型根据 Issue 内容生成。

描述

bug needs-triage
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

Not reliably reproducible. Sequence that led to it:

  1. T3 Code desktop app running normally on macOS.
  2. fseventsd started using ~15 GB of RAM and high CPU.
  3. The T3 Code process ended abruptly (it crashed, was force-quit, or was killed by the system under memory pressure). The server had no chance to shut down cleanly.
  4. Reboot the Mac. No T3 Code server or background service is running afterwards.
  5. Open T3 Code. The "This T3 home is unavailable" dialog appears (generic version, no PID or port) and the app quits.
  6. Confirm nothing holds the home: lsof ~/.t3/userdata/server-owner.sqlite prints nothing, ps aux shows no T3 processes, and there is no com.t3tools.t3code.service in launchctl or ~/Library/LaunchAgents.
  7. ~/.t3/userdata still contains server-owner.sqlite-journal (512 bytes) and a stale server-runtime.json, both left over from the abrupt exit.
  8. Quit T3 Code, move those two files out of ~/.t3/userdata, and reopen T3 Code. It starts normally.

Suspected cause: the abrupt termination in step 3 left stale ownership files that the next launch treats as a live owner.

Expected behavior

With no server holding the ownership lock and no live PID in server-runtime.json, T3 Code should start normally and ignore or clean up the stale files.

Actual behavior

The app shows "This T3 home is unavailable" with the generic message ("Another T3 Code server, such as the background service, is using this data directory...") and quits. Rebooting and running npx t3@latest service uninstall --base-dir ~/.t3 did not help. Moving the two stale files out of ~/.t3/userdata fixed it.

Impact

Blocks work completely

Version or commit

Version 0.1.7 (322f6544dfad)

Environment

MacOS 27.2.1

Logs or stack traces
State of ~/.t3/userdata while the error occurred (no T3 process running, lsof empty):

server-owner.sqlite            0 bytes
server-owner.sqlite-journal    512 bytes
server-runtime.json            269 bytes (its PID was not running)

No server log was captured from a failing launch.
Screenshots, recordings, or supporting files

No response

Workaround
  1. Quit T3 Code completely.
  2. Confirm nothing holds the home: lsof ~/.t3/userdata/server-owner.sqlite should print nothing, and ps aux should show no T3 processes.
  3. Move the stale files out of the data directory (keep a backup rather than deleting):
    mkdir -p ~/Desktop/t3-backup && mv ~/.t3/userdata/server-owner.sqlite-journal ~/.t3/userdata/server-runtime.json ~/Desktop/t3-backup/
  4. Reopen T3 Code.

Leave server-owner.sqlite itself in place. Only do this when no T3 server is running.

Note: rebooting and running npx t3@latest service uninstall --base-dir ~/.t3 did not fix it on their own. Reinstalling the background service on the same T3 home makes the dialog come back, since the service then holds the lock.

主要语言
TypeScript
星标
24.8k
派生
6.4k
平均合并
4 小时 16 分钟
30 天内合并 PR
352

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pingdotgg/t3code 的其他 Issue

查看 pingdotgg/t3code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。