Skip to content

Commit b28d77c

Browse files
docs: add TROUBLESHOOTING.md with common setup and config fixes
1 parent c17f463 commit b28d77c

2 files changed

Lines changed: 175 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,16 @@ curl http://localhost:11434/api/embed -d '{"model":"all-minilm","input":"test"}'
744744

745745
---
746746

747+
## Troubleshooting
748+
749+
Having issues? Check **[TROUBLESHOOTING.md](TROUBLESHOOTING.md)** for solutions to common problems including:
750+
- LanceDB setup and platform issues
751+
- Embedding provider configuration
752+
- `.preflight/` config parsing errors
753+
- Profile selection guide
754+
755+
---
756+
747757
## Contributing
748758

749759
This project is young and there's plenty to do. Check the [issues](https://github.com/TerminalGravity/preflight/issues) — several are tagged `good first issue`.

TROUBLESHOOTING.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# Troubleshooting
2+
3+
Common issues and fixes for preflight.
4+
5+
---
6+
7+
## Installation & Setup
8+
9+
### `npx preflight-dev-serve` fails with module errors
10+
11+
**Symptoms:** `ERR_MODULE_NOT_FOUND` or `Cannot find module` when running via npx.
12+
13+
**Fix:** Preflight requires **Node 20+**. Check your version:
14+
```bash
15+
node --version
16+
```
17+
If you're on Node 18 or below, upgrade via [nvm](https://github.com/nvm-sh/nvm):
18+
```bash
19+
nvm install 20
20+
nvm use 20
21+
```
22+
23+
### Tools don't appear in Claude Code after `claude mcp add`
24+
25+
**Fix:** Restart Claude Code completely after adding the MCP server. The tool list is loaded at startup.
26+
27+
If tools still don't appear, verify the server starts without errors:
28+
```bash
29+
npx preflight-dev-serve
30+
```
31+
You should see MCP protocol output (JSON on stdout). If you see errors, check the sections below.
32+
33+
---
34+
35+
## LanceDB & Timeline Search
36+
37+
### `Error: Failed to open LanceDB` or LanceDB crashes on startup
38+
39+
**Symptoms:** Timeline tools (`search_timeline`, `index_sessions`, etc.) fail. Other tools work fine.
40+
41+
**Cause:** LanceDB uses native binaries that may not be available for your platform, or the database directory has permission issues.
42+
43+
**Fixes:**
44+
1. Make sure `~/.preflight/projects/` is writable:
45+
```bash
46+
mkdir -p ~/.preflight/projects
47+
ls -la ~/.preflight/
48+
```
49+
2. If on an unsupported platform, use the **minimal** or **standard** profile (no LanceDB required):
50+
```bash
51+
npx preflight-dev
52+
# Choose "minimal" or "standard" when prompted
53+
```
54+
3. Clear corrupted LanceDB data:
55+
```bash
56+
rm -rf ~/.preflight/projects/*/timeline.lance
57+
```
58+
Then re-index with `index_sessions`.
59+
60+
### Timeline search returns no results
61+
62+
**Cause:** Sessions haven't been indexed yet. Preflight doesn't auto-index — you need to run `index_sessions` first.
63+
64+
**Fix:** In Claude Code, run:
65+
```
66+
index my sessions
67+
```
68+
Or use the `index_sessions` tool directly. Indexing reads your `~/.claude/projects/` session files.
69+
70+
---
71+
72+
## Embeddings
73+
74+
### `OpenAI API key required for openai embedding provider`
75+
76+
**Cause:** You selected OpenAI embeddings but didn't set the API key.
77+
78+
**Fixes:**
79+
80+
Option A — Set the environment variable when adding the MCP server:
81+
```bash
82+
claude mcp add preflight \
83+
-e OPENAI_API_KEY=sk-... \
84+
-- npx -y preflight-dev-serve
85+
```
86+
87+
Option B — Switch to local embeddings (no API key needed). Create or edit `~/.preflight/config.json`:
88+
```json
89+
{
90+
"embedding_provider": "local",
91+
"embedding_model": "Xenova/all-MiniLM-L6-v2"
92+
}
93+
```
94+
95+
### Local embeddings are slow on first run
96+
97+
**Expected.** The model (~80MB) downloads on first use and is cached afterward. Subsequent runs are fast.
98+
99+
---
100+
101+
## `.preflight/` Config
102+
103+
### `warning - failed to parse .preflight/config.yml`
104+
105+
**Cause:** YAML syntax error in your project's `.preflight/config.yml`.
106+
107+
**Fix:** Validate your YAML:
108+
```bash
109+
npx yaml-lint .preflight/config.yml
110+
```
111+
Or check for common issues: wrong indentation, tabs instead of spaces, missing colons.
112+
113+
### Config changes not taking effect
114+
115+
**Cause:** Preflight reads config at MCP server startup, not on every tool call.
116+
117+
**Fix:** Restart Claude Code after editing `.preflight/config.yml` or `.preflight/triage.yml`.
118+
119+
---
120+
121+
## Profiles
122+
123+
### Which profile should I use?
124+
125+
| Profile | Tools | Best for |
126+
|---------|-------|----------|
127+
| **minimal** | 4 | Try it out, low overhead |
128+
| **standard** | 16 | Daily use, no vector search needed |
129+
| **full** | 20 | Power users who want timeline search |
130+
131+
You can change profiles by re-running the setup wizard:
132+
```bash
133+
npx preflight-dev
134+
```
135+
136+
---
137+
138+
## Platform-Specific
139+
140+
### Apple Silicon (M1/M2/M3/M4): LanceDB build fails
141+
142+
LanceDB ships prebuilt binaries for Apple Silicon. If `npm install` fails on the native module:
143+
```bash
144+
# Ensure you're using the ARM64 version of Node
145+
node -p process.arch # should print "arm64"
146+
147+
# If it prints "x64", reinstall Node natively (not via Rosetta)
148+
```
149+
150+
### Linux: Permission denied on `~/.preflight/`
151+
152+
```bash
153+
chmod -R u+rwX ~/.preflight/
154+
```
155+
156+
---
157+
158+
## Still stuck?
159+
160+
1. Check [open issues](https://github.com/TerminalGravity/preflight/issues) — someone may have hit the same problem
161+
2. [Open a new issue](https://github.com/TerminalGravity/preflight/issues/new) with:
162+
- Your Node version (`node --version`)
163+
- Your OS and architecture (`uname -a`)
164+
- The full error message
165+
- Which profile you selected

0 commit comments

Comments
 (0)