# 自动化脚本Schedule PM使用Data Explorer结果未发送PMs

**URL:** https://meta.discourse.org/t/automation-script-schedule-pm-with-data-explorer-results-not-sending-pms/269135
**Category:** Bug
**Tags:** automation
**Created:** [2023 年6 月 21 日 09:46 UTC](https://meta.discourse.org/t/automation-script-schedule-pm-with-data-explorer-results-not-sending-pms/269135 "2023-06-21T09:46:11Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### 作者： ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### 发布日期： [2023 年6 月 21 日 12:44 UTC](https://meta.discourse.org/t/automation-script-schedule-pm-with-data-explorer-results-not-sending-pms/269135/4 "2023-06-21T12:44:26Z")

</div>

我觉得我也遇到了类似的情况：

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

数据浏览器的查询似乎已经运行成功：

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/4/b/84b863c65ddba018db9b57cc60b01b524448301c.png)

但是没有发送私信。

我在 `/logs` 中看到了这个错误：

```plaintext
Message (5 copies reported)

Job exception: undefined method `to_sym' for nil:NilClass

Backtrace

/var/www/discourse/plugins/discourse-data-explorer/lib/result_to_markdown.rb:20:in `block (2 levels) in convert'
/var/www/discourse/plugins/discourse-data-explorer/lib/result_to_markdown.rb:18:in `each'
/var/www/discourse/plugins/discourse-data-explorer/lib/result_to_markdown.rb:18:in `each_with_index'
/var/www/discourse/plugins/discourse-data-explorer/lib/result_to_markdown.rb:18:in `block in convert'
/var/www/discourse/plugins/discourse-data-explorer/lib/result_to_markdown.rb:15:in `each'
/var/www/discourse/plugins/discourse-data-explorer/lib/result_to_markdown.rb:15:in `convert'
/var/www/discourse/plugins/discourse-data-explorer/lib/report_generator.rb:20:in `generate'
/var/www/discourse/plugins/discourse-data-explorer/plugin.rb:117:in `block (4 levels) in activate!'
/var/www/discourse/plugins/discourse-automation/app/models/discourse_automation/automation.rb:83:in `trigger!'
/var/www/discourse/plugins/discourse-automation/app/jobs/scheduled/discourse_automation_tracker.rb:36:in `run_pending_automation'

```

如果尝试手动触发自动化，我还会收到一个 ‘500’ 错误，并且在日志中看到（略有不同）的错误：

```plaintext
Message (4 copies reported)

NoMethodError (undefined method `to_sym' for nil:NilClass)
app/controllers/application_controller.rb:418:in `block in with_resolved_locale'
app/controllers/application_controller.rb:418:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:369: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:228:in `call'

Backtrace

plugins/discourse-data-explorer/lib/result_to_markdown.rb:20:in `block (2 levels) in convert'
plugins/discourse-data-explorer/lib/result_to_markdown.rb:18:in `each'
plugins/discourse-data-explorer/lib/result_to_markdown.rb:18:in `each_with_index'
plugins/discourse-data-explorer/lib/result_to_markdown.rb:18:in `block in convert'
plugins/discourse-data-explorer/lib/result_to_markdown.rb:15:in `each'
plugins/discourse-data-explorer/lib/result_to_markdown.rb:15:in `convert'
plugins/discourse-data-explorer/lib/report_generator.rb:20:in `generate'
plugins/discourse-data-explorer/plugin.rb:117:in `block (4 levels) in activate!'
plugins/discourse-automation/app/models/discourse_automation/automation.rb:83:in `trigger!'
plugins/discourse-automation/app/controllers/discourse_automation/automations_controller.rb:10:in `trigger'

```

我们把它移到 #Contribute > Bug 频道，看看能不能找人来看看。 👍

---

_[View the full topic](https://meta.discourse.org/t/automation-script-schedule-pm-with-data-explorer-results-not-sending-pms/269135)._
