A user, matenauta, experienced issues with rebuilding their multisite Discourse instance due to a PG::UniqueViolation error. The error occurred after installing the Discourse Chatbot plugin. Falco suggested that the error was caused by the plugin, and matenauta attempted to uninstall it. However, the error persisted due to duplicate records in the category_users table.
merefield clarified that the issue was caused by the plugin’s fixtures script, which seeds the bot user. merefield provided instructions on how to resolve the issue by deleting the duplicate record, rather than dropping the index. matenauta reported that the issue was likely caused by using default categories on every group, which breaks the plugin’s implementation. merefield acknowledged the issue and will investigate further to add checks to prevent it in the future.
That error is coming from it, you will need to manually fix the database record and remove the duplicates even after uninstalling a plugin as what it adds to a database is permanent.
Hmmm, presumably dozens of installs and no issues of this kind that I’m aware of.
What’s the specific problem here?
The fixtures script seeds the bot user (so the admin doesn’t need to hit the rails console) and that may fail if attempted twice but there is a check. I’ll check if the check is bomb proof. Is this running twice in this flavour of install?
Just to add I don’t think you need to remove the plugin here once this is resolved but I’m very curious why this scenario arose in the first place as had no other reports?