[Bug]: ERROR: Cannot open database: unable to open database file
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 44/100
Research direction
Start by reading the database initialization path used by step-ca and how it configures the PKCS#11 ESYSDB backend. The report includes Badger recovery logs and database file permissions, but does not identify a source file or test. Reproduce or investigate the database-open failure and add a regression test; done when the reported startup failure is understood and covered.
Written by the indexing model from the issue text.
Description
Steps to Reproduce
Maybe a few of unpredictable power-off. Step-ca can't start normally after some months.
Your Environment
- OS - Ubuntu 22.04
step-caVersion - Smallstep CA/0000000-dev (linux/amd64) (compiled from the source-code)
Expected Behavior
Can be start normally and loaded the sighed certificate data.
Actual Behavior
Start failed, while the log from start as following:
Apr 24 13:32:54 wcu-dispatcher step-ca[1866040]: badger 2026/04/24 13:32:54 INFO: All 1 tables opened in 3ms
Apr 24 13:32:54 wcu-dispatcher step-ca[1866040]: badger 2026/04/24 13:32:54 INFO: Replaying file id: 0 at offset: 47489457
Apr 24 13:32:54 wcu-dispatcher step-ca[1866040]: badger 2026/04/24 13:32:54 INFO: Replay took: 141.828989ms
Apr 24 13:32:54 wcu-dispatcher step-ca[1866040]: ERROR: Cannot open database: unable to open database file
Apr 24 13:32:54 wcu-dispatcher step-ca[1866040]: WARNING: ESYSDB backend was not initialized.
Apr 24 13:32:54 wcu-dispatcher step-ca[1866040]: ERROR: Neither FAPI nor ESYSDB backends could be initialized.
Apr 24 13:32:54 wcu-dispatcher step-ca[1866040]: error initializing PKCS#11: failed to initialize PKCS#11 library: pkcs11: 0x5: CKR_GENERAL_ERROR
Apr 24 13:32:54 wcu-dispatcher systemd[1]: step-ca.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
And the DB files can be seen as follow:
total 86M
-rw------- 1 28 Apr 24 12:07 KEYREGISTRY
-rw------- 1 9.3M Apr 24 12:07 000054.sst
-rw------- 1 1.1K Apr 24 13:32 MANIFEST
-rw-r--r-- 1 8 Apr 24 13:32 LOCK
-rw------- 1 77M Apr 24 13:32 000000.vlog
Additional Context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
- Dominant language
- Go
- Stars
- 8.9k
- Forks
- 599
- Avg merge
- 21h 20m
- Merged PRs (30d)
- 15
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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 smallstep/certificates
-
bug needs triage
Difficulty 1/5 Under an hour Newbie friendliness 84/100
smallstep/certificates#2863 ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 1/5 Under an hour Newbie friendliness 65/100
smallstep/certificates#2788 ·
Maintainers usually reply within 1 day
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
smallstep/certificates#2730 · 1 comment · 2 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
smallstep/certificates#2860 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug]: Tokens fail validation after the identity provider rotates its signing key until the JWKS cache expiresPossibly taken @APWHY claimed this 99 days ago. Openbug needs triage
Difficulty 3/5 1-2 days Newbie friendliness 35/100
smallstep/certificates#2831 · 3 comments ·
Maintainers usually reply within 1 day
All issues in smallstep/certificates
Similar issues
-
bug(terraform): a `kubernetes_manifest` the scan can't fully read is dropped and nothing says soOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OneBusAway/watchdog#455 ·
Maintainers usually reply within 1 day
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rootsiemen/loophole#97 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
SocialGouv/iterion#3889 ·
Maintainers usually reply within 1 day
-
Docs / Zero-code Instrumentation / Go - Outdated `Work In Progress` and Archived Repo ReferenceOpendocs
Difficulty 1/5 Under an hour Newbie friendliness 82/100
open-telemetry/opentelemetry.io#12890 ·
Maintainers usually reply within 1 day