animeavi / fedi_ebooks

Ebooks bot for the fediverse based on mispy's twitter_ebooks algorithm for reply generation
MIT License
16 stars 2 forks source link

Exception in scheduler #1

Open parkbanks opened 1 year ago

parkbanks commented 1 year ago

I've noticed the following error popup a few times since updating to the refactored version:

Exception caught in scheduler thread #<NoMethodError: undefined method `[]' for nil:NilClass>!

------------ Backtrace Below ------------
/home/ebooks/fedi_ebooks/mispy/model.rb:538:in `block (2 levels) in generate'
/home/ebooks/fedi_ebooks/mispy/model.rb:528:in `each'
/home/ebooks/fedi_ebooks/mispy/model.rb:528:in `block in generate'
/home/ebooks/fedi_ebooks/mispy/model.rb:524:in `upto'
/home/ebooks/fedi_ebooks/mispy/model.rb:524:in `generate'
/home/ebooks/fedi_ebooks/mispy/model.rb:596:in `generate_respoding'
/home/ebooks/fedi_ebooks/mispy/model.rb:195:in `make_statement'
/home/ebooks/fedi_ebooks/mispy/model.rb:174:in `make_response'
/home/ebooks/fedi_ebooks/providers/base.rb:41:in `generate_reply'
/home/ebooks/fedi_ebooks/providers/mastodon.rb:84:in `block in reply'
/home/ebooks/fedi_ebooks/providers/mastodon.rb:12:in `each'
/home/ebooks/fedi_ebooks/providers/mastodon.rb:12:in `reply'
/home/ebooks/fedi_ebooks/fedi_ebooks.rb:62:in `block in <module:FediEbooks>'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler/jobs_core.rb:241:in `block in do_call'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler.rb:130:in `around_trigger'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler/jobs_core.rb:240:in `do_call'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler/jobs_core.rb:288:in `trigger_now'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler/jobs_core.rb:339:in `block (3 levels) in start_work_thread'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler/jobs_core.rb:342:in `block (2 levels) in start_work_thread'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler/jobs_core.rb:325:in `loop'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler/jobs_core.rb:325:in `block in start_work_thread'
------------ End of Backtrace ------------
animeavi commented 1 year ago

Only saw this now, my bad. Can you tell me what's in your fedi_ebooks.rb:62, just in case it's not the same?

If it's the same as what's in the repo it's just the reply method, I will try to investigate from that.

animeavi commented 1 year ago

Oops it auto closed. Can you see if that fixes it.

hreinert commented 1 year ago

this is so cool, thanks for doing this!

I have the same error turning up, usually when the bot fails to reply to someone. Can I give you anything to help diagnose and fix it?

animeavi commented 1 year ago

this is so cool, thanks for doing this!

I have the same error turning up, usually when the bot fails to reply to someone. Can I give you anything to help diagnose and fix it?

Can you test if commit 0eda54f849c646e275c086734916726f8b875905 fixes it? That's my attempt.

hreinert commented 1 year ago

ah no, spoke too soon. still getting the error, as below.


Exception caught in scheduler thread #<NoMethodError: undefined method `[]' for nil:NilClass>!

------------ Backtrace Below ------------

/home/ubuntu/fedi_ebooks/mispy/model.rb:539:in `block (2 levels) in generate'
/home/ubuntu/fedi_ebooks/mispy/model.rb:529:in `each'
/home/ubuntu/fedi_ebooks/mispy/model.rb:529:in `block in generate'
/home/ubuntu/fedi_ebooks/mispy/model.rb:524:in `upto'
/home/ubuntu/fedi_ebooks/mispy/model.rb:524:in `generate'
/home/ubuntu/fedi_ebooks/mispy/model.rb:598:in `generate_respoding'
/home/ubuntu/fedi_ebooks/mispy/model.rb:195:in `make_statement'
/home/ubuntu/fedi_ebooks/mispy/model.rb:174:in `make_response'
/home/ubuntu/fedi_ebooks/providers/base.rb:41:in `generate_reply'
/home/ubuntu/fedi_ebooks/providers/mastodon.rb:84:in `block in reply'
/home/ubuntu/fedi_ebooks/providers/mastodon.rb:12:in `each'
/home/ubuntu/fedi_ebooks/providers/mastodon.rb:12:in `reply'
/home/ubuntu/fedi_ebooks/fedi_ebooks.rb:62:in `block in <module:FediEbooks>'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler/jobs_core.rb:241:in `block in do_call'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler.rb:130:in `around_trigger'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler/jobs_core.rb:240:in `do_call'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler/jobs_core.rb:288:in `trigger_now'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler/jobs_core.rb:339:in `block (3 levels) in start_work_thread'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler/jobs_core.rb:342:in `block (2 levels) in start_work_thread'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler/jobs_core.rb:325:in `loop'
/var/lib/gems/3.0.0/gems/rufus-scheduler-3.9.1/lib/rufus/scheduler/jobs_core.rb:325:in `block in start_work_thread'

------------ End of Backtrace ------------
hreinert commented 1 year ago

just to add I made a second bot using the update: also works mostly, but also gets exactly the same error from time to time.

also, thanks again for making this!