Can't delete topics - Error 500, rake aborted!

I can’t delete topics and am wondering why that is.

Using the forum software I get a 500 Internal Server Error

Using the console:

$ cd /var/discourse/
$ sudo -s
# ./launcher enter app
# rake destroy:topics["Redaktion"]
Going to delete all topics in the Redaktion category
There are 102 topics to delete in Redaktion category
Deleting kontaktliste...
rake aborted!
MessageBus::InvalidMessageTarget: MessageBus::InvalidMessageTarget 
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/message_bus-3.3.6/lib/message_bus.rb:373:in `publish'
/var/www/discourse/app/models/topic_tracking_state.rb:216:in `publish_delete'
/var/www/discourse/lib/post_destroyer.rb:195:in `perform_delete'
/var/www/discourse/lib/post_destroyer.rb:73:in `destroy'
/var/www/discourse/app/services/destroy_task.rb:25:in `block in destroy_topics'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord- `block (2 levels) in find_each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord- `each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord- `block in find_each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord- `block in find_in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord- `block in in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord- `loop'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord- `in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord- `find_in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord- `find_each'
/var/www/discourse/app/services/destroy_task.rb:19:in `destroy_topics'
/var/www/discourse/lib/tasks/destroy.rake:11:in `block in <main>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => destroy:topics
(See full trace by running task with --trace)

So, what did I wrong?

rails c
[1] pry(main)> Topic.find(84010).destroy

Killed that topic, but I still can’t delete stuff from the browser.

Its on a desktop pc running on Slack, sitting right next to me, so no provider.

It contains a rather large import from smf. Deleting topics used to work, suddenly stopped. I’m trying to reorganise the import into a structure more suitable to discourse - the old forum had a lot of depth in its structure.

I have now dumped, wiped and reimported the database. That made everything a little bit faster, but the problem remains.

1 Like

Take a look at this. Are you trying to work with a restricted category which hasn’t got any groups attached to it?

1 Like


I have just tried to delete a topic somewhere else on that forum, and that works. It might indeed be a problem with the import from smf that attached the groups in a weird way.

Thanks for the pointer!

Indeed, adding a group to the category (and all subcategories) did work. Thank you very much.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.