Problem:
The scheduled remove orphans task fails with a pulp3error.
Expected outcome:
task successful
Foreman and Proxy versions:
Foreman 3.5.1
Foreman and Proxy plugin versions:
plugins | version |
---|---|
foreman-tasks | 7.1.1 |
foreman_bootdisk | 21.0.3 |
foreman_puppet | 5.0.0 |
foreman_remote_execution | 8.2.0 |
katello | 4.7.1 |
puppetdb_foreman | 6.0.1 |
Distribution and version:
Oracle Linux Server release 8.7
Other relevant data:
Last week I proceed to migrate our server from CentOS 7 with Foreman 3.3 - Katello 4.5 to a new OracleLinux 8 server. I did a full backup, installed a new server from scratch with Foreman 3.3 - Katello 4.5, restored my backup and follow the upgrade path to Foreman 3.5 - Katello 4.7.
This is the first run of the delete ophans since then.
I take a look to this topic: Remove Orphans task fails but my distribution.py file seems to be up to date.
Output:
{"pulp_tasks"=>
[{"pulp_href"=>"/pulp/api/v3/tasks/ec88a399-ac2a-4ca0-a149-7e2794fbac4f/",
"pulp_created"=>"2023-02-07T14:34:04.771+00:00",
"state"=>"failed",
"name"=>"pulpcore.app.tasks.orphan.orphan_cleanup",
"logging_cid"=>"a667bb2c44f540ef893fcd4fb6771bb7",
"started_at"=>"2023-02-07T14:34:04.837+00:00",
"finished_at"=>"2023-02-07T14:34:08.645+00:00",
"error"=>
{"traceback"=>
#<Sequel::SQL::Blob:0x277cc bytes=106 start=" File \"/u" end="form_task\n"> +
#<Sequel::SQL::Blob:0x277e0 bytes=35 start=" result" end="**kwargs)\n"> +
#<Sequel::SQL::Blob:0x277f4 bytes=99 start=" File \"/u" end="n_cleanup\n"> +
#<Sequel::SQL::Blob:0x27808 bytes=15 content=" c.delete()\n"> +
#<Sequel::SQL::Blob:0x2781c bytes=89 start=" File \"/u" end="in delete\n"> +
#<Sequel::SQL::Blob:0x27830 bytes=33 start=" collec" end="el_query)\n"> +
#<Sequel::SQL::Blob:0x27844 bytes=93 start=" File \"/u" end="n collect\n"> +
#<Sequel::SQL::Blob:0x27858 bytes=26 start=" raise " end="tedError(\n">,
"description"=>
#<Sequel::SQL::Blob:0x2786c bytes=512 start="(\"Cannot d" end="ce3b56b>})">},
"worker"=>"/pulp/api/v3/workers/df0cab6e-8da4-4848-95f5-e545184d3536/",
"child_tasks"=>[],
"progress_reports"=>
[{"message"=>"Clean up orphan Content",
"code"=>"clean-up.content",
"state"=>"running",
"total"=>105,
"done"=>105}],
"created_resources"=>[],
"reserved_resources_record"=>["/pulp/api/v3/orphans/cleanup/"]}],
"task_groups"=>[],
"poll_attempts"=>{"total"=>17, "failed"=>3}}
Exception
Katello::Errors::Pulp3Error: ("Cannot delete some instances of model 'Content' because
they are referenced through protected foreign keys: 'ReleaseFile.content_ptr'.",
{<RepositoryContent: pk=be06739d-df16-4d26-84e1-e1635adab109>, <RepositoryContent:
pk=56781222-da5d-4551-bbb2-00d00a929b50>, <RepositoryContent: pk=79585b18-0ce4-427a-
ae37-36af20385ca2>, <RepositoryContent: pk=f64c8b94-53d3-4e4d-8dfd-5271b71dd90c>,
<RepositoryContent: pk=8c2dab7e-f71d-4975-8bd4-a50f5056a36d>, <RepositoryContent:
pk=53e529c6-9c55-41a3-b07d-5d08fce3b56b>})```
Thanks to anyone that could help me with this