title: ERROR: heartbeat: Connection lost (ECONNRESET) in sidekiq
body: <p>I'm trying to run Sidekiq 5.2.2 on Rails 5.2 but I always get a connection lost error. Below are my server logs:</p>
  
  <pre><code># bundle exec sidekiq -q v2_default,2 -q v2_low -e production
  TID-2yed0 INFO: Booting Sidekiq 5.2.2 with redis options {:url=&gt;"redis://myserver.lmf979.0001.apse1.cache.amazonaws.com:6379/1", :network_timeout=&gt;7, :id=&gt;"Sidekiq-server-PID-3644"}
  TID-2yed0 INFO: Running in ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-linux]
  TID-2yed0 INFO: See LICENSE and the LGPL-3.0 for licensing details.
  TID-2yed0 INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org
  TID-2yed0 INFO: Starting processing, hit Ctrl-C to stop
  TID-19spa0 ERROR: heartbeat: Connection lost (ECONNRESET)
  TID-xhh1g ERROR: Error fetching job: READONLY You can't write against a read only slave.
  TID-xhh1g WARN: Redis::CommandError: READONLY You can't write against a read only slave.
  TID-xhh1g WARN: /usr/local/rvm/gems/ruby-2.3.5/gems/redis-4.0.2/lib/redis/client.rb:119:in `call'
  </code></pre>
  
  <p>and this is my config/initializers/sidekiq.rb</p>
  
  <pre><code>Sidekiq.configure_server do |config|
      config.redis = { url: 'redis://myserver.lmf979.0001.apse1.cache.amazonaws.com:6379/1', network_timeout: 7 }
  end
  
  Sidekiq.configure_client do |config|
      config.redis = { url: 'redis://myserver.lmf979.0001.apse1.cache.amazonaws.com:6379/1', network_timeout: 7 }
  end
  </code></pre>
  
  <p>I verify that I can do ping PONG with the server but I don't know why sidekiq can't connect.</p>
  
  <pre><code># rails c production
  Running via Spring preloader in process 7372
  Loading production environment (Rails 5.2.1)
  2.3.5 :001 &gt; require "redis"
   =&gt; false 
  2.3.5 :002 &gt; redis = Redis.new(url: 'redis://myserver.lmf979.0001.apse1.cache.amazonaws.com:6379/1')
   =&gt; #&lt;Redis client v4.0.2 for redis://myserver.lmf979.0001.apse1.cache.amazonaws.com:6379/1&gt; 
  2.3.5 :003 &gt; redis.ping
   =&gt; "PONG" 
  2.3.5 :004 &gt; 
  </code></pre>
  
  <p>Any ideas?</p>