CI - Failed to decrypt file
Closed this issue · 2 comments
I'm using strong-config
in a private package. This package is then later utilizing decrypt while in a Circle CI job.
I've confirmed I'm able to call decrypt w/o issue locally, but for some reason in my CI env I see this error (which I'm not able to reproduce):
Error: Command failed: npx strong-config decrypt /app/node_modules/@myCompany/myPrivatePkg/secrets.enc.yaml
- Decrypting...
✖ Failed to decrypt config file
at ChildProcess.exithandler (child_process.js:303:12)
at ChildProcess.emit (events.js:310:20)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:443:11)
at Socket.emit (events.js:310:20)
at Pipe.<anonymous> (net.js:672:12) {
killed: false,
code: 1,
signal: null,
cmd: 'npx strong-config decrypt /app/node_modules/@myCompany/myPrivateCompany/secrets.enc.yaml'
}
Any idea???
hey marie, happy to hear you're finding strong-config useful :)
wrt your error it is hard to tell just from the logs you shared. generally if something works in one environment (your local machine) but not in another (CI), i'd always go investigate what differs between these two, a few possibilities:
- Node version
- NPM version
- Does CI have access to the decryption key? e.g. if you're using AWS as your key management service, does CI have the necessary permissions to read the key from AWS?
- Was the
sops
binary installed correctly on CI?
Another thought: we haven't really tested strong-config with npx
yet. A special characteristic of strong-config is that it relies on sops which it installs via a postinstall
hook. Maybe when called via npx
this postinstall
hook isn't run and when strong-config tries to use the sops
binary to decrypt it can't find it
closing due to inactivity, feel free to re-open if you still need help