簡體   English   中英

嘗試部署Rails 5.2.0 App時在日志中獲取錯誤ActiveSupport :: MessageEncryptor :: InvalidMessage

[英]Getting error in logs ActiveSupport::MessageEncryptor::InvalidMessage when try to deploy Rails 5.2.0 App

我正在嘗試使用mina deploy在ec2實例上部署Rails 5.2.0 App,當它嘗試遷移數據庫時,它會因以下錯誤日志而中止。

    -----> Migrating database
       WARNING: Use strings for Figaro configuration. 2 was converted to "2".
       WARNING: Use strings for Figaro configuration. 5 was converted to "5".
       I, [2018-07-07T15:15:56.316810 #15933]  INFO -- sentry: ** [Raven] Raven 2.7.4 ready to catch errors
       I, [2018-07-07T15:15:56.579121 #15933]  INFO -- sentry: ** [Raven] Raven 2.7.4 ready to catch errors
       [Simple Form] Simple Form is not configured in the application and will use the default values. Use `rails generate simple_form:install` to generate the Simple Form configuration.
       rake aborted!
       ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:183:in `_decrypt'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:79:in `decrypt'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:42:in `read'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:21:in `read'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:33:in `config'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:38:in `options'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:433:in `secret_key_base'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:176:in `key_generator'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/globalid-0.4.1/lib/global_id/railtie.rb:26:in `block (2 levels) in <class:Railtie>'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:51:in `each'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application/finisher.rb:75:in `block in <module:Finisher>'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
       /var/www/myApp.com/tmp/build-153097655127872/config/environment.rb:5:in `<main>'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:337:in `require_environment!'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:520:in `block in run_tasks_blocks'
       /var/www/myApp.com/tmp/build-153097655127872/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:74:in `load'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:28:in `run'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/cli.rb:424:in `exec'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/cli.rb:27:in `dispatch'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/cli.rb:18:in `start'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/exe/bundle:30:in `block in <top (required)>'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/exe/bundle:22:in `<top (required)>'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `load'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `<main>'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:15:in `eval'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:15:in `<main>'

       Caused by:
       ArgumentError: invalid base64
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:185:in `block in _decrypt'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:185:in `map'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:185:in `_decrypt'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:79:in `decrypt'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:42:in `read'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:21:in `read'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:33:in `config'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:38:in `options'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:433:in `secret_key_base'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:176:in `key_generator'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/globalid-0.4.1/lib/global_id/railtie.rb:26:in `block (2 levels) in <class:Railtie>'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:51:in `each'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application/finisher.rb:75:in `block in <module:Finisher>'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
       /var/www/myApp.com/tmp/build-153097655127872/config/environment.rb:5:in `<main>'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:337:in `require_environment!'
       /var/www/myApp.com/shared/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:520:in `block in run_tasks_blocks'
       /var/www/myApp.com/tmp/build-153097655127872/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:74:in `load'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:28:in `run'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/cli.rb:424:in `exec'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/cli.rb:27:in `dispatch'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/cli.rb:18:in `start'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/exe/bundle:30:in `block in <top (required)>'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/exe/bundle:22:in `<top (required)>'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `load'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `<main>'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:15:in `eval'
       /home/ubuntu/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:15:in `<main>'
       Tasks: TOP => db:migrate => db:load_config => environment
       (See full trace by running task with --trace)
 !     ERROR: Deploy failed.
-----> Cleaning up build
       Unlinking current
       OK

我的Rails應用程序中有有效的config/credentials.yml.encmaster.key 因為,我在本地計算機上嘗試了RAILS_ENV='production' rails命令,即rails db:create,rails db:migrate等。

我已經在我的ubuntu服務器上的/ app_name / shared / config /上添加了master.key文件。 但是仍然遇到這個問題。

您需要將SECRET_KEY_BASE = 'Your_SECRET_KEY_BASE'添加到環境中!

我遇到了同樣的問題。 相信我,按照https://blog.xuite.net/yhunglee/blog/585116240-Problems+of+deploying+rails+5.2.0+to+production可以解決此問題。

<activesupport::messageencryptor::invalidmessage: activesupport::messageencryptor::invalidmessage error when deploying to heroku rails 5.2.3< div><div id="text_translate"><p> 我在將我的 React on Rails 應用程序部署到 Heroku 時遇到了很多麻煩。 我已經閱讀並嘗試了無數關於如何解決 secret_key_base 和 rails_master_key 問題的帖子:</p><p> <a href="https://stackoverflow.com/questions/54277392/activesupportmessageencryptorinvalidmessage" rel="nofollow noreferrer">ActiveSupport::MessageEncryptor::InvalidMessage</a></p><p> <a href="https://stackoverflow.com/questions/50102639/running-a-rails-server-in-production-locally-invalidmessage-error" rel="nofollow noreferrer">在本地運行 Rails 服務器(InvalidMessage 錯誤)</a></p><p> 對這些都沒有任何運氣,並且似乎對用於解決這些問題的許多實踐進行了很好的辯論(從我讀過的答案來看)。</p><p> 這是我在 Heroku 日志中遇到的錯誤:</p><pre> 2019-10-23T15:27:31.187947+00:00 app[web.1]: 2019-10-23 15:27:31 +0000: Rack app error handling request { GET / } 2019-10-23T15:27:31.18796+00:00 app[web.1]: #&lt;ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage&gt; 2019-10-23T15:27:31.187962+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt' 2019-10-23T15:27:31.187964+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:184:in `_decrypt' 2019-10-23T15:27:31.187966+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify' 2019-10-23T15:27:31.187968+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify' 2019-10-23T15:27:31.187971+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:44:in `decrypt' 2019-10-23T15:27:31.187973+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:81:in `preprocess' 2019-10-23T15:27:31.187975+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:29:in `block in parse' 2019-10-23T15:27:31.187977+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each' 2019-10-23T15:27:31.187979+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each_with_object' 2019-10-23T15:27:31.187981+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `parse' 2019-10-23T15:27:31.187983+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:399:in `secrets' 2019-10-23T15:27:31.187985+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:252:in `env_config' 2019-10-23T15:27:31.187987+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:706:in `build_request' 2019-10-23T15:27:31.18799+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:608:in `build_request' 2019-10-23T15:27:31.187992+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:523:in `call' 2019-10-23T15:27:31.187994+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/configuration.rb:227:in `call' 2019-10-23T15:27:31.187996+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:660:in `handle_request' 2019-10-23T15:27:31.187997+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:474:in `process_client' 2019-10-23T15:27:31.187999+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:334:in `block in run' 2019-10-23T15:27:31.188001+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/thread_pool.rb:135:in `block in spawn_thread' 2019-10-23T15:27:31.447079+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=glacial-woodland-16769.herokuapp.com request_id=922c9b94-3b2b-43fd-9cec-b5eb2d78e21f fwd="8.20.20.246" dyno=web.1 connect=1ms service=16ms status=500 bytes=154 protocol=https 2019-10-23T15:27:31.445658+00:00 app[web.1]: 2019-10-23 15:27:31 +0000: Rack app error handling request { GET /favicon.ico } 2019-10-23T15:27:31.445671+00:00 app[web.1]: #&lt;ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage&gt; 2019-10-23T15:27:31.445673+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt' 2019-10-23T15:27:31.445675+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:184:in `_decrypt' 2019-10-23T15:27:31.445677+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify' 2019-10-23T15:27:31.445679+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify' 2019-10-23T15:27:31.445681+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:44:in `decrypt' 2019-10-23T15:27:31.445683+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:81:in `preprocess' 2019-10-23T15:27:31.445685+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:29:in `block in parse' 2019-10-23T15:27:31.445687+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each' 2019-10-23T15:27:31.445688+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each_with_object' 2019-10-23T15:27:31.44569+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `parse' 2019-10-23T15:27:31.445693+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:399:in `secrets' 2019-10-23T15:27:31.445695+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:252:in `env_config' 2019-10-23T15:27:31.445697+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:706:in `build_request' 2019-10-23T15:27:31.445699+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:608:in `build_request' 2019-10-23T15:27:31.445701+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:523:in `call' 2019-10-23T15:27:31.445703+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/configuration.rb:227:in `call' 2019-10-23T15:27:31.445705+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:660:in `handle_request' 2019-10-23T15:27:31.445707+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:474:in `process_client' 2019-10-23T15:27:31.445709+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:334:in `block in run' 2019-10-23T15:27:31.446389+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/thread_pool.rb:135:in `block in spawn_thread'</pre><p> 將不勝感激任何幫助,並可以提供我可能遺漏的任何細節。 我對 Heroku 比較陌生,所以我可能只是忽略了一些明顯的事情,如果是這種情況,我深表歉意!</p></div></activesupport::messageencryptor::invalidmessage:>

[英]<ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage Error when deploying to Heroku Rails 5.2.3

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

相關問題 Rails 5.2.0加載應用程序錯誤:ActiveSupport :: MessageEncryptor :: InvalidMessage(ActiveSupport :: MessageEncryptor :: InvalidMessage <activesupport::messageencryptor::invalidmessage: activesupport::messageencryptor::invalidmessage error when deploying to heroku rails 5.2.3< div><div id="text_translate"><p> 我在將我的 React on Rails 應用程序部署到 Heroku 時遇到了很多麻煩。 我已經閱讀並嘗試了無數關於如何解決 secret_key_base 和 rails_master_key 問題的帖子:</p><p> <a href="https://stackoverflow.com/questions/54277392/activesupportmessageencryptorinvalidmessage" rel="nofollow noreferrer">ActiveSupport::MessageEncryptor::InvalidMessage</a></p><p> <a href="https://stackoverflow.com/questions/50102639/running-a-rails-server-in-production-locally-invalidmessage-error" rel="nofollow noreferrer">在本地運行 Rails 服務器(InvalidMessage 錯誤)</a></p><p> 對這些都沒有任何運氣,並且似乎對用於解決這些問題的許多實踐進行了很好的辯論(從我讀過的答案來看)。</p><p> 這是我在 Heroku 日志中遇到的錯誤:</p><pre> 2019-10-23T15:27:31.187947+00:00 app[web.1]: 2019-10-23 15:27:31 +0000: Rack app error handling request { GET / } 2019-10-23T15:27:31.18796+00:00 app[web.1]: #&lt;ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage&gt; 2019-10-23T15:27:31.187962+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt' 2019-10-23T15:27:31.187964+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:184:in `_decrypt' 2019-10-23T15:27:31.187966+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify' 2019-10-23T15:27:31.187968+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify' 2019-10-23T15:27:31.187971+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:44:in `decrypt' 2019-10-23T15:27:31.187973+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:81:in `preprocess' 2019-10-23T15:27:31.187975+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:29:in `block in parse' 2019-10-23T15:27:31.187977+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each' 2019-10-23T15:27:31.187979+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each_with_object' 2019-10-23T15:27:31.187981+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `parse' 2019-10-23T15:27:31.187983+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:399:in `secrets' 2019-10-23T15:27:31.187985+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:252:in `env_config' 2019-10-23T15:27:31.187987+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:706:in `build_request' 2019-10-23T15:27:31.18799+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:608:in `build_request' 2019-10-23T15:27:31.187992+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:523:in `call' 2019-10-23T15:27:31.187994+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/configuration.rb:227:in `call' 2019-10-23T15:27:31.187996+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:660:in `handle_request' 2019-10-23T15:27:31.187997+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:474:in `process_client' 2019-10-23T15:27:31.187999+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:334:in `block in run' 2019-10-23T15:27:31.188001+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/thread_pool.rb:135:in `block in spawn_thread' 2019-10-23T15:27:31.447079+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=glacial-woodland-16769.herokuapp.com request_id=922c9b94-3b2b-43fd-9cec-b5eb2d78e21f fwd="8.20.20.246" dyno=web.1 connect=1ms service=16ms status=500 bytes=154 protocol=https 2019-10-23T15:27:31.445658+00:00 app[web.1]: 2019-10-23 15:27:31 +0000: Rack app error handling request { GET /favicon.ico } 2019-10-23T15:27:31.445671+00:00 app[web.1]: #&lt;ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage&gt; 2019-10-23T15:27:31.445673+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt' 2019-10-23T15:27:31.445675+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:184:in `_decrypt' 2019-10-23T15:27:31.445677+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify' 2019-10-23T15:27:31.445679+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify' 2019-10-23T15:27:31.445681+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:44:in `decrypt' 2019-10-23T15:27:31.445683+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:81:in `preprocess' 2019-10-23T15:27:31.445685+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:29:in `block in parse' 2019-10-23T15:27:31.445687+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each' 2019-10-23T15:27:31.445688+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each_with_object' 2019-10-23T15:27:31.44569+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `parse' 2019-10-23T15:27:31.445693+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:399:in `secrets' 2019-10-23T15:27:31.445695+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:252:in `env_config' 2019-10-23T15:27:31.445697+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:706:in `build_request' 2019-10-23T15:27:31.445699+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:608:in `build_request' 2019-10-23T15:27:31.445701+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:523:in `call' 2019-10-23T15:27:31.445703+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/configuration.rb:227:in `call' 2019-10-23T15:27:31.445705+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:660:in `handle_request' 2019-10-23T15:27:31.445707+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:474:in `process_client' 2019-10-23T15:27:31.445709+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:334:in `block in run' 2019-10-23T15:27:31.446389+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/thread_pool.rb:135:in `block in spawn_thread'</pre><p> 將不勝感激任何幫助,並可以提供我可能遺漏的任何細節。 我對 Heroku 比較陌生,所以我可能只是忽略了一些明顯的事情,如果是這種情況,我深表歉意!</p></div></activesupport::messageencryptor::invalidmessage:> Rails部署Digitalocean ActiveSupport :: MessageEncryptor :: InvalidMessage: 導軌:ActiveSupport::MessageEncryptor::InvalidMessage Rails 6 Heroku Devise 錯誤 ActiveSupport::MessageEncryptor::InvalidMessage 如何修復憑據錯誤-ActiveSupport :: MessageEncryptor :: InvalidMessage Rails 5.2 with master.key Digital Ocean 部署:ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage 當最后一部分到達時,我正在嘗試在數字海洋中進行部署ActiveSupport :: MessageEncryptor :: InvalidMessage 上限生產部署| ActiveSupport::MessageEncryptor::InvalidMessage 原因:OpenSSL::Cipher::CipherError: GitHub Actions 上的 Rails Master Key 導致 ActiveSupport::MessageEncryptor::InvalidMessage
 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM