用户合并失败,第三方插件导致数据库条目损坏

好的,正在获取… 我遇到了连接问题。我会用 safe_mode 检查一下是否可行。
安全模式没有帮助…

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-assign.git
          - git clone https://github.com/discourse/discourse-bbb.git
          - git clone https://github.com/discourse/discourse-calendar.git
          - git clone https://github.com/discourse/discourse-canned-replies.git
          - git clone https://github.com/discourse/discourse-checklist.git
          - git clone https://github.com/discourse/discourse-code-review.git
          - git clone https://github.com/discourse/discourse-footnote.git
          - git clone https://github.com/discourse/discourse-github.git
          - git clone https://github.com/discourse/discourse-graphviz.git
          - git clone https://github.com/discourse/discourse-math.git
          - git clone https://github.com/discourse/discourse-policy.git
          - git clone https://github.com/discourse/discourse-prometheus.git
          - git clone https://github.com/discourse/discourse-prometheus-alert-receiver.git
          - git clone https://github.com/discourse/discourse-push-notifications.git
          - git clone https://github.com/discourse/discourse-saved-searches.git
          - git clone https://github.com/discourse/discourse-solved.git
          - git clone https://github.com/discourse/discourse-spoiler-alert.git
          - git clone https://github.com/discourse/discourse-voting.git
          - git clone https://github.com/discourse/discourse-yearly-review.git
          - git clone https://github.com/angusmcleod/discourse-events.git
          - git clone https://github.com/angusmcleod/discourse-locations.git
          - git clone https://github.com/davidtaylorhq/discourse-whos-online.git

我已经注意到可以更新最后几个插件的 URL。(但重建只能在 UTC 时间今晚午夜左右进行)
也许可以联系 @angus@merefield 关于 events 和 locations 插件的问题。

问题可能出在 discourse-assign 插件上,因为它似乎是您列表中唯一修改了 TopicQuery 类的插件。我怀疑错误就发生在这里。

您能否通过禁用该插件并检查分类是否正常工作来验证我的推测?之后您可以重新启用它。此外,了解该主题的任何自定义字段是否以某种方式引用了合并后的用户也会很有帮助。您能否也检查一下?

./launcher enter app
rails c

id_of_problematic_topic = 123
Topic.find(id_of_problematic_topic).custom_fields

禁用 discourse-assign 后:

  • 最新功能正常
  • 顶部功能失败
  • /t/951 仍然失败

运行查询……啊!你搞定啦!

{"event_start"=>1601748000, "event_end"=>1601749800, "event_all_day"=>false, "event_timezone"=>"Etc/UTC", "event_rsvp"=>true, "event_going_max"=>100, "event_version"=>1, "event_going"=>[36, 50]}

看来在合并过程中跳过了 events 插件。不过这也可能是因为我们运行的是旧版本。如果需要我协助测试这种情况,请告诉我。

感谢你解决了这个问题 @gerhard

您可以更新该主题的自定义字段,并移除不存在的 ID。@angus 或许希望在他的插件中添加用户合并支持。

供参考:

tcf = TopicCustomField.where(topic_id: problematic_topic_id)
c = tcf.last # 在我的情况下,具体情况可能有所不同
c.value = "[295,50]"
c.save

为了存档起见,如果该主题有多个自定义字段,你应该使用:

tcf = TopicCustomField.where(plugin_name: 'discourse-events', topic_id: problematic_topic_id)
c = tcf.first
c.value = "[295,50]"
c.save

@hellekin 我建议迁移到 https://meta.discourse.org/t/discourse-event/149964。

事实上,或许你可以和 @fzngagan 合作编写一个从 Events 到 Discourse Events 的迁移脚本?那里正好需要一个实际案例来测试。Faiz,我们应该优先处理此事,我希望能正式弃用 Events。

@angus, @fzngagan:你觉得我可以先修改容器配置中的插件行,然后重新构建,再处理运行脚本吗?因为我还需要更新“人物志”和“巫师”的 Git 仓库,所以可以一并处理。另一方面,我们正处于黑客松期间,如果问题已经解决,我也可以等一周再说。

@hellekin
我最近修复了一个类似的问题,即删除用户会导致问题。

我非常赞同迁移到 Creating and managing events 的想法。那么问题在于,您是否希望保留已过期的事件,以及您目前有多少个即将发生的事件?

@fzngagan @hellekin 你们可以移步到这里讨论细节:Pavilion

我报名参与迁移脚本的开发工作。

我是 Events 功能的重度用户。我为学校中行为困难儿童开发的插件,在多个校区为 10 多名儿童每天创建 7 个主题,已稳定运行两年以上。每个主题代表学生一天的某个时段,因此我需要能够按主题事件日期进行查询,希望 Discourse Events 能将数据存储在一个便于访问的位置。

我会加入你下面提到的讨论。

很高兴看到这次出色的合作!我正是因为这一点而喜爱 Discourse!感谢大家的付出与参与:heart:

是的,我们希望保留过去的事件,因为它们与主题相关,尤其是那些与(仍在进行的)2020 年 ActivityPub 会议相关的主题——本周是黑客马拉松。
除了这些,我们并没有太多事件,但会阅读关于迁移的内容——可能在下周,因为本周已经非常忙碌了。谢谢!另外,正如 @aschrijver 所说:Discourse 社区太棒了!