cloudflare / cloudflare/cfssl

"unable to open database file" using sqlite db

Open
#670 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
9.5k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Using the cfssl docker configured to use sqlite for the certdb I got the following confusing error message:

> [ERROR] http error with http://cfssl:8888/api/v1/cfssl/sign
> {"code":7400,"message":"{\"success\":false,\"result\":null,\"errors\":[{\"code\":11000,\"message\":\"unable to open database file\"}],\"messages\":[]}\n"}

The cfssl process definitely had access to the sqlite db file.
After debugging with strace, I found that the server tries to create/open a journal file in the same directory as the db:

> pid 19905] open("/cfssl/certstore_production.db-journal", O_RDWR|O_CREAT|O_CLOEXEC, 0660
> ...
> [pid 19905] <... open resumed> ) = -1 EACCES (Permission denied)

In this case the process didn't have write access to the directory.

I would suggest adding more documentation and a more informative error message.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.