Expected behaviour
The feed regen task bin/tootctl feeds build --all should complete successfully
Actual behaviour
The task bin/tootctl feeds build --all crashes with the following stack trace:
Traceback (most recent call last):
32: from bin/tootctl:5:in `<main>'
31: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
30: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
29: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
28: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
27: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:238:in `block in subcommand'
26: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:115:in `invoke'
25: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
24: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
23: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
22: from /home/mastodon/live/lib/mastodon/feeds_cli.rb:39:in `build'
21: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/relation/batches.rb:135:in `find_in_batches'
20: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/relation/batches.rb:222:in `in_batches'
19: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/relation/batches.rb:222:in `loop'
18: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/relation/batches.rb:238:in `block in in_batches'
17: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/relation/batches.rb:136:in `block in find_in_batches'
16: from /home/mastodon/live/lib/mastodon/feeds_cli.rb:44:in `block in build'
15: from /home/mastodon/live/lib/mastodon/feeds_cli.rb:44:in `each'
14: from /home/mastodon/live/lib/mastodon/feeds_cli.rb:45:in `block (2 levels) in build'
13: from /home/mastodon/live/app/workers/regeneration_worker.rb:10:in `perform'
12: from /home/mastodon/live/app/services/precompute_feed_service.rb:5:in `call'
11: from /home/mastodon/live/app/lib/feed_manager.rb:129:in `populate_feed'
10: from /home/mastodon/live/app/lib/feed_manager.rb:129:in `loop'
9: from /home/mastodon/live/app/lib/feed_manager.rb:135:in `block in populate_feed'
8: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/relation/delegation.rb:71:in `each'
7: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/relation/delegation.rb:71:in `each'
6: from /home/mastodon/live/app/lib/feed_manager.rb:136:in `block (2 levels) in populate_feed'
5: from /home/mastodon/live/app/lib/feed_manager.rb:164:in `filter_from_home?'
4: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/core.rb:167:in `find'
3: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/querying.rb:5:in `find'
2: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/relation/finder_methods.rb:69:in `find'
1: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/relation/finder_methods.rb:435:in `find_with_ids'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/relation/finder_methods.rb:447:in `find_one': You are passing an instance of ActiveRecord::Base to `find`. Please pass the id of the object by calling `.id`. (ArgumentError)
Steps to reproduce the problem
From the project root, run bin/tootctl feeds build --all.
Specifications
This was found in v1.0.1+2.9.3, running on Ubuntu 16.04.6 LTS
I've got a fix for this that I'm going to post shortly
Expected behaviour
The feed regen task
bin/tootctl feeds build --allshould complete successfullyActual behaviour
The task
bin/tootctl feeds build --allcrashes with the following stack trace:Steps to reproduce the problem
From the project root, run
bin/tootctl feeds build --all.Specifications
This was found in
v1.0.1+2.9.3, running on Ubuntu 16.04.6 LTSI've got a fix for this that I'm going to post shortly