在我发帖提到我的 AI 机器人时,它没有任何反应,所以我检查了错误日志,出现了这个错误:
Job exception: undefined method `scheduled?' for nil
我还没有遇到过这种情况,安装中的其他一切都运行正常,我的 API 账户也有余额。我的版本是 3.4.0.beta2-dev (361e954c55)
这是回溯信息:
/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'
更新:现在这个错误似乎在不断累积。我有 20 个此类错误,它们以 10 分钟的间隔出现在错误日志中。
我再次尝试提及,现在出现了错误:
Job exception: Something has gone wrong. Perhaps this topic was closed or deleted while you were looking at it?
回溯信息:
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'
sam
(Sam Saffron)
2024 年9 月 2 日 02:05
3
@random_picker_bot 你还活着吗,请从 1 到 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!
sam
(Sam Saffron)
2024 年9 月 2 日 02:06
5
嗯,这有点奇怪,用户是否可能被暂停或信任度较低?
你能从头开始创建一个与用户身份完全相同的 Persona,看看是否仍然失败?
我们需要修复 Discourse Ai,使其在帖子创建者中正确显示错误,需要好好想想。
谢谢你的建议。
我检查了这些内容,错误没有变化。用户拥有 4 级信任等级,也没有被暂停。
所以也许我只能耐心等待
不确定这是否能帮到你们,但我已经完全更新了所有内容,然后禁用了 启用提及 设置,接着重新启用它,并在新打开的主题中再次尝试提及 AI 角色,我没有 收到任何新错误,并且它奏效了。所以据我所知,问题已经解决了。
然而,Job exception: undefined method `scheduled?' for nil 错误已继续累积(现在已达 547 个)。
1 个赞
ted
(Ted Johansson)
2024 年9 月 6 日 08:56
9
这很可能是因为存在一个问题检查跟踪器,但问题检查逻辑已不再存在。最有可能发生这种情况的方式是安装一个带有问题检查的插件,然后将其卸载。跟踪器仍然存在,但检查逻辑缺失了。
我在这里有一个修复方法:
main ← dev/clear-trackers-for-uninstalled-checks
opened 07:52AM - 06 Sep 24 UTC
### What is this change?
When running checks, we look to the existing problem… check trackers and try to grab their `ProblemCheck` classes.
In some cases this is no longer in the problem check repository, e.g. when the check was part of a plugin that has been uninstalled.
In the case where the check was scheduled, this would lead to an error in one of the jobs.
### How does this fix it?
This fix has two parts:
1. If a problem check tracker can't find it's `ProblemCheck` class, it destroys itself and any admin notices associated with it. It then returns `nil`.
2. The job that selects which checks to run now accounts for the fact that the `ProblemCheck` class could be `nil`, and filters it out of the run.
Bonus:
- Scheduled checks now honour the `enabled = false` configuration, same as realtime checks.
2 个赞