Rails Multi Environment Credentials Error?

I’m trying to use Render for a new product I’m building. I’m using Ruby on Rails 7 and hitting an error during every deploy when puma starts (RAILS_ENV="production" bundle exec puma -C config/puma.rb):

Unable to load application: ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage
/opt/render/project/.gems/ruby/3.0.0/gems/activesupport-7.0.2.4/lib/active_support/message_encryptor.rb:208:in `rescue in _decrypt': ActiveSupport::MessageEncryptor::InvalidMessage (ActiveSupport::MessageEncryptor::InvalidMessage)

I’ve been able to find that it’s likely related to the multi-environment credentials that are being used. It seems like the error arises when the master key for decryption of credentials can’t be found or is invalid. However it does exist:

my_porject|main ⇒  ls config/credentials                                                   
production.key     production.yml.enc

Is Render unable to access these files during deployment, causing the server to fail startup?

Hey there,
We don’t do anything special when it comes to running Rails apps here. We default RAILS_ENV to production so you don’t need to explicitly pass that either.

Are you able to run your service locally in production mode to determine what happens locally and debug it from there?

John B

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.