GOOGLE ADS

суббота, 7 мая 2022 г.

Ошибка Heroku: «ключ должен быть 16 байт», но ключ, который я ввел, равен 16 байтам.

Я впервые запускаю Heroku и получаю сообщение об ошибке «ArgumentError: ключ должен быть 16 байт».

Я побежал, rails credentials:editчтобы сгенерировать новый ключ, получил ключ из 32 символов, запустил, heroku config:set RAILS_MASTER_KEY='<master key>'и он был принят. Но я все еще получаю ошибку, когда я запускаю его.

Я не уверен, что я делаю неправильно.

Вот полное сообщение об ошибке:

Running: rake assets:precompile
rake aborted!
ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:183:in `_decrypt'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/encrypted_file.rb:79:in `decrypt'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/encrypted_file.rb:42:in `read'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:21:in `read'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:33:in `config'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:38:in `options'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/secret_key_finder.rb:24:in `key_exists?'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/secret_key_finder.rb:10:in `find'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/rails.rb:37:in `block in <class:Engine>'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!'
/tmp/build_e151bdf198daf12c42102939c20b0959/config/environment.rb:7:in `<top (required)>'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:337:in `require_environment!'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
Caused by:
ArgumentError: key must be 16 bytes
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:193:in `key='
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:193:in `_decrypt'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/encrypted_file.rb:79:in `decrypt'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/encrypted_file.rb:42:in `read'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:21:in `read'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:33:in `config'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:38:in `options'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/secret_key_finder.rb:24:in `key_exists?'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/secret_key_finder.rb:10:in `find'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/rails.rb:37:in `block in <class:Engine>'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!'
/tmp/build_e151bdf198daf12c42102939c20b0959/config/environment.rb:7:in `<top (required)>'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:337:in `require_environment!'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
/tmp/build_e151bdf198daf12c42102939c20b0959/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app.
! Push failed

Решение проблемы

Первоначально вокруг команды установки конфигурации главного ключа были заключены кавычки, например: '<master key>'что Heroku интерпретирует как часть главного ключа.

Просто для потомков я оставлю правильно отформатированную команду, с которой мы разобрались, в комментариях:

$ heroku config:set RAILS_MASTER_KEY=<master key>

Комментариев нет:

Отправить комментарий

Laravel Datatable addColumn returns ID of one record only

Я пытаюсь использовать Yajra Datatable для интеграции DataTable на свой веб-сайт. Я смог отобразить таблицу, но столкнулся с проблемой. В по...