Hi,
we are automatically suspending profiles that were not used for at least one year with the plugin discourse-auto-suspend.
Later on we are then deleting the profiles with all their posts and topics.
(we do have delete user max post age = 3700 and delete all posts max = 999)
So far I have deleted already in the last couple of months more then 1500 users with several thousand posts and probably more then one thousand topics.
But now I do have a users where the system did start to delete the posts but now the user remains at 68 posts and 63 topics no matter how often I click on the button to delete the posts and threads.
Looking at /logs it does show the following warning:
Failed to process hijacked response correctly : Couldn't find Topic with 'id'=569
When I do look with the data explorer plugin into the table topics then is there no topic with this id 569.
568 does exist from 2017-05-22 14:01:35.419842 and then 570 from 2017-05-22 14:20:27.610993
But when I look in the table posts then I do there see a topic_id 569 with 9 posts.
Looks like there is a database inconsistency. In May 2017 I was not yet the admin, so I do not know if there had eventually been some system problems at that time.
Is there any way I can solve the problem to that the delete button does continue to delete the entries?
here the backtrace of this warning:
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation/finder_methods.rb:346:in `raise_record_not_found_exception!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation/finder_methods.rb:454:in `find_one'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation/finder_methods.rb:433:in `find_with_ids'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation/finder_methods.rb:69:in `find'
/var/www/discourse/app/serializers/post_serializer.rb:397:in `topic'
/var/www/discourse/app/serializers/post_serializer.rb:87:in `topic_slug'
(eval):22:in `_fast_attributes'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:468:in `rescue in attributes'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:455:in `attributes'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:480:in `_serializable_hash'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:359:in `serializable_hash'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:347:in `as_json'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/json/encoding.rb:35:in `encode'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/json/encoding.rb:22:in `encode'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/core_ext/object/json.rb:41:in `to_json'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:331:in `to_json'
/var/www/discourse/app/models/web_hook.rb:95:in `generate_payload'
/var/www/discourse/lib/post_destroyer.rb:48:in `destroy'
/var/www/discourse/app/models/user.rb:789:in `block in delete_all_posts!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation/delegation.rb:41:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation/delegation.rb:41:in `each'
/var/www/discourse/app/models/user.rb:788:in `delete_all_posts!'
/var/www/discourse/app/controllers/admin/users_controller.rb:51:in `block in delete_all_posts'
/var/www/discourse/lib/hijack.rb:56:in `instance_eval'
/var/www/discourse/lib/hijack.rb:56:in `block in hijack'
/var/www/discourse/lib/scheduler/defer.rb:94:in `block in do_work'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.4/lib/rails_multisite/connection_management.rb:63:in `with_connection'
/var/www/discourse/lib/scheduler/defer.rb:89:in `do_work'
/var/www/discourse/lib/scheduler/defer.rb:79:in `block (2 levels) in start_thread'