Skip to content

bug(fts): D1 FTS5 upsert failures observed for diff rows across all repos #135

Closed

Description

@liplus-lin-lay

observation

Cloudflare Workers logs (2026-04-26 cron run) show repeated `Failed to upsert FTS5 row for diff ...` errors across all 5 polled repos:

```
Failed to upsert FTS5 row for diff Liplus-Project/dipper_ai@07391bc
Failed to upsert FTS5 row for diff Liplus-Project/liplus-language@ce3b9d5 (multiple)
Failed to upsert FTS5 row for diff Liplus-Project/liplus-desktop@add899f
Failed to upsert FTS5 row for diff 770d7a9
Failed to upsert FTS5 row for diff Liplus-Project/github-webhook-mcp@1d237f4
```

Pattern: cross-repo (not specific to one repo), specifically on diff type rows. Long-standing per Master's framing.

scope

  • Affects `pollDiffs` → `processAndUpsertCommitDiff` path
  • D1 FTS5 mirror upsert fails; primary Vectorize upsert may still succeed (dual-store design)
  • Search recall on diff type queries may degrade (sparse side missing rows)

fix direction (memo)

Investigation needed to determine:

  • Specific D1 error (constraint violation? schema mismatch? rate limit?)
  • Whether the failure is per-call or per-row
  • Whether retry / fallback policy in `pipeline.ts` masks the failure level

The error message catches all upsert exceptions in `processAndUpsertCommitDiff` so root cause requires log-level enrichment or local repro.

related

  • 既存 `processAndUpsertCommitDiff` 内 try/catch 包囲 (`src/pipeline.ts`)
  • `src/fts.ts` upsertFtsRow / D1 FTS5 schema (`migrations/0001_fts5_init.sql`, `0002_fts5_rebuild.sql`)

Activity

  1. added
    bug動いていない、壊れている
    memoメモとして開始した状態。見出しは必要なものだけでよい
    on Apr 26, 2026
  2. liplus-lin-lay commented on Apr 27, 2026

    @liplus-lin-lay
    MemberAuthor

    PR #137 (chore(fts): enrich D1 upsert failure logs to surface root cause) は本 issue の root-cause fix ではなく Option B (log enrichment) のみのため、issue は open のまま継続。

    PR body も Refs #135 で Closes 指定なしで作成したが、gh issue develop 由来の Development panel branch link が PR merge 時に自動 close を引いたため reopen。

    次の :30 UTC cron iteration(pollDiffs)以降のログで FTS5 diff upsert detail (#135): 行に出る errorName / tokenizerKind / contentChars / filePathChars を観測してから、root-cause fix を別 PR で行う。

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

    bug動いていない、壊れているmemoメモとして開始した状態。見出しは必要なものだけでよい

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions