Sidekiq 5 does not work with AWS ELB and 5 api rails

Ruby version: 2.3.1

Sidekiq / Pro / Enterprise Version (s): 5.0

Rails: 5.0.2

I followed this tutorial so I could use sidekiq to send emails in my rails api app. The app is published on AWS ElasticBeanstalk with Puma.

When a user signs up, they should receive an email (via the device). The error is not displayed, no log is generated in sidekiq.log. I don't know what's going on, the letters just don't get delivered.

/ Devise_async.rb initializers

Devise::Async.setup do |config|
  config.enabled = true
  config.backend = :sidekiq
  config.queue   = :default
end

      

Initializers / sidekiq.rb

rails_root = Rails.root || File.dirname(__FILE__) + '/../..'
rails_env = Rails.env || 'development'
redis_config = YAML.load_file(rails_root.to_s + '/config/redis.yml')
redis_config.merge! redis_config.fetch(Rails.env, {})
redis_config.symbolize_keys!
Sidekiq.configure_server do |config|
  config.redis = { url: "redis://#{redis_config[:host]}:#{redis_config[:port]}/12" }
end
Sidekiq.configure_client do |config|
  config.redis = { url: "redis://#{redis_config[:host]}:#{redis_config[:port]}/12" }
end

      

config / redis.yml

development:
 host: 'localhost'
 port: '6379'
test:
 host: 'localhost'
 port: '6379'
production:
 host: 'xxxxx-xxxx-xxx.xxxxxx.xx.0001.sae1.cache.amazonaws.com'
 port: '6379'

      

config / sidekiq.yml

:concurrency: 5
:queues:
  - default

      

The last lines of the sidekiq log:

2017-05-06T02:16:10.579Z 8388 TID-grwqwpuzw INFO: Received USR1, no longer accepting new work
2017-05-06T02:16:10.584Z 8399 TID-gp30plzqo INFO: Received USR1, no longer accepting new work

      

Last nginx log lines:

172.31.14.103 - - [06/May/2017:02:20:51 +0000] "POST /v1/auth/ HTTP/1.1" 200 271 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36"

2017/05/06 02:16:22 [warn] 15902#0: conflicting server name "localhost" on 0.0.0.0:80, ignored
2017/05/06 02:16:22 [warn] 15909#0: conflicting server name "localhost" on 0.0.0.0:80, ignored
2017/05/06 02:16:22 [warn] 15950#0: conflicting server name "localhost" on 0.0.0.0:80, ignored
2017/05/06 02:16:22 [warn] 15957#0: conflicting server name "localhost" on 0.0.0.0:80, ignored

      

The last lines of the puma log:

[11765] - Gracefully shutting down workers...
[11765] === puma shutdown: 2017-05-06 02:16:23 +0000 ===
[11765] - Goodbye!
=== puma startup: 2017-05-06 02:16:26 +0000 ===
=== puma startup: 2017-05-06 02:16:26 +0000 ===
/var/app/current/app/serializers/notification_serializer.rb:20: warning: redefining `object_id' may cause serious problems
[16011] - Worker 0 (pid: 16014) booted, phase: 0

      

It works fine on local machine.

Do you have any ideas?

+3


source to share





All Articles