Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

Issues connecting Sidekiq to Redis

$
0
0

I have found a piece of open source code that I have slightly re-factored in order to ensure the use of updated dependencies.

The open source code uses 3 dockerfiles to run as containers which should in turn run the application, however when trying to run the last one, it exits with the following error message.

You can find a link to the open-source code here- https://github.com/quadziginc/quadzig

Please note the following general changes I have made:Updated all dependencies to their latest major version where applicable.Made some config changes to Webpacker as this is now redundant and is now Shakapacka.Changed the Dockerfile base image due to ECR image now being redundant. - Changed to ruby alpine and added necessary build steps to install developer tools.

Error:

pid=1 tid=95h INFO: Sidekiq 7.2.0 connecting to Redis with options {:size=>10, :pool_name=>"internal", :url=>nil}Address not available - connect(2) for [::1]:6379/usr/local/lib/ruby/3.2.0/socket.rb:1217:in `__connect_nonblock'/usr/local/lib/ruby/3.2.0/socket.rb:1217:in `connect_nonblock'/usr/local/lib/ruby/3.2.0/socket.rb:60:in `connect_internal'/usr/local/lib/ruby/3.2.0/socket.rb:141:in `connect'/usr/local/lib/ruby/3.2.0/socket.rb:645:in `block in tcp'/usr/local/lib/ruby/3.2.0/socket.rb:231:in `each'/usr/local/lib/ruby/3.2.0/socket.rb:231:in `foreach'/usr/local/lib/ruby/3.2.0/socket.rb:635:in `tcp'/usr/local/bundle/gems/redis-client-0.18.0/lib/redis_client/ruby_connection.rb:117:in `connect'/usr/local/bundle/gems/redis-client-0.18.0/lib/redis_client/ruby_connection.rb:49:in `initialize'/usr/local/bundle/gems/redis-client-0.18.0/lib/redis_client.rb:720:in `new'/usr/local/bundle/gems/redis-client-0.18.0/lib/redis_client.rb:720:in `block in connect'/usr/local/bundle/gems/redis-client-0.18.0/lib/redis_client/middlewares.rb:12:in `connect'/usr/local/bundle/gems/redis-client-0.18.0/lib/redis_client.rb:719:in `connect'/usr/local/bundle/gems/redis-client-0.18.0/lib/redis_client.rb:706:in `raw_connection'/usr/local/bundle/gems/redis-client-0.18.0/lib/redis_client.rb:673:in `ensure_connected'/usr/local/bundle/gems/redis-client-0.18.0/lib/redis_client.rb:254:in `call'/usr/local/bundle/gems/sidekiq-7.2.0/lib/sidekiq/redis_client_adapter.rb:36:in `block (2 levels) in <module:CompatMethods>'/usr/local/bundle/gems/sidekiq-cron-1.11.0/lib/sidekiq/cron/job.rb:377:in `block in status_from_redis'/usr/local/bundle/gems/sidekiq-7.2.0/lib/sidekiq/config.rb:163:in `block in redis'/usr/local/bundle/gems/connection_pool-2.4.1/lib/connection_pool.rb:110:in `block (2 levels) in with'/usr/local/bundle/gems/connection_pool-2.4.1/lib/connection_pool.rb:109:in `handle_interrupt'/usr/local/bundle/gems/connection_pool-2.4.1/lib/connection_pool.rb:109:in `block in with'/usr/local/bundle/gems/connection_pool-2.4.1/lib/connection_pool.rb:106:in `handle_interrupt'/usr/local/bundle/gems/connection_pool-2.4.1/lib/connection_pool.rb:106:in `with'/usr/local/bundle/gems/sidekiq-7.2.0/lib/sidekiq/config.rb:160:in `redis'/usr/local/bundle/gems/sidekiq-7.2.0/lib/sidekiq.rb:73:in `redis'/usr/local/bundle/gems/sidekiq-cron-1.11.0/lib/sidekiq/cron/job.rb:376:in `status_from_redis'/usr/local/bundle/gems/sidekiq-cron-1.11.0/lib/sidekiq/cron/job.rb:286:in `initialize'/usr/local/bundle/gems/sidekiq-cron-1.11.0/lib/sidekiq/cron/job.rb:254:in `new'/usr/local/bundle/gems/sidekiq-cron-1.11.0/lib/sidekiq/cron/job.rb:254:in `create'/app/config/initializers/9999_sidekiq_schedulers.rb:33:in `<main>'/usr/local/bundle/gems/railties-7.0.8/lib/rails/engine.rb:667:in `load'/usr/local/bundle/gems/railties-7.0.8/lib/rails/engine.rb:667:in `block in load_config_initializer'/usr/local/bundle/gems/activesupport-7.0.8/lib/active_support/notifications.rb:208:in `instrument'/usr/local/bundle/gems/railties-7.0.8/lib/rails/engine.rb:666:in `load_config_initializer'/usr/local/bundle/gems/railties-7.0.8/lib/rails/engine.rb:620:in `block (2 levels) in <class:Engine>'/usr/local/bundle/gems/railties-7.0.8/lib/rails/engine.rb:619:in `each'/usr/local/bundle/gems/railties-7.0.8/lib/rails/engine.rb:619:in `block in <class:Engine>'/usr/local/bundle/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `instance_exec'/usr/local/bundle/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `run'/usr/local/bundle/gems/railties-7.0.8/lib/rails/initializable.rb:61:in `block in run_initializers'/usr/local/lib/ruby/3.2.0/tsort.rb:228:in `block in tsort_each'/usr/local/lib/ruby/3.2.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'/usr/local/lib/ruby/3.2.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'/usr/local/lib/ruby/3.2.0/tsort.rb:431:in `each_strongly_connected_component_from'/usr/local/lib/ruby/3.2.0/tsort.rb:421:in `block in each_strongly_connected_component_from'/usr/local/bundle/gems/railties-7.0.8/lib/rails/initializable.rb:50:in `each'/usr/local/bundle/gems/railties-7.0.8/lib/rails/initializable.rb:50:in `tsort_each_child'/usr/local/lib/ruby/3.2.0/tsort.rb:415:in `call'/usr/local/lib/ruby/3.2.0/tsort.rb:415:in `each_strongly_connected_component_from'/usr/local/lib/ruby/3.2.0/tsort.rb:349:in `block in each_strongly_connected_component'/usr/local/lib/ruby/3.2.0/tsort.rb:347:in `each'/usr/local/lib/ruby/3.2.0/tsort.rb:347:in `call'/usr/local/lib/ruby/3.2.0/tsort.rb:347:in `each_strongly_connected_component'/usr/local/lib/ruby/3.2.0/tsort.rb:226:in `tsort_each'/usr/local/lib/ruby/3.2.0/tsort.rb:205:in `tsort_each'/usr/local/bundle/gems/railties-7.0.8/lib/rails/initializable.rb:60:in `run_initializers'/usr/local/bundle/gems/railties-7.0.8/lib/rails/application.rb:372:in `initialize!'/app/config/environment.rb:5:in `<top (required)>'/usr/local/bundle/gems/sidekiq-7.2.0/lib/sidekiq/cli.rb:303:in `require'/usr/local/bundle/gems/sidekiq-7.2.0/lib/sidekiq/cli.rb:303:in `boot_application'/usr/local/bundle/gems/sidekiq-7.2.0/lib/sidekiq/cli.rb:42:in `run'/usr/local/bundle/gems/sidekiq-7.2.0/bin/sidekiq:31:in `<top (required)>'/usr/local/bundle/bin/sidekiq:25:in `load'/usr/local/bundle/bin/sidekiq:25:in `<top (required)>'/usr/local/bundle/gems/bundler-2.4.2/lib/bundler/cli/exec.rb:58:in `load'/usr/local/bundle/gems/bundler-2.4.2/lib/bundler/cli/exec.rb:58:in `kernel_load'/usr/local/bundle/gems/bundler-2.4.2/lib/bundler/cli/exec.rb:23:in `run'/usr/local/bundle/gems/bundler-2.4.2/lib/bundler/cli.rb:491:in `exec'/usr/local/bundle/gems/bundler-2.4.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'/usr/local/bundle/gems/bundler-2.4.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'/usr/local/bundle/gems/bundler-2.4.2/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'/usr/local/bundle/gems/bundler-2.4.2/lib/bundler/cli.rb:34:in `dispatch'/usr/local/bundle/gems/bundler-2.4.2/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'/usr/local/bundle/gems/bundler-2.4.2/lib/bundler/cli.rb:28:in `start'/usr/local/bundle/gems/bundler-2.4.2/exe/bundle:45:in `block in <top (required)>'/usr/local/bundle/gems/bundler-2.4.2/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'/usr/local/bundle/gems/bundler-2.4.2/exe/bundle:33:in `<top (required)>'/usr/local/bundle/bin/bundle:25:in `load'/usr/local/bundle/bin/bundle:25:in `<main>'

Any help to resolve this would be much appreciated.

Many Thanks

Tried exposing port 6379 within Dockerfile.


Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>