OpenSSL::Cipher::CipherError when running staging DB on local
Asked Answered
L

2

16

I just copied our staging server database into my development, and now I receive this error whenever I load any data

OpenSSL::Cipher::CipherError

Which occurs at the following piece of code

credentials = encrypted_credentials.inject({}) do |hash, (key, value)|
   hash[key] = AESCrypt.decrypt(value, password) <-----------
   hash
end

Anybody have a clue why this is?

Lomax answered 5/12, 2014 at 8:45 Comment(0)
L
14

Turned out I was using the wrong encryption password, because it was stored in a environment variable

Lomax answered 5/12, 2014 at 9:26 Comment(0)
W
0

I (mostly) followed the instructions here: https://myrtana.sk/articles/howto-fix-rails-7-openssl-cipher-error

Steps:

  • Removed credentials.yml
  • Created new credentials file using VS Code EDITOR='code --w' bin/rails credentials:edit
Wille answered 2/3, 2023 at 10:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.