Rails 6 credentials constantly broken

Viewed 43

We're running Rails v6.1.4 and the encrypted credentials constantly break and we can't figure out why...

We have four sets of credentials for various environments:

config/
  credentials/
    development.key
    development.yml.enc
    ...

The *.key files are all .gitignoreed. The *.yml.enc are tracked.

There are two developers working on the project. We occasionally update credentials using this command: rails credentials:edit --environment [ENVIRONMENT]

We never edit the .key files

But almost every week one of us starts getting...

Couldn't decrypt config/credentials/development.yml.enc. Perhaps you passed the wrong key?

...when we try to edit a credentials file.

WHY? What could we doing to cause this? It's incredibly frustrating and I'm ready to give up on this feature because it's wasting so much time.

1 Answers

Probably you're not noticing when you introduce merge conflicts into the encrypted file.

Related