"unable to open database file" using sqlite db
- 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
Assessment
This issue has not been assessed yet.