# 审核帖子时出现“500 Internal Server Error”

**URL:** https://meta.discourse.org/t/500-internal-server-error-when-reviewing-a-post/288922
**Category:** Bug
**Tags:** chat, ai
**Created:** [2023年十二月16日 15:37 UTC](https://meta.discourse.org/t/500-internal-server-error-when-reviewing-a-post/288922 "2023-12-16T15:37:17Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Aaron\_Walsh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aaron_walsh/32/312661_2.png) [@Aaron\_Walsh](https://meta.discourse.org/u/Aaron_Walsh)
#### Post date: [2023年十二月16日 15:37 UTC](https://meta.discourse.org/t/500-internal-server-error-when-reviewing-a-post/288922/1 "2023-12-16T15:37:17Z")

</div>

下午好，

看起来我们遇到了两个问题，但我无法找到直接的解决方案。

我们的AI已识别出一名用户使用了冒犯性语言，我已经永久终止了该用户的账户，并开始清除与该账户相关的所有帖子/消息。但是，在上面的通知中，我发现没有选项可以消除或删除持久的蓝线。

是我忽略了什么，还是有办法删除它们？

 ![Screenshot_20231216_152909_Chrome](https://global.discourse-cdn.com/meta/original/4X/a/6/5/a655bdd93c986a5ac1f275a343c8f3c687a3b59e.jpeg)

 ![Screenshot_20231216_152923_Chrome](https://global.discourse-cdn.com/meta/original/4X/a/1/a/a1ad431cfa4353e5d2e674190b5cfc045675ef7f.jpeg)

---

<div class="post-metadata">

### Author: ![Aaron\_Walsh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aaron_walsh/32/312661_2.png) [@Aaron\_Walsh](https://meta.discourse.org/u/Aaron_Walsh)
#### Post date: [2023年十二月17日 21:29 UTC](https://meta.discourse.org/t/500-internal-server-error-when-reviewing-a-post/288922/2 "2023-12-17T21:29:32Z")

</div>

我顶一下，因为我遇到了一个与我遇到的问题类似的情况，但该主题现在已关闭。

我重新构建了系统以查看这是否能解决问题，并且还运行了 `./launcher cleanup`，但都没有奏效。

> [@Review queue can't render chat message flagged by AI](https://meta.discourse.org/t/review-queue-cant-render-chat-message-flagged-by-ai/268469?u=aaron_walsh):
>
> Hi, really enjoying these AI modules, thanks a lot for the work put in! I’ve configured the toxicity module with the detoxify service running locally, and its working for posts, but for DM’s, it will flag bad ones successfully, however when I visit the review/moderation page (the summart “all” page or the “flagged item” page for these messages) I get: Server Error while trying to load /review?priority=low&status=pending&sort\_order=score Error code: 500 Internal Server Error That’s only fo…

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2023年十二月18日 00:29 UTC](https://meta.discourse.org/t/500-internal-server-error-when-reviewing-a-post/288922/3 "2023-12-18T00:29:54Z")

</div>

当出现 500 错误时，`/logs` 中有什么内容？

---

<div class="post-metadata">

### Author: ![Aaron\_Walsh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aaron_walsh/32/312661_2.png) [@Aaron\_Walsh](https://meta.discourse.org/u/Aaron_Walsh)
#### Post date: [2023年十二月18日 05:19 UTC](https://meta.discourse.org/t/500-internal-server-error-when-reviewing-a-post/288922/4 "2023-12-18T05:19:56Z")

</div>

早上好，Sam。

```plaintext
Message (43 copies reported)

NoMethodError (undefined method `chat_channel' for nil:NilClass)
lib/freedom_patches/ams_include_without_root.rb:57:in `include!'
app/controllers/application_controller.rb:532:in `serialize_data'
app/controllers/application_controller.rb:541:in `render_serialized'
app/controllers/reviewables_controller.rb:145:in `show'
app/controllers/application_controller.rb:423:in `block in with_resolved_locale'
app/controllers/application_controller.rb:423:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:64:in `call'
lib/middleware/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:393:in `call'
lib/middleware/gtm_script_nonce_injector.rb:10:in `call'
config/initializers/008-rack-cors.rb:14:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:233:in `call'

Backtrace

plugins/discourse-ai/app/serializers/reviewable_ai_chat_message_serializer.rb:13:in `chat_channel'
active_model_serializers (0.8.4) lib/active_model/serializer/associations.rb:71:in `associated_object'
active_model_serializers (0.8.4) lib/active_model/serializer/associations.rb:192:in `serialize'
lib/freedom_patches/ams_include_without_root.rb:57:in `include!'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:368:in `block in include_associations!'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:367:in `each_key'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:367:in `include_associations!'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:362:in `serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:343:in `as_json'
app/controllers/application_controller.rb:532:in `serialize_data'

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2023年十二月18日 07:15 UTC](https://meta.discourse.org/t/500-internal-server-error-when-reviewing-a-post/288922/6 "2023-12-18T07:15:09Z")

</div>

好的，我们将在接下来的一周左右的时间里对此进行研究，并为序列化器添加保护。

---

<div class="post-metadata">

### Author: ![jancernik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jancernik/32/275892_2.png) [@jancernik](https://meta.discourse.org/u/jancernik)
#### Post date: [2024年一月3日 17:01 UTC](https://meta.discourse.org/t/500-internal-server-error-when-reviewing-a-post/288922/12 "2024-01-03T17:01:05Z")

</div>

您好 @Aaron_Walsh，感谢您的报告。

在此次提交后，您应该能够加载可审查项并忽略那些与已删除用户的聊天消息相关的可审查项。

> <https://github.com/discourse/discourse-ai/commit/d9c052f8e7671bbf72b32cf33a4431db7970958a>

---

<div class="post-metadata">

### Author: ![Aaron\_Walsh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aaron_walsh/32/312661_2.png) [@Aaron\_Walsh](https://meta.discourse.org/u/Aaron_Walsh)
#### Post date: [2024年一月3日 18:02 UTC](https://meta.discourse.org/t/500-internal-server-error-when-reviewing-a-post/288922/13 "2024-01-03T18:02:24Z")

</div>

非常感谢！虽然我没有理由质疑手头的任务，但这确实效果非凡！

---

<div class="post-metadata">

### Author: ![jancernik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jancernik/32/275892_2.png) [@jancernik](https://meta.discourse.org/u/jancernik)
#### Post date: [2024年一月4日 11:00 UTC](https://meta.discourse.org/t/500-internal-server-error-when-reviewing-a-post/288922/14 "2024-01-04T11:00:25Z")

</div>

此主题已在 17 小时后自动关闭。不再允许回复。
