Corrupt cache database is reported as "This SQLite build has no FTS5"
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in claude_code_log/search.py at fts5_available() around line 332, then trace how _build_search_index reports its result. Separate the FTS5 capability check from cache database readability so the diagnostic identifies the actual cause, while preserving graceful serving without search for corrupt caches.
Written by the indexing model from the issue text.
Description
What happens
On a corrupt or unreadable cache database, archive search reports:
This SQLite build has no FTS5; archive search is unavailable.
That sends the user to look at their SQLite build, when the actual problem is the cache file.
Why
fts5_available() (claude_code_log/search.py:332) probes by creating a temp virtual table and swallows sqlite3.Error:
def fts5_available(conn: sqlite3.Connection) -> bool:
"""Runtime feature check — FTS5 is standard but not guaranteed."""
try:
conn.execute("CREATE VIRTUAL TABLE temp._fts5_probe USING fts5(x, content='')")
conn.execute("DROP TABLE temp._fts5_probe")
return True
except sqlite3.Error:
...
A build genuinely lacking FTS5 and a database that cannot be read both raise sqlite3.Error, so both return False and both reach the same message.
Scope
The behaviour is correct — _build_search_index degrades gracefully and serving pages without search beats refusing to start. Only the diagnosis is wrong.
Possible fix
Distinguish the two before reporting: probe FTS5 on a throwaway in-memory connection (which isolates the capability question from the file), or attempt a cheap read of the database first and report unreadability separately.
Surfaced while verifying that a corrupt cache still degrades gracefully.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 98
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 13
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from daaain/claude-code-log
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
daaain/claude-code-log#325 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
daaain/claude-code-log#319 · 1 comment ·
-
Real-time watch mode Openenhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
daaain/claude-code-log#317 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 58/100
daaain/claude-code-log#278 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
daaain/claude-code-log#277 ·
All issues in daaain/claude-code-log
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100