Note that the credential that was running locally did not work in the production environment deployed on Capistrano and was stuck for about 30 minutes.
Local console output
irb(main):002:0> Rails.application.credentials.slack
=> {:token=>"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
Production console output
irb(main):002:0> Rails.application.credentials.slack
=> nil
The cause is that the following commands for operating credentials were executed only on dev.
Change local credentials
$ EDITOR="vi" bin/rails credentials:edit
This alone doesn't change config/credentials/production.yml.enc, so There is no point in reflecting config/credentials/production.key.
As shown below, change the actual credential and push to solve it.
Production Credential change
$ EDITOR="vi" bin/rails credentials:edit -e production
It's not a big deal if you know it, but I forgot about it because of the prejudice that the locals operate only for dev. It was an embarrassing jam that revealed that I didn't really understand how credentials work.
Recommended Posts