1
votes

I am using sidekiq 3.4.2 and redis 3.0.3 for some long running jobs and after about two~four hours I get the following error:

ERROR: heartbeat: EXECABORT Transaction discarded because of previous errors.

EXECABORT Transaction discarded because of previous errors. /home/deployer/apps/wripl-capture/shared/bundle/ruby/2.2.0/gems/redis-3.2.1/lib/redis/pipeline.rb:79:in finish' /home/deployer/apps/wripl-capture/shared/bundle/ruby/2.2.0/gems/redis-3.2.1/lib/redis/client.rb:149:in block in call_pipeline' /home/deployer/apps/wripl-capture/shared/bundle/ruby/2.2.0/gems/redis-3.2.1/lib/redis/client.rb:279:in with_reconnect' /home/deployer/apps/wripl-capture/shared/bundle/ruby/2.2.0/gems/redis-3.2.1/lib/redis/client.rb:147:in call_pipeline' /home/deployer/apps/wripl-capture/shared/bundle/ruby/2.2.0/gems/redis-3.2.1/lib/redis.rb:2182:in block in multi' /home/deployer/apps/wripl-capture/shared/bundle/ruby/2.2.0/gems/redis-3.2.1/lib/redis.rb:37:in block in synchronize' /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'

Everything is killed (no enqueued jobs ran) unless I restart sidekiq, which is not what I need to do.

Any idea what is happening?

4

4 Answers

4
votes

This can also happen due to empty multi command.

running redis-cli monitor I saw

1546789398.881549 [0 the-ip] "multi"
1546789398.881575 [0 the-ip] "exec"

Before executing multi, make sure that you have at least 1 command to execute on the transaction.

3
votes

I'd guess your Redis instance is out of memory.

2
votes

multi block is suppressing the actual error message. Run your code without the multi block to see the original error message.

I tried to run the entire code in mutli block within a try/rescue block, it still didn't catch the exception.

0
votes

Whatever command you are running through your code, try to run same commands through redis-cli.

You may get the actual error.

In my case actual error was :

HSET some_key some_field some_value

(error) NOREPLICAS Not enough good slaves to write.