Question

Setting up Sidekiq with a Rails application on Digital Ocean Apps

I have setup a worker running Sidekiq that makes use of a Redis database but I can’t get past the following error (see below). Is there a way to get past this using a worker instance?

I had the same error on the Rails app that goes with it but adding the following to production.rb solved it:

  # Digital Ocean Apps fix:
  config.active_record.cache_versioning = false

Both the Rails and the Sidekiq component are cloned from the same repository so I assume it should take on the same configuration. Could it be the command I’m using on the Sidekiq side?

bundle exec sidekiq -C config/sidekiq.yml

The error I get is:

[2022-07-13 11:52:52] 2022-07-13T11:52:52.255Z pid=1 tid=349 WARN: RuntimeError: 
[2022-07-13 11:52:52] You're using a cache store that doesn't support native cache versioning.
[2022-07-13 11:52:52] Your best option is to upgrade to a newer version of ActiveSupport::Cache::RedisStore
[2022-07-13 11:52:52] that supports cache versioning (ActiveSupport::Cache::RedisStore.supports_cache_versioning? #=> true).
[2022-07-13 11:52:52] 
[2022-07-13 11:52:52] Next best, switch to a different cache store that does support cache versioning:
[2022-07-13 11:52:52] https://guides.rubyonrails.org/caching_with_rails.html#cache-stores.
[2022-07-13 11:52:52] 
[2022-07-13 11:52:52] To keep using the current cache store, you can turn off cache versioning entirely:
[2022-07-13 11:52:52] 
[2022-07-13 11:52:52]     config.active_record.cache_versioning = false
[2022-07-13 11:52:52] 
[2022-07-13 11:52:52] 
[2022-07-13 11:52:52] 2022-07-13T11:52:52.255Z pid=1 tid=349 WARN: /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.1/lib/active_record/railtie.rb:118:in `block (3 levels) in <class:Railtie>'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.1/lib/active_support/lazy_load_hooks.rb:71:in `class_eval'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.1/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.1/lib/active_support/lazy_load_hooks.rb:61:in `with_execution_control'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.1/lib/active_support/lazy_load_hooks.rb:66:in `execute_hook'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.1/lib/active_support/lazy_load_hooks.rb:43:in `block in on_load'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.1/lib/active_support/lazy_load_hooks.rb:42:in `each'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.1/lib/active_support/lazy_load_hooks.rb:42:in `on_load'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.1/lib/active_record/railtie.rb:115:in `block (2 levels) in <class:Railtie>'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.1/lib/active_support/lazy_load_hooks.rb:68:in `block in execute_hook'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.1/lib/active_support/lazy_load_hooks.rb:61:in `with_execution_control'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.1/lib/active_support/lazy_load_hooks.rb:66:in `execute_hook'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.1/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.1/lib/active_support/lazy_load_hooks.rb:51:in `each'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.1/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/railties-7.0.1/lib/rails/application/finisher.rb:85:in `block in <module:Finisher>'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/railties-7.0.1/lib/rails/initializable.rb:32:in `instance_exec'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/railties-7.0.1/lib/rails/initializable.rb:32:in `run'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/railties-7.0.1/lib/rails/initializable.rb:61:in `block in run_initializers'
[2022-07-13 11:52:52] /layers/heroku_ruby/ruby/vendor/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
[2022-07-13 11:52:52] /layers/heroku_ruby/ruby/vendor/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
[2022-07-13 11:52:52] /layers/heroku_ruby/ruby/vendor/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
[2022-07-13 11:52:52] /layers/heroku_ruby/ruby/vendor/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
[2022-07-13 11:52:52] /layers/heroku_ruby/ruby/vendor/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:347:in `each'
[2022-07-13 11:52:52] /layers/heroku_ruby/ruby/vendor/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:347:in `call'
[2022-07-13 11:52:52] /layers/heroku_ruby/ruby/vendor/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
[2022-07-13 11:52:52] /layers/heroku_ruby/ruby/vendor/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
[2022-07-13 11:52:52] /layers/heroku_ruby/ruby/vendor/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/railties-7.0.1/lib/rails/initializable.rb:60:in `run_initializers'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/railties-7.0.1/lib/rails/application.rb:372:in `initialize!'
[2022-07-13 11:52:52] /workspace/config/environment.rb:5:in `<top (required)>'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/sidekiq-6.4.2/lib/sidekiq/cli.rb:273:in `require'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/sidekiq-6.4.2/lib/sidekiq/cli.rb:273:in `boot_application'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/sidekiq-6.4.2/lib/sidekiq/cli.rb:37:in `run'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/sidekiq-6.4.2/bin/sidekiq:31:in `<top (required)>'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/bin/sidekiq:25:in `load'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/bin/sidekiq:25:in `<top (required)>'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/cli/exec.rb:58:in `load'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/cli/exec.rb:58:in `kernel_load'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/cli/exec.rb:23:in `run'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/cli.rb:483:in `exec'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/cli.rb:31:in `dispatch'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/cli.rb:25:in `start'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/exe/bundle:48:in `block in <top (required)>'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
[2022-07-13 11:52:52] /layers/heroku_ruby/gems/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/exe/bundle:36:in `<top (required)>'
[2022-07-13 11:52:52] /workspace/bin/bundle:113:in `load'
[2022-07-13 11:52:52] /workspace/bin/bundle:113:in `<main>'
[]

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

for anyone looking for answers about that, i found this video : https://www.youtube.com/watch?v=3xzMFCAf5EE&ab_channel=MichielSikkes