0

I'm using Rails 7 and Ruby 3.2.2 After I successfully deployed the app from the local machine to the server machine (regular server, I'm not using Heroku), and then I wanted to reset the database from the server by typing :

rake db:reset

I get those errors :

rake aborted!
ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage


...
...
...

Caused by:
OpenSSL::Cipher::CipherError: 
...
...
...
asks: TOP => db:reset => db:drop => db:load_config => environment
(See full trace by running task with --trace)

I did follow the instructions mentioned in this post :

Rails: ActiveSupport::MessageEncryptor::InvalidMessage

but it didn't work, I'm using a VPS, not Heroku, and that might make some differences to how I can configure the server.

John Sall
  • 1,027
  • 1
  • 12
  • 25
  • Does this answer your question? [Rails: ActiveSupport::MessageEncryptor::InvalidMessage](https://stackoverflow.com/questions/54277392/rails-activesupportmessageencryptorinvalidmessage) – Greg Jul 24 '23 at 08:53
  • @Greg I'm using a regular server, not Heroku, and why should I reset the credentials? I deployed with them just fine – John Sall Jul 24 '23 at 09:04
  • 1
    Sure, but have you considered the commonalities that are explained there and in the links? Did anything change with your `master.key` since the last time you deployed your production app? Maybe `credentials.yml.enc` has been altered? If this doesn't ring a bell - please consider adding more details. How did you deploy your app successfully, how did you check that deploy succeeded? Did you use a tool like capistrano, or did you just ssh into the server? – Greg Jul 24 '23 at 16:09
  • @Greg I deleted the two files you mentioned in the local machine, and then deployed again using capistrano, there was no errors in the deployment, however, when I type "rake db:reset" I still get the above mentioned errors. I think if there are no errors in the deployment then it was successful. and I checked it was successful by going to the website and all the required new functionalities are present. The database is also working as expected. I used capistrano and ssh into the server. – John Sall Jul 25 '23 at 08:59
  • "there was no errors in the deployment", does your deployment include any steps like `rails db:migrate`? I think you should edit you question and include everything relevant. 1. deployment definitions, 2. output from the deployment 3. exact commands you're using (of course remove anything sensitive like server's IP and passwords). Your issue is super broad - almost no two deployments are the same, so it's hard to tell where something goes wrong in your case. – Greg Jul 25 '23 at 11:44

0 Answers0