Remove orphan tasks failing on Katello 4.9

Hi…i have the same problem on ( * foreman-3.6.1-1.el8.noarch, * katello-4.8.4-1.el8.noarch, RHEL 8.6).

(“Cannot delete some instances of model ‘Content’ because they are referenced through protected foreign keys: ‘Package.content_ptr’.”, {<RepositoryContent: pk=4ad788c7-9e48-49f5-8160-7a480662dee5>})

python39-pulp-deb.noarch 2.20.2-1.el8
rubygem-pulp_deb_client.noarch 2.20.2-1.el8

Task Output:

{“pulp_tasks”=>
[{“pulp_href”=>“/pulp/api/v3/tasks/b6779640-721e-4343-b309-ec36a174ab29/”,
“pulp_created”=>“2023-08-17T11:09:45.443+00:00”,
“state”=>“failed”,
“name”=>“pulpcore.app.tasks.orphan.orphan_cleanup”,
“logging_cid”=>“ed652e2287cc465597d9ac5691c2f131”,
“started_at”=>“2023-08-17T11:09:45.570+00:00”,
“finished_at”=>“2023-08-17T11:10:00.011+00:00”,
“error”=>
{“traceback”=>
#<Sequel::SQL::Blob:0xe9fb448 bytes=106 start=" File "/u" end=“form_task\n”> +
#<Sequel::SQL::Blob:0xe9fb45c bytes=35 start=" result" end=“**kwargs)\n”> +
#<Sequel::SQL::Blob:0xe9fb470 bytes=99 start=" File "/u" end=“n_cleanup\n”> +
#<Sequel::SQL::Blob:0xe9fb484 bytes=15 content=" c.delete()\n"> +
#<Sequel::SQL::Blob:0xe9fb498 bytes=89 start=" File "/u" end=“in delete\n”> +
#<Sequel::SQL::Blob:0xe9fb4ac bytes=33 start=" collec" end=“el_query)\n”> +
#<Sequel::SQL::Blob:0xe9fb4c0 bytes=93 start=" File "/u" end=“n collect\n”> +
#<Sequel::SQL::Blob:0xe9fb4d4 bytes=26 start=" raise " end=“tedError(\n”>,
“description”=>
“("Cannot delete some instances of model ‘Content’ because they are referenced through protected foreign keys: ‘Package.content_ptr’.", {<RepositoryContent: pk=4ad788c7-9e48-49f5-8160-7a480662dee5>})”},
“worker”=>“/pulp/api/v3/workers/e029c1d6-5621-4b57-919b-9702582cea04/”,
“child_tasks”=>,
“progress_reports”=>
[{“message”=>“Clean up orphan Content”,
“code”=>“clean-up.content”,
“state”=>“running”,
“total”=>79587,
“done”=>2000}],
“created_resources”=>,
“reserved_resources_record”=>[“/pulp/api/v3/orphans/cleanup/”]}],
“task_groups”=>,
“poll_attempts”=>{“total”=>7, “failed”=>1}}