We've moved discussions to Discord

Trying to deploy on AWS - issue setting up the production db?

Robert Masiello
My postgres server is on RDS. I suspect this has something to do with how I am running bin/setup. Here are the steps I am running. This is vanilla build of jumpstart

setup.sh - gets run on deployment
 
export RAILS_MASTER_KEY=xxxxxx

RAILS_ENV=production RAILS_SERVE_STATIC_FILES=true 

bin/setup

bundle exec rake assets:precompile db:migrate

foreman start

bin/setup gets snagged with the below. Also including the Procfile for foreman. Any help appreciated.

Procfile:
web: bundle exec rails server
webpack: bin/webpack-dev-server
stripe: stripe listen --forward-to localhost:5000/webhooks/stripe



bin/setup output
== Preparing database ==

rails aborted!ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/message_encryptor.rb:183:in `_decrypt'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/encrypted_file.rb:80:in `decrypt'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/encrypted_file.rb:43:in `read'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/encrypted_configuration.rb:21:in `read'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/encrypted_configuration.rb:33:in `config'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/encrypted_configuration.rb:38:in `options'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/core_ext/module/delegation.rb:303:in `method_missing'/home/ec2-user/prodata/lib/jumpstart/lib/jumpstart/omniauth.rb:55:in `credentials_for'/home/ec2-user/prodata/lib/jumpstart/lib/jumpstart/omniauth.rb:45:in `has_credentials?'/home/ec2-user/prodata/lib/jumpstart/lib/jumpstart/omniauth.rb:21:in `block in enabled_providers'/home/ec2-user/prodata/lib/jumpstart/lib/jumpstart/omniauth.rb:20:in `each'/home/ec2-user/prodata/lib/jumpstart/lib/jumpstart/omniauth.rb:20:in `enabled_providers'/home/ec2-user/prodata/config/initializers/devise.rb:312:in `block in <main>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/devise-4.7.2/lib/devise.rb:307:in `setup'/home/ec2-user/prodata/config/initializers/devise.rb:5:in `<main>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:318:in `block in load'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:291:in `load_dependency'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:318:in `load'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/engine.rb:666:in `block in load_config_initializer'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/notifications.rb:182:in `instrument'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/engine.rb:665:in `load_config_initializer'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/engine.rb:625:in `block (2 levels) in <class:Engine>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/engine.rb:624:in `each'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/engine.rb:624:in `block in <class:Engine>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/initializable.rb:32:in `instance_exec'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/initializable.rb:32:in `run'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/initializable.rb:61:in `block in run_initializers'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/initializable.rb:50:in `each'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/initializable.rb:50:in `tsort_each_child'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/initializable.rb:60:in `run_initializers'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/application.rb:363:in `initialize!'/home/ec2-user/prodata/config/environment.rb:5:in `<main>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:324:in `block in require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:291:in `load_dependency'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:324:in `require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/application.rb:339:in `require_environment!'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/application.rb:523:in `block in run_tasks_blocks'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/commands/rake/rake_command.rb:20:in `perform'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/command.rb:48:in `invoke'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/commands.rb:18:in `<main>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:324:in `block in require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:291:in `load_dependency'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:324:in `require'/home/ec2-user/prodata/bin/rails:9:in `<top (required)>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/spring-2.1.1/bin/spring:49:in `<top (required)>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>'/home/ec2-user/prodata/bin/spring:15:in `<top (required)>'bin/rails:3:in `load'bin/rails:3:in `<main>'
Caused by:OpenSSL::Cipher::CipherError: /home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/message_encryptor.rb:201:in `final'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/message_encryptor.rb:201:in `_decrypt'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/encrypted_file.rb:80:in `decrypt'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/encrypted_file.rb:43:in `read'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/encrypted_configuration.rb:21:in `read'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/encrypted_configuration.rb:33:in `config'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/encrypted_configuration.rb:38:in `options'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/core_ext/module/delegation.rb:303:in `method_missing'/home/ec2-user/prodata/lib/jumpstart/lib/jumpstart/omniauth.rb:55:in `credentials_for'/home/ec2-user/prodata/lib/jumpstart/lib/jumpstart/omniauth.rb:45:in `has_credentials?'/home/ec2-user/prodata/lib/jumpstart/lib/jumpstart/omniauth.rb:21:in `block in enabled_providers'/home/ec2-user/prodata/lib/jumpstart/lib/jumpstart/omniauth.rb:20:in `each'/home/ec2-user/prodata/lib/jumpstart/lib/jumpstart/omniauth.rb:20:in `enabled_providers'/home/ec2-user/prodata/config/initializers/devise.rb:312:in `block in <main>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/devise-4.7.2/lib/devise.rb:307:in `setup'/home/ec2-user/prodata/config/initializers/devise.rb:5:in `<main>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:318:in `block in load'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:291:in `load_dependency'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:318:in `load'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/engine.rb:666:in `block in load_config_initializer'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/notifications.rb:182:in `instrument'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/engine.rb:665:in `load_config_initializer'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/engine.rb:625:in `block (2 levels) in <class:Engine>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/engine.rb:624:in `each'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/engine.rb:624:in `block in <class:Engine>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/initializable.rb:32:in `instance_exec'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/initializable.rb:32:in `run'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/initializable.rb:61:in `block in run_initializers'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/initializable.rb:50:in `each'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/initializable.rb:50:in `tsort_each_child'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/initializable.rb:60:in `run_initializers'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/application.rb:363:in `initialize!'/home/ec2-user/prodata/config/environment.rb:5:in `<main>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:324:in `block in require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:291:in `load_dependency'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:324:in `require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/application.rb:339:in `require_environment!'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/application.rb:523:in `block in run_tasks_blocks'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/commands/rake/rake_command.rb:20:in `perform'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/command.rb:48:in `invoke'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.3/lib/rails/commands.rb:18:in `<main>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:324:in `block in require'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:291:in `load_dependency'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.3/lib/active_support/dependencies.rb:324:in `require'/home/ec2-user/prodata/bin/rails:9:in `<top (required)>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/spring-2.1.1/bin/spring:49:in `<top (required)>'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load'/home/ec2-user/.rvm/gems/ruby-2.7.1/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>'/home/ec2-user/prodata/bin/spring:15:in `<top (required)>'bin/rails:3:in `load'bin/rails:3:in `<main>'Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create => db:load_config => environment(See full trace by running task with --trace)
Chris Oliver
To use RDS, you'll have to set DATABASE_URL env var to point to your RDS instance URL so Rails can talk to it.
Notifications
You’re not receiving notifications from this thread.