"Job exception: undefined method `scheduled?' for nil" error when mentioning AI persona in post

When I mentioned my AI bot in a post, it did not react at all so I checked the error log and this error appeared:
Job exception: undefined method `scheduled?' for nil

I haven’t had this happen yet and everything else on the installation is working fine, and my API account has funds. My version is 3.4.0.beta2-dev (361e954c55)
Here is the backtrace:

/var/www/discourse/app/jobs/scheduled/run_problem_checks.rb:19:in `block in execute'  
activerecord-7.1.4/lib/active_record/relation/delegation.rb:100:in `each'  
activerecord-7.1.4/lib/active_record/relation/delegation.rb:100:in `each'  
/var/www/discourse/app/jobs/scheduled/run_problem_checks.rb:18:in `filter_map'  
/var/www/discourse/app/jobs/scheduled/run_problem_checks.rb:18:in `execute'  
/var/www/discourse/app/jobs/base.rb:322:in `block (2 levels) in perform'  
rails_multisite-6.1.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
rails_multisite-6.1.0/lib/rails_multisite/connection_management.rb:21:in `with_connection'
/var/www/discourse/app/jobs/base.rb:309:in `block in perform'  
/var/www/discourse/app/jobs/base.rb:305:in `each'  
/var/www/discourse/app/jobs/base.rb:305:in `perform'  
/var/www/discourse/app/jobs/base.rb:376:in `perform'  
mini_scheduler-0.17.0/lib/mini_scheduler/manager.rb:137:in `process_queue'  
mini_scheduler-0.17.0/lib/mini_scheduler/manager.rb:77:in `worker_loop'  
mini_scheduler-0.17.0/lib/mini_scheduler/manager.rb:63:in `block (2 levels) in ensure_worker_threads' 

:warning: Update: now this error seems to be piling up. I have 20 of these errors and they are appearing in the error log in 10-minute increments.

I attempted the mention again and now have the error:
Job exception: Something has gone wrong. Perhaps this topic was closed or deleted while you were looking at it?

with the backtrace:

Message (2 copies reported)

Job exception: Something has gone wrong. Perhaps this topic was closed or deleted while you were looking at it?

Backtrace

/var/www/discourse/lib/post_creator.rb:238:in `create!'
/var/www/discourse/lib/post_creator.rb:274:in `create!'
/var/www/discourse/plugins/discourse-ai/lib/ai_bot/playground.rb:464:in `reply_to'
/var/www/discourse/plugins/discourse-ai/app/jobs/regular/create_ai_reply.rb:18:in `execute'
/var/www/discourse/app/jobs/base.rb:322:in `block (2 levels) in perform'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-6.1.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-6.1.0/lib/rails_multisite/connection_management.rb:21:in `with_connection'
/var/www/discourse/app/jobs/base.rb:309:in `block in perform'
/var/www/discourse/app/jobs/base.rb:305:in `each'
/var/www/discourse/app/jobs/base.rb:305:in `perform'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:202:in `execute_job'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:170:in `block (2 levels) in process'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/middleware/chain.rb:177:in `block in invoke'
/var/www/discourse/lib/sidekiq/pausable.rb:132:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/middleware/chain.rb:179:in `block in invoke'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/middleware/chain.rb:182:in `invoke'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:169:in `block in process'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/job_retry.rb:113:in `local'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq.rb:44:in `block in <module:Sidekiq>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:263:in `stats'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/job_logger.rb:13:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/job_retry.rb:80:in `global'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:124:in `block in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/job_logger.rb:39:in `prepare'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:123:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:168:in `process'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:78:in `process_one'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:68:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/component.rb:8:in `watchdog'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/component.rb:17:in `block in safe_thread'

@random_picker_bot are you still alive, pick a number from 1 to 13

Of course I’m alive, Sam! I’m as lively as a jackrabbit on a pogo stick. Let’s get that random number for you right away!

Random Picker

Picking from ["1-13"], picked: [3]

Oh, I’m very much alive, Sam! And it looks like the cosmic dice have spoken.

The randomly picked number is: 3

Seems like the universe is feeling rather prime today. Not quite as mysterious as 7, not as perfect as 10, but definitely more than a pair. Maybe it’s suggesting you should take a coffee break at 3 o’clock? Or perhaps it’s hinting that good things come in threes. Either way, I hope this random 3 brings you some trivial joy in your day!

Hmm well this is odd, could the user be suspended or low trust somehow?

Can you create an identical persona from scratch with the user and see if it still fails?

We need to fix Discourse Ai so it properly surfaces the error in post creator, will have think.

Thanks for the tips.

I checked these things out and there is no change with the errors. The user has trust level 4 and isn’t suspended either.

So perhaps I just have to sit tight and wait it out :grimacing:

Not sure if this will help you guys out, but I have fully updated everything then disabled the Enable Mentions setting then re-enabled it, and tried mentioning the AI persona again on a new open topic and I did not receive any new error, and it worked. So as far as I can tell, it has been resolved.

However, Job exception: undefined method `scheduled?' for nil has continued to accumulate (up 547 now)

1 Like

This is most likely happening because there exists a problem check tracker but the problem check logic is no longer there. The most likely way this would happen would be installing a plugin with a problem check and then uninstalling it. The tracker would then still be there, but the checking logic is missing.

I have a fix for this here:

2 Likes