Skip to content

acmeserver: say when the CA database is locked by another process - #8007

Merged
steadytao merged 1 commit into
caddyserver:masterfrom
faiyazrahmann:acmeserver-locked-db-error
Sep 11, 2026
Merged

steadytao merged 1 commit into
caddyserver:masterfrom
faiyazrahmann:acmeserver-locked-db-error

Conversation

@faiyazrahmann

@faiyazrahmann faiyazrahmann commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #8004

Running caddy validate while Caddy is already running only reported "Error opening database of Type bbolt: timeout" for configs with acme_server, which reads like a broken config or a corrupt database.

openDatabase() now catches bolterrors.ErrTimeout with errors.Is and adds the missing context:

Error opening database of Type bbolt: timeout: CA database /path/to/db is locked by another process; if Caddy is already running, use 'caddy reload' instead of 'caddy validate'

Added TestHandler_openDatabaseLocked, which holds a real lock on the bbolt file and checks that the error wraps bolterrors.ErrTimeout and explains the lock. It is skipped under -short since it waits out bbolt's 5 second timeout.

go mod tidy dropped the // indirect marker on go.etcd.io/bbolt. No version change.

Assistance Disclosure

I used an LLM to reproduce the issue after writing the regression.

Copilot AI lite review requested due to automatic review settings September 10, 2026 05:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@faiyazrahmann
faiyazrahmann force-pushed the acmeserver-locked-db-error branch from 74cf7ab to 6ff6691 Compare September 10, 2026 06:03
@faiyazrahmann
faiyazrahmann force-pushed the acmeserver-locked-db-error branch from 6ff6691 to 79a10b6 Compare September 10, 2026 18:23
Opening the bbolt database only reported timeout, which sounds like a
broken config. Catch bolt.ErrTimeout with errors.Is and say another
process holds the lock, and that caddy reload is the right command when
Caddy is already running. The error stays fatal.
@steadytao steadytao added the documentation 📚 Improvements or additions to documentation label Sep 11, 2026
@steadytao steadytao added this to the v2.11.5 milestone Sep 11, 2026
@steadytao
steadytao merged commit 425a338 into caddyserver:master Sep 11, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation 📚 Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Caddy validate with acme_server shows database opening error when already running.

4 participants