# ArgumentError：参数数量错误（已提供 0 个，预期 1 个）在 upcoming\_change\_stable\_opted\_out 问题检查中——导致日志泛滥

**URL:** <https://meta.discourse.org/t/argumenterror-wrong-number-of-arguments-given-0-expected-1-in-upcoming-change-stable-opted-out-problem-check-flooding-logs/407351>\
**Category:** Support\
**Created:** [2026年七月12日 04:27 UTC](https://meta.discourse.org/t/argumenterror-wrong-number-of-arguments-given-0-expected-1-in-upcoming-change-stable-opted-out-problem-check-flooding-logs/407351 "2026-07-12T04:27:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![one1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/one1/32/493591_2.png) [@one1](https://meta.discourse.org/u/one1)\
**Post date:** [2026年七月12日 04:27 UTC](https://meta.discourse.org/t/argumenterror-wrong-number-of-arguments-given-0-expected-1-in-upcoming-change-stable-opted-out-problem-check-flooding-logs/407351/1 "2026-07-12T04:27:50Z")

</div>

_注意：以下文本应我的要求，由官方 ask.discourse 聊天机器人根据我的讨论生成_

我在 `/logs` 中看到了数百条此类警告（截至目前已有 1500 多条）：

```plaintext
A scheduled admin dashboard problem check (upcoming_change_stable_opted_out) errored. : ArgumentError : wrong number of arguments (given 0, expected 1)

```

回溯指向：

```plaintext
app/services/problem_check/upcoming_change_stable_opted_out.rb:24:in 'translation_data'
app/models/problem_check.rb:203:in 'ProblemCheck#run'

```

如有需要，可提供完整的堆栈跟踪。运行的是 Ruby 3.4。

这似乎是一个 Discourse 核心问题，类似于近期其他 `ProblemCheck` 错误。该文件第 24 行的 `translation_data` 方法被调用时传入了 0 个参数，而它期望传入 1 个参数——这可能是 Ruby 3.4 的关键字参数分离问题。

如需更多信息，请告诉我。

（奇怪的是，我的管理控制台不再显示我运行的版本。我的实例不超过 2 周）

---

<div class="post-metadata">

**Author:** ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)\
**Post date:** [2026年七月13日 00:46 UTC](https://meta.discourse.org/t/argumenterror-wrong-number-of-arguments-given-0-expected-1-in-upcoming-change-stable-opted-out-problem-check-flooding-logs/407351/3 "2026-07-13T00:46:58Z")

</div>

感谢反馈，我觉得你的猜测可能是对的，因为这在另一个问题检查中也出现了：

```plaintext
计划的管理员仪表板问题检查 (group_email_credentials) 出错。: ArgumentError : 参数数量错误（给定 0 个，预期 1 个）

```

> [@one1](#):
>
> （奇怪的是，我的管理员仪表板不再告诉我我运行的版本了。我安装不到两周）

这是一个比较近期的更改，我不确定这是否仅适用于我们的托管服务，但管理员侧边栏中现在有一个链接可以显示此信息。

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/d/d/ddd6f559bd83860a0250f112e70159e5d4bec626.jpeg)

---

<div class="post-metadata">

**Author:** ![one1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/one1/32/493591_2.png) [@one1](https://meta.discourse.org/u/one1)\
**Post date:** [2026年七月13日 03:26 UTC](https://meta.discourse.org/t/argumenterror-wrong-number-of-arguments-given-0-expected-1-in-upcoming-change-stable-opted-out-problem-check-flooding-logs/407351/4 "2026-07-13T03:26:50Z")

</div>

不，我是自托管的。我看不到它：

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/c/c/7cc20841f61a5d2d9325b37c359f03a8e0f38198.png)

如果能提前宣布此类更改就好了。如果我还想不明白，我想我会开一个新帖子。

---

<div class="post-metadata">

**Author:** ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)\
**Post date:** [2026年七月13日 23:10 UTC](https://meta.discourse.org/t/argumenterror-wrong-number-of-arguments-given-0-expected-1-in-upcoming-change-stable-opted-out-problem-check-flooding-logs/407351/5 "2026-07-13T23:10:18Z")

</div>

你可以在那个“更新 Discourse”页面上看到你正在运行的版本，不是吗？或者你的意思是，你希望看到关于即将从仪表板移除的版本的详细信息被公布？这里有一篇关于管理仪表板（以及即将进行的更改）的公告 [Better insights into your community with the redesigned admin dashboard](https://meta.discourse.org/t/better-insights-into-your-community-with-the-redesigned-admin-dashboard/404528) ，但不确定是否提到了版本信息。

---

<div class="post-metadata">

**Author:** ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)\
**Post date:** [2026年七月15日 05:54 UTC](https://meta.discourse.org/t/argumenterror-wrong-number-of-arguments-given-0-expected-1-in-upcoming-change-stable-opted-out-problem-check-flooding-logs/407351/6 "2026-07-15T05:54:06Z")

</div>

将通过此修复：

> <https://github.com/discourse/discourse/pull/41724>
>
> ProblemCheck#run was calling translation\_data with no args while
> persisting tra…cker/admin notice details. For targeted checks like
> \`group\_email\_credentials\` and \`upcoming\_change\_stable\_opted\_out\`,
> \`translation\_data\` requires the target, so scheduled runs crashed after
> call returned a problem. This was causing an error like this in
> production:
> 
> \`\`\`
> A scheduled admin dashboard problem check (group\_email\_credentials) errored. : ArgumentError : wrong number of arguments (given 0, expected 1)
> /var/www/discourse/app/services/problem\_check/group\_email\_credentials.rb:35:in 'translation\_data'
> /var/www/discourse/app/models/problem\_check.rb:203:in 'ProblemCheck#run'
> /var/www/discourse/app/jobs/regular/run\_problem\_check.rb:23:in 'Jobs::RunProblemCheck#execute'
> /var/www/discourse/app/jobs/base.rb:313:in 'block (2 levels) in Jobs::Base#perform'
> \`\`\`
> 
> The intended flow after the fix now:
> 
> \* targets provides the scheduler/tracker key.
> \* problem(target) is where target-specific translation data is computed.
> \* Problem#details carries that computed translation data plus override\_data.
> \* run persists problem.details instead of recalculating translation\_data.
> 
> c.f. https://meta.discourse.org/t/argumenterror-wrong-number-of-arguments-given-0-expected-1-in-upcoming-change-stable-opted-out-problem-check-flooding-logs/407351

---

<div class="post-metadata">

**Author:** ![one1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/one1/32/493591_2.png) [@one1](https://meta.discourse.org/u/one1)\
**Post date:** [2026年七月15日 05:54 UTC](https://meta.discourse.org/t/argumenterror-wrong-number-of-arguments-given-0-expected-1-in-upcoming-change-stable-opted-out-problem-check-flooding-logs/407351/7 "2026-07-15T05:54:56Z")

</div>

非常感谢您。我十分欣赏您以及整个团队的工作。

---

<div class="post-metadata">

**Author:** ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)\
**Post date:** [2026年七月16日 01:39 UTC](https://meta.discourse.org/t/argumenterror-wrong-number-of-arguments-given-0-expected-1-in-upcoming-change-stable-opted-out-problem-check-flooding-logs/407351/8 "2026-07-16T01:39:25Z")

</div>


