Cannot create repository version due to duplicate values

Problem:
When syncing a repo receiving the below:

{
“traceback”: " File “/usr/local/lib/python3.9/site-packages/pulpcore/tasking/tasks.py”, line 70, in _execute_task\n result = func(*args, **kwargs)\n File “/usr/local/lib/python3.9/site-packages/pulp_rpm/app/tasks/synchronizing.py”, line 568, in synchronize\n repo_version = dv.create() or repo.latest_version()\n File “/usr/local/lib/python3.9/site-packages/pulpcore/plugin/stages/declarative_version.py”, line 161, in create\n loop.run_until_complete(pipeline)\n File “/usr/local/lib/python3.9/site-packages/pulpcore/app/models/repository.py”, line 1207, in exit\n repository.finalize_new_version(self)\n File “/usr/local/lib/python3.9/site-packages/pulp_rpm/app/models/repository.py”, line 419, in finalize_new_version\n validate_duplicate_content(new_version)\n File “/usr/local/lib/python3.9/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.”
}

Any idea how to narrow down or find what that duplicate entry is so it can be cleared out?

Expected outcome:

More details on what the duplicate value is so it can be cleared

Pulpcore version:
3.54.0

Pulp plugins installed and their versions:
“component”: “ansible”,
“version”: “0.21.5”,

“component”: “container”,
“version”: “2.20.0”,

“component”: “deb”,
“version”: “3.2.0”,

“component”: “gem”,
“version”: “0.5.1”,

“component”: “maven”,
“version”: “0.8.0”,

“component”: “ostree”,
“version”: “2.3.0”,

“component”: “python”,
“version”: “3.11.1”,

“component”: “rpm”,
“version”: “3.25.3”,

“component”: “certguard”,
“version”: “3.54.0”,

“component”: “file”,
“version”: “3.54.0”,

Operating system - distribution and version:
Red Hat Enterprise Linux release 9.4

Other relevant data:

Can you tell us what URL you are syncing from, and what sync-settings you are using? (e.g., on_demand/immediate, mirror/content-only, etc)

This was syncing (on_demand) and was the rhel-7-server-els-rpms (https://cdn.redhat.com/content/els/rhel/server/7/7Server/x86_64/os) url. This same remote URL worked on one of our other repositories without issue so I am thinking perhaps either a failed/aborted sync might have left some remnants on this one that are now in conflict

Hm. Sync creates a new repository-version on successful-sync, there shouldn’t be any debris. But I suppose a hard-enough failure might have.

This specific error is “You’ve asked me to create a repository-version that has 2 RPMs with the same NEVRA and location but different checksums (I think), and that’s Not Allowed”.

@dralley @ipanova - any thoughts here?

Have you tried creating a second new Pulp repository and syncing the remote to it? In other words: Does this happen on the initial sync or is it somehow related to what is already there from a previous sync?

I am slightly confused here, because we call remove_duplicates before validate_duplicate_content which is causing the error.

1 Like

Yeah, OP says “This same remote URL worked on one of our other repositories” - so it seems to be specific to the state this particular repo is in.

Oooo, good catch Ina!

Sorry on the delay, yes I can confirm that something strange in terms of the state of that exact repo. As noted I was able to sync the same remote source into other repos and also we got a similar error on another repo so as a test I destroyed that repo, recreated and synced to the exact same remote source that was giving the duplicate error and on the fresh creation and sync it worked without issue.

What remote-url was on that “other repo”, please?

It was also RHEL7, however it was a combination of the below:

Name: rhel-7-server-els-optional-debug-rpms
Url: https://cdn.redhat.com/content/els/rhel/server/7/7Server/x86_64/optional/debug
Name: rhel-7-server-els-debug-rpms
Url: https://cdn.redhat.com/content/els/rhel/server/7/7Server/x86_64/debug
Name: rhel-7-server-els-optional-rpms
Url: https://cdn.redhat.com/content/els/rhel/server/7/7Server/x86_64/optional/os
Name: rhel-7-server-els-rpms
Url: https://cdn.redhat.com/content/els/rhel/server/7/7Server/x86_64/os

We Synced the above into a Prime-RHEL7 repo so we can present a singular repo to the end user hosts. On the main host all 4 of those synced and published without issue. We then have other pulp hosts in a different network area which used that Prime-RHEL7 from the main pulp host as its remote. Using that approach 2 of the 3 worked without issue and 1 had the same duplication error.

I am wondering if perhaps this is in any way related to the change from standard support to extended support. We did in the past sync those same repositories from the main live Red Hat repositories for RHEL7 then updated to use the ELS once the support ended on June 30th. I wonder if some of those older packages from the previous Red Hat Remote repos are inconsistent with the newer ones from ELS… however not sure how some of our repos are working when the content should be the same across them all.

RHEL7 does seem to be the consistent factor here, we have a similar approach for our repos for RHEL8 and RHEL9 and so far not encountered an issue with anything related to those.

1 Like

It def feels as if, whatever is going on here, is an artifact of the RHEL7-to-ELS changeover. I don’t have a real explanation, mind, beyond “feels like something changed at Exactly the Wrong Time for some of your repos”.

Yes the last monthly sync we did would have been on July 1st so it could be that cutover. I think what we might do is look into recreating each of them fresh and then monitor going forward. Especially given that RHEL8 and RHEL9 seem trouble free and in recent months those have received a large number of updates from Red Hat vs the seemingly lower number of package changes for RHEL7.

I had hoped that I might be missing something and perhaps there was a way to get more verbose output from this section that errored out to list the problem entry that it is seeing

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.”

Which might have allowed the removal of that exact artifact but not sure a method to highlight which exact part of the sync it is having an issue with is available.

Thanks everyone for your investigation and your replies much appreciated.

1 Like