In a support thread regarding a 500 error when editing a ‘closed topic’ post, barryvan reported encountering the issue after attempting to edit the system-generated post explaining why a topic was closed. The error log indicated a PG::UniqueViolation related to duplicate keys in the topic_links table, specifically involving category references within the post content. barryvan questioned if these category references were the cause.
However, mpalmer and Mittineague attempted to reproduce the issue on their own instances (including try.discourse.org and a local install) using various methods, such as editing posts with emojis and links, but were unable to trigger the error. Mittineague also suggested a potential conflict if the editor was open in multiple tabs or contexts, such as a profile and a topic simultaneously. Since the original issue appeared to resolve itself, barryvan concluded it was likely a random fluke and decided to close the report.
I just closed a topic, but meant to post a message explaining why before. I figured I’d edit the “closed topic” post to do so – but when I hit “save”, I received an error 500. It does seem to have persisted my changes, though.
Looking through the logs, I think that the relevant entry is:
I’m not 100% sure. The log entry does reference a different category, and I did have category references in my topic – the exact text was:
:champagne: We've now shipped our :books: LearningField integration! I'll close this topic so that the voters get their votes back.
If you have feedback on this work, it'd be great if you shared it -- ask questions in #q-a, make more suggestions in #suggestions, and help others get up to speed with LearningField in #how-to. Let everyone know how you're using it in #in-the-classroom.
Could it be the category references causing the issue?
I don’t remember any of the details, but there was a type of conflict problem before (since fixed) that happened when the editor was open in both a Profile and a Topic at the same time.
I tried to force an error by opening a reply in a topic, minimizing the editor, then going to and editing the Close small action post. - no repro
Might you have had the editor open elsewhere at the same time?