github new-usemame/Calibre-Web-NextGen v4.0.79
v4.0.79 — fix missing book_format_checksums table on fresh install

latest releases: v4.0.83, v4.0.82, v4.0.81...
3 hours ago

What's new

Fresh installs no longer log Failed to store checksum for book N: no such table: book_format_checksums on every book ingest. The error has been there since v4.0.0 — fix turned out to be a two-part design issue.

docker pull ghcr.io/new-usemame/calibre-web-nextgen:v4.0.79

(or :latest)

The bug

On a fresh install with KOReader sync left at its default (off), every ingest produced:

ERROR ... Failed to store checksum for book N: no such table: book_format_checksums

The book_format_checksums table is part of the KOReader sync feature, but three writers in the ingest pipeline (scripts/ingest_processor.py, scripts/cover_enforcer.py, scripts/kindle_epub_fixer.py) wrote to it on every import regardless of feature-flag state. Meanwhile cps/db.py and cps/ub.py only created the table when KOReader sync was on. Tables off, writers on — error on every ingest.

The fix

  • The table is a schema invariant — created unconditionally at startup now (cps/db.py + cps/ub.py).
  • The three ingest-pipeline writers now mirror the gate PR #94 (v4.0.28) added to cps/helper.py — when KOReader sync is off, the partial-MD5 work is skipped entirely.

11 regression tests in tests/unit/test_book_format_checksums_table_creation.py pin both halves. Verified end-to-end on a fresh container: zero "no such table" errors with sync off; sync-enabled path still writes rows; cwa-checksum-backfill now reports schema ready (attempt 1) instead of the 30-second timeout it printed pre-fix.

Credits

Thanks @thealmostmighty for the report, @droM4X for confirming on clean install, @Hoite for proposing a workaround. Closes #219.

Don't miss a new Calibre-Web-NextGen release

NewReleases is sending notifications on new releases.