最近このエラーは見ていません。
しかし、最近のアップデート後に大きな変更に気づきました。毎晩、午前12時30分から午前2時30分の間に、APIレート制限をオーバーロードするAI関連のエラーがいくつか発生します。
アップグレード前のログを調べても、これらの問題は見られませんでした。Discourseは、毎晩すべての投稿に対してサマリーを更新したり、その他の「更新」作業を行ったりするのでしょうか?私たちのフォーラムは小さく、1日に新しい投稿はせいぜい数件です。Geminiのレート制限が毎晩同じ時間に超過される理由がわかりません。すべての過去の投稿に対してすべてをやり直しているとしか思えません。
メッセージ
DiscourseAi::Completions::Endpoints::Gemini: status: 429 - body: {
"error": {
"code": 429,
"message": "現在のクォータを超過しました。プランと請求の詳細を確認してください。このエラーの詳細については、https://ai.google.dev/gemini-api/docs/rate-limits を参照してください。現在の使用状況を監視するには、https://ai.dev/usage?tab=rate-limit を参照してください。\n* generativelanguage.googleapis.com/generate_content_free_tier_requests のクォータを超過しました。制限: 250\n59.208757909秒後に再試行してください。",
"status": "RESOURCE_EXHAUSTED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.QuotaFailure",
"violations": [
{
"quotaMetric": "generativelanguage.googleapis.com/generate_content_free_tier_requests",
"quotaId": "GenerateRequestsPerDayPerProjectPerModel-FreeTier",
"quotaDimensions": {
"location": "global",
"model": "gemini-2.5-flash"
},
"quotaValue": "250"
}
]
},
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Gemini APIのクォータについて詳しくはこちら",
"url": "https://ai.google.dev/gemini-api/docs/rate-limits"
}
]
},
{
"@type": "type.googleapis.com/google.rpc.RetryInfo",
"retryDelay": "59s"
}
]
}
}
バックトレース
activesupport-8.0.3/lib/active_support/broadcast_logger.rb:218:in `block in dispatch'
activesupport-8.0.3/lib/active_support/broadcast_logger.rb:217:in `map'
activesupport-8.0.3/lib/active_support/broadcast_logger.rb:217:in `dispatch'
activesupport-8.0.3/lib/active_support/broadcast_logger.rb:129:in `error'
/var/www/discourse/plugins/discourse-ai/lib/completions/endpoints/base.rb:188:in `block (2 levels) in perform_completion!'
net-http-0.6.0/lib/net/http.rb:2433:in `block in transport_request'
net-http-0.6.0/lib/net/http/response.rb:320:in `reading_body'
net-http-0.6.0/lib/net/http.rb:2430:in `transport_request'
net-http-0.6.0/lib/net/http.rb:2384:in `request'
rack-mini-profiler-4.0.1/lib/patches/net_patches.rb:19:in `block in request_with_mini_profiler'
rack-mini-profiler-4.0.1/lib/mini_profiler/profiling_methods.rb:51:in `step'
rack-mini-profiler-4.0.1/lib/patches/net_patches.rb:18:in `request_with_mini_profiler'
/var/www/discourse/plugins/discourse-ai/lib/completions/endpoints/base.rb:186:in `block in perform_completion!'
net-http-0.6.0/lib/net/http.rb:1632:in `start'
net-http-0.6.0/lib/net/http.rb:1070:in `start'
/var/www/discourse/plugins/discourse-ai/lib/completions/endpoints/base.rb:139:in `perform_completion!'
/var/www/discourse/plugins/discourse-ai/lib/completions/llm.rb:447:in `generate'
/var/www/discourse/plugins/discourse-ai/lib/configuration/llm_validator.rb:36:in `run_test'
/var/www/discourse/plugins/discourse-ai/app/services/problem_check/ai_llm_status.rb:26:in `block (2 levels) in llm_errors'
/var/www/discourse/plugins/discourse-ai/app/services/problem_check/ai_llm_status.rb:32:in `try_validate'
/var/www/discourse/plugins/discourse-ai/app/services/problem_check/ai_llm_status.rb:26:in `block in llm_errors'
activerecord-8.0.3/lib/active_record/relation/batches.rb:88:in `each'
activerecord-8.0.3/lib/active_record/relation/batches.rb:88:in `block in find_each'
activerecord-8.0.3/lib/active_record/relation/batches.rb:172:in `block in find_in_batches'
activerecord-8.0.3/lib/active_record/relation/batches.rb:461:in `block in batch_on_unloaded_relation'
internal:kernel:187:in `loop'
activerecord-8.0.3/lib/active_record/relation/batches.rb:434:in `batch_on_unloaded_relation'
activerecord-8.0.3/lib/active_record/relation/batches.rb:289:in `in_batches'
activerecord-8.0.3/lib/active_record/relation/batches.rb:171:in `find_in_batches'
activerecord-8.0.3/lib/active_record/relation/batches.rb:87:in `find_each'
/var/www/discourse/plugins/discourse-ai/app/services/problem_check/ai_llm_status.rb:24:in `each'
/var/www/discourse/plugins/discourse-ai/app/services/problem_check/ai_llm_status.rb:24:in `filter_map'
/var/www/discourse/plugins/discourse-ai/app/services/problem_check/ai_llm_status.rb:24:in `llm_errors'
/var/www/discourse/plugins/discourse-ai/app/services/problem_check/ai_llm_status.rb:13:in `call'
/var/www/discourse/app/models/problem_check.rb:169:in `run'
/var/www/discourse/app/models/problem_check.rb:155:in `run'
/var/www/discourse/app/jobs/regular/run_problem_check.rb:18:in `execute'
/var/www/discourse/app/jobs/base.rb:318:in `block (2 levels) in perform'
rails_multisite-7.0.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
rails_multisite-7.0.0/lib/rails_multisite/connection_management.rb:17:in `with_connection'
/var/www/discourse/app/jobs/base.rb:305:in `block in perform'
/var/www/discourse/app/jobs/base.rb:301:in `each'
/var/www/discourse/app/jobs/base.rb:301:in `perform'
sidekiq-7.3.9/lib/sidekiq/processor.rb:220:in `execute_job'
sidekiq-7.3.9/lib/sidekiq/processor.rb:185:in `block (4 levels) in process'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:180:in `traverse'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in `block in traverse'
/var/www/discourse/lib/sidekiq/discourse_event.rb:6:in `call'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in `traverse'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in `block in traverse'
/var/www/discourse/lib/sidekiq/pausable.rb:131:in `call'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in `traverse'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in `block in traverse'
sidekiq-7.3.9/lib/sidekiq/job/interrupt_handler.rb:9:in `call'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in `traverse'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in `block in traverse'
sidekiq-7.3.9/lib/sidekiq/metrics/tracking.rb:26:in `track'
sidekiq-7.3.9/lib/sidekiq/metrics/tracking.rb:134:in `call'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in `traverse'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:173:in `invoke'
sidekiq-7.3.9/lib/sidekiq/processor.rb:184:in `block (3 levels) in process'
sidekiq-7.3.9/lib/sidekiq/processor.rb:145:in `block (6 levels) in dispatch'
sidekiq-7.3.9/lib/sidekiq/job_retry.rb:118:in `local'
sidekiq-7.3.9/lib/sidekiq/processor.rb:144:in `block (5 levels) in dispatch'
sidekiq-7.3.9/lib/sidekiq/config.rb:39:in `block in <class:Config>'
sidekiq-7.3.9/lib/sidekiq/processor.rb:139:in `block (4 levels) in dispatch'
sidekiq-7.3.9/lib/sidekiq/processor.rb:281:in `stats'
sidekiq-7.3.9/lib/sidekiq/processor.rb:134:in `block (3 levels) in dispatch'
sidekiq-7.3.9/lib/sidekiq/job_logger.rb:15:in `call'
sidekiq-7.3.9/lib/sidekiq/processor.rb:133:in `block (2 levels) in dispatch'
sidekiq-7.3.9/lib/sidekiq/job_retry.rb:85:in `global'
sidekiq-7.3.9/lib/sidekiq/processor.rb:132:in `block in dispatch'
sidekiq-7.3.9/lib/sidekiq/job_logger.rb:40:in `prepare'
sidekiq-7.3.9/lib/sidekiq/processor.rb:131:in `dispatch'
sidekiq-7.3.9/lib/sidekiq/processor.rb:183:in `block (2 levels) in process'
sidekiq-7.3.9/lib/sidekiq/processor.rb:182:in `handle_interrupt'
sidekiq-7.3.9/lib/sidekiq/processor.rb:182:in `block in process'
sidekiq-7.3.9/lib/sidekiq/processor.rb:181:in `handle_interrupt'
sidekiq-7.3.9/lib/sidekiq/processor.rb:181:in `process'
sidekiq-7.3.9/lib/sidekiq/processor.rb:86:in `process_one'
sidekiq-7.3.9/lib/sidekiq/processor.rb:76:in `run'
sidekiq-7.3.9/lib/sidekiq/component.rb:10:in `watchdog'
sidekiq-7.3.9/lib/sidekiq/component.rb:19:in `block in safe_thread'