Skip to content

[Bug]: Step CA Badger database is very easily corrupted when hard drive is full #1216

@landure

Description

@landure

Steps to Reproduce

Install Step CA on a small partition, and fill it completely (no disk available) (for example, with a log file).

Your Environment

  • OS - Ubuntu Jammy 22.04
  • Docker version 20.10.22, build 3a2c30b
  • step-ca Version -:
    smallstep/step-ca:latest@sha256:438d865be4e4105fbc715b80664fbcc45ac6d58fe3d203ef77ba2534392c0011@sha256:1ffd48e849882330f191e17ef5a675f68ef7eac8387374b133a90ee2f8b11e88

Expected Behavior

Step CA should be able to recover from a full disk after the disk is emptied.

Actual Behavior

The Badger database is randomly corrupted. It's not always the same issue that appears.

Additional Context

It's something i've encountered two time on a test server. It's not very critical, but the Badger DB is very easily corrupted when there is no disk space available. The solution is to use something like MySQL that is able to recover from such an issue, but as BadgerDB is Smallstep default, this issue should be noted and checked ? I would prefer for step ca to crash when there is no more disk space available than to have a corrupt database that is difficult to recover from.

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds triageWaiting for discussion / prioritization by team

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions