nsmithuk / local-kms

A mock version of AWS' Key Management Service, for local development and testing.
MIT License
198 stars 34 forks source link

panic: file missing #67

Closed mplanchard closed 9 months ago

mplanchard commented 9 months ago

I've somehow gotten myself into a state where running local-kms with any arguments results in:

❯ local-kms -vvv --help 
INFO[2023-11-30 18:54:38.709] Local KMS Version Unknown (Commit Hash Unknown) 
panic: file missing

goroutine 1 [running]:
github.com/nsmithuk/local-kms/src/data.NewDatabase(...)
        github.com/nsmithuk/local-kms/src/data/database.go:15
github.com/nsmithuk/local-kms/src.Run({0x964759, 0x4}, {0x968bf0, 0xf})
        github.com/nsmithuk/local-kms/src/server.go:19 +0x356
main.main()
        github.com/nsmithuk/local-kms/start.go:111 +0x57d

any ideas?

mplanchard commented 9 months ago

Resolved by explicitly setting KMS_DATA_PATH to a different directory.

It would be reasonable I think to default this to an XDG-compliant configuration directory, rather than /tmp/local-kms, since /tmp can be wiped out at any time for any reason