redis-rb
redis-rb copied to clipboard
scan_each getting NPE
NoMethodError: undefined method `each' for nil:NilClass
/usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:2668:in `block in scan_each'
/usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:2666:in `loop'
/usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:2666:in `scan_each'
test/common_test_methods.rb:539:in `block in purge_tasks'
lib/v2/updates/redis_updates_processor.rb:15:in `block in with_redis'
/usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:2415:in `block in pipelined'
/usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:52:in `block in synchronize'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:52:in `synchronize'
/usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:2411:in `pipelined'
lib/v2/updates/redis_updates_processor.rb:15:in `with_redis'
test/common_test_methods.rb:525:in `purge_tasks'
test/unit/client_remarketing_campaign_factory_test.rb:93:in `block (2 levels) in <class:ClientRemarketingCampaignFactoryTest>'
test/common_test_methods.rb:166:in `as_dealer_sem'
test/unit/client_remarketing_campaign_factory_test.rb:44:in `block in <class:ClientRemarketingCampaignFactoryTest>'
# test/common_test_methods.rb:539
redis.scan_each(match: "#{account.id}:*") do |key|
redis.del(key)
end
Looks like a dupe of https://github.com/redis/redis-rb/issues/624 but that closed 3.5y ago and I assume is in 4.1.3.
Could you provide some context? A repro script would be ideal, but at the very least a non truncated backtrace, and the command and parameters?
@dmitchell
Which version of redis are you using? Are you using fakeredis (as mentioned in the linked issue)?
Closing as non actionable