Description of problem: If a user syncs and publishes a repo with a distribution unit and then that repo is updated, an additional distirbution unit will be created and associated with the repo. This is not allowed and will cause publish to fail. Version-Release number of selected component (if applicable): 2.4.1 How reproducible: every time Steps to Reproduce (there are other ways to do this but this is how I did it): 1. download a kickstart repo locally (not in pulp) and create a symlink to it from your /var/www/html/ 2. add a repo in pulp with a feed url of "http://localhost/your-symlink/" 3. sync/publish 4. download a newer kickstart repo locally and move your symlink to that new repo 5. sync/publish Actual results: Error publishing repository <repo>. More than one distribution found. Task Failed Error publishing repository <repo>. More than one distribution found. Expected results: successful publish
workaround: pulp-admin rpm repo content distribution --repo-id <failing repo id> pulp-admin rpm repo remove distribution --repo-id <failing repo id> --in="id=<id returned from previous command>" At this point, the old distribution unit has been removed and publish should work.
https://github.com/pulp/pulp_rpm/pull/574
merged to 2.4-testing and up
build: 2.4.2-0.1.beta
verified [root@cloud-qe-20 ~]# rpm -qa pulp-server pulp-server-2.4.2-0.1.beta.el6.noarch [root@cloud-qe-20 ~]# [root@cloud-qe-20 ~]# pulp-admin rpm repo create --repo-id rhel-ks --feed https://cdn.redhat.com/content/dist/rhel/server/6/6.3/x86_64/kickstart/ --serve-http true --feed-ca-cert CDN/cdn.redhat.com-chain.crt --feed-cert CDN/1391032266_4771.crt --feed-key CDN/1391032266_4771.key --validate true Successfully created repository [rhel-ks] [root@cloud-qe-20 ~]# [root@cloud-qe-20 ~]# [root@cloud-qe-20 ~]# [root@cloud-qe-20 ~]# [root@cloud-qe-20 ~]# [root@cloud-qe-20 ~]# pulp-admin rpm repo sync run --repo-id rhel-ks +----------------------------------------------------------------------+ Synchronizing Repository [rhel-ks] +----------------------------------------------------------------------+ A sync task is already in progress for this repository. Its progress will be tracked below. This command may be exited via ctrl+c without affecting the request. Downloading metadata... [\] ... completed Downloading repository content... [==================================================] 100% RPMs: 3585/3585 items Delta RPMs: 0/0 items ... completed Downloading distribution files... [==================================================] 100% Distributions: 7/7 items ... completed Importing errata... [-] ... completed Importing package groups/categories... [\] ... completed Task Succeeded Initializing repo metadata [-] ... completed Publishing Distribution files [-] ... completed Publishing RPMs [==================================================] 100% 3585 of 3585 items ... completed Publishing Delta RPMs ... skipped Publishing Errata [-] ... completed Publishing Comps file [==================================================] 100% 212 of 212 items ... completed Publishing Metadata. [-] ... completed Closing repo metadata [-] ... completed Generating sqlite files ... skipped Publishing files to web [-] ... completed Writing Listings File [-] ... completed Task Succeeded [root@cloud-qe-20 ~]# pulp-admin rpm repo update --repo-id rhel-ks --feed https://cdn.redhat.com/content/dist/rhel/server/6/6.4/x86_64/kickstart/ Repository [rhel-ks] successfully updated [root@cloud-qe-20 ~]# [root@cloud-qe-20 ~]# [root@cloud-qe-20 ~]# pulp-admin rpm repo sync run --repo-id rhel-ks+----------------------------------------------------------------------+ Synchronizing Repository [rhel-ks] +----------------------------------------------------------------------+ This command may be exited via ctrl+c without affecting the request. Downloading metadata... [|] ... completed Downloading repository content... [==================================================] 100% RPMs: 1269/1269 items Delta RPMs: 0/0 items ... completed Downloading distribution files... [==================================================] 100% Distributions: 7/7 items ... completed Importing errata... [-] ... completed Importing package groups/categories... [|] ... completed Task Succeeded Initializing repo metadata [-] ... completed Publishing Distribution files [-] ... completed Publishing RPMs [==================================================] 100% 4854 of 4854 items ... completed Publishing Delta RPMs ... skipped Publishing Errata [-] ... completed Publishing Comps file [==================================================] 100% 212 of 212 items ... completed Publishing Metadata. [-] ... completed Closing repo metadata [-] ... completed Generating sqlite files ... skipped Publishing files to web [\] ... completed Writing Listings File [-] ... completed Task Succeeded Tailing log I see this Oct 13 09:53:10 cloud-qe-20 pulp: requests.packages.urllib3.connectionpool:INFO: Starting new HTTPS connection (1): cdn.redhat.com Oct 13 09:56:06 cloud-qe-20 pulp: pulp_rpm.plugins.importers.yum.parse.treeinfo:INFO: Removing out-of-date distribution unit {u'arch': u'x86_64', u'version': u'6.3', u'variant': u'Server', u'id': u'ks-Red Hat Enterprise Linux-Server-6.3-x86_64', u'family': u'Red Hat Enterprise Linux'} for repo rhel-ks Also kickstarted a vm after the 2nd sync and made sure that it worked as well.
The Problem also occurs when migrating from Pulp 2.3 to Pulp 2.4 https://roidelapluie.be/blog/2014/10/08/pulp-horror-fest/