github new-usemame/Calibre-Web-NextGen v4.0.68
v4.0.68 — fix orchestration false-positive when Calibre library is unmounted

latest releases: v4.1.3, v4.1.2, v4.1.1...
one month ago

What's new

If Docker / Kubernetes / Docker Compose was telling you your container was healthy while the app actually wouldn't let anyone in (book grid never loaded, OPDS clients got redirects they couldn't follow, the page kept dropping you on the DB-configuration wizard), this release fixes that.

The fix only matters when the Calibre library mount is missing, empty, or unreadable — orchestration now correctly flags the container as unhealthy instead of falsely reporting it healthy. If your library is mounted and readable, nothing changes for you.

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

(or :latest)

Why this was happening

The Dockerfile HEALTHCHECK probes /health with curl. When config.db_configured was False — no metadata.db, corrupt library, mounted-but-empty, read-only mount — the app was redirecting /health to the DB-configuration wizard. curl does not treat redirects as failures, so the probe exited successfully and Docker saw "healthy."

Two changes close this loop:

  • The before-request hook now lets /health through to its own handler in the unconfigured state.
  • /health itself early-returns HTTP 503 with {"status": "unconfigured", ...} (distinct from "degraded" for DB-down) so probes correctly surface the broken state and logs show which failure mode you hit.

Background — Issue #147

The original issue #147 from @iroQuai had three gaps. v4.0.54 closed the first (the gevent_wsgi NoneType crash on TLS bytes hitting the plain HTTP port). v4.0.61 closed the second (removed the HTTPS-fallback probe in the Dockerfile HEALTHCHECK that was sending those TLS bytes). v4.0.68 closes the third (the silent false-positive healthy state when the library can't be reached).

Thanks @iroQuai for staying on this through three iterations.

Verification

Two parallel local containers — one with a read-only empty library mount, one with a writable one — confirmed: the unconfigured container correctly flips to unhealthy post-fix (was falsely healthy pre-fix), the healthy container stayed healthy. 50 concurrent /health probes returned the right code in both states.

Full diff

v4.0.67...v4.0.68

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

NewReleases is sending notifications on new releases.