Katello 4.2.1 Smart Proxy reporting (Cannot create repository version. More than one rpm.package content with the duplicate values)

Greetings Foreman/Katello Community,

We have started to see this error on our Smart Proxies:

“Cannot create repository version. More than one rpm.package content with the duplicate values for name, epoch, version, release, arch, location_href.”

My questions are how do we fix this and how do we determine what the problem repo/package is?

Part of the errors include:

Actions::Pulp3::CapsuleContent::Sync
Input:
{“repository_id”=>1855,
“smart_proxy_id”=>4,
“options”=>{“skip_metadata_check”=>false},
“remote_user”=>“admin”,
“remote_cp_user”=>“XXXXXXX”,
“current_request_id”=>“dcff2ec7-9921-4606-9ed2-e5eed09f6f67”,
“current_timezone”=>“America/Los_Angeles”,
“current_organization_id”=>nil,
“current_location_id”=>2,
“current_user_id”=>4}
Output:
{“smart_proxy_history_id”=>5950,
“pulp_tasks”=>

But when I do a hammer repository list on the main katello sever I am not seeing RepoID 1855.

Problem:

We are running Katello 4.2.1 and Foreman 3.0.1

Lately syncs to our Smart Proxy are reporting this error:

“Cannot create repository version. More than one rpm.package content with the duplicate values for name, epoch, version, release, arch, location_href.”

Expected outcome:

The sync should complete and be able to handle exceptions. I believe the rest of the content has made it over but I am not 100% certain.

Foreman and Proxy versions:

We are running Katello 4.2.1 and Foreman 3.0.1

Foreman and Proxy plugin versions:

Distribution and version:

CentOS 7.9

Other relevant data:

Any insight would be most appreciated.

Thx,

Eledor

Hi,

On the smart proxy page, under synchronize can you try a complete sync and see if that gives the same error?

Hi there,

Thanks for the reply.

We have seen this both on an Optimized Sync and on a Complete Sync.

When I checked the Proxy over my coffee this morning it says it synchronized fine over night.

What is also puzzling is that when I navigated to the Infrastructure → Smart Proxy Page → it would report a big red popup with the aforementioned error when we had the issue. However, when I look at the logs for the Proxy in question and select either ERROR or WARN the previous error of, "Cannot create repository version. More than one rpm.package content with the duplicate values for name, epoch, version, release, arch, location_href.” isn’t there.

How could it now be working I guess is my first question? :slight_smile: Maybe the upstream repo was fixed? The second question that comes to mind is why isn’t this logged?

Cheers,

Eledor

@eledor Is it possible that the upstream repo fixed itself, and then the repo was resynced, and then for this reason the smart proxy sync was successful?

We’ve done a fair bit of work in this area to smooth out issues caused by faulty repos, so it’s possible this issue no longer exists in recent versions - I assume it hasn’t recurred?

hi @dralley,

Thanks for pinging me back on this. We are seeing much better performance in terms of repo syncs to proxies now that we are on Katello 4.3!

Haven’t seen this particular issue since our upgrade.

Cheers,

Eledor

1 Like

I get this error on a newly upgraded foreman 3.10 + katello 4.12:

I have tried to resync ALL the repos that this content view is based on (all Oracle Linux 8 repos) as suggested in RHEL support case https://access.redhat.com/solutions/6999795 - but to no avail.

The crash inside the content view builder is:
{"traceback"=> " File \"/usr/lib/python3.11/site-packages/pulpcore/tasking/tasks.py\", line 61, in _execute_task\n" + " result = func(*args, **kwargs)\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + " File \"/usr/lib/python3.11/site-packages/pulpcore/app/tasks/repository.py\", line 233, in add_and_remove\n" + " with repository.new_version(base_version=base_version) as new_version:\n" + " File \"/usr/lib/python3.11/site-packages/pulpcore/app/models/repository.py\", line 1105, in __exit__\n" + " repository.finalize_new_version(self)\n" + " File \"/usr/lib/python3.11/site-packages/pulp_rpm/app/models/repository.py\", line 349, in finalize_new_version\n" + " validate_duplicate_content(new_version)\n" + " File \"/usr/lib/python3.11/site-packages/pulpcore/plugin/repo_version_utils.py\", line 107, in validate_duplicate_content\n" + " raise ValueError(\n", "description"=> "Cannot create repository version. More than one rpm.package content with the duplicate values for name, epoch, version, release, arch, location_href."}, "worker"=>"/pulp/api/v3/workers/01901149-ac13-764d-8001-89d06569221d/",
I have full control over the server and can provide debugging information if need be.

Thank you for an awesome system!

/Allan

Is there any way I can brute-force remove these duplicates inside the database without jeopadizing the integrity og my existing (and working) content views (that have already been promoted to life-cycles)?

Thanks
/Allan