Bug 1150714 - unable to publish repo if distribution unit changes [NEEDINFO]
Summary: unable to publish repo if distribution unit changes
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: rpm-support
Version: 2.4.1
Hardware: Unspecified
OS: Unspecified
urgent
medium
Target Milestone: ---
: 2.4.2
Assignee: Chris Duryee
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: 1144194
TreeView+ depends on / blocked
 
Reported: 2014-10-08 19:02 UTC by Chris Duryee
Modified: 2018-12-09 18:48 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-13 19:58:15 UTC
Embargoed:
gassmann: needinfo?


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1250343 0 None None None Never

Description Chris Duryee 2014-10-08 19:02:54 UTC
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

Comment 1 Chris Duryee 2014-10-08 20:39:02 UTC
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.

Comment 2 Chris Duryee 2014-10-09 13:53:45 UTC
https://github.com/pulp/pulp_rpm/pull/574

Comment 3 Chris Duryee 2014-10-12 18:23:12 UTC
merged to 2.4-testing and up

Comment 4 Chris Duryee 2014-10-12 18:24:08 UTC
build: 2.4.2-0.1.beta

Comment 5 Preethi Thomas 2014-10-13 15:32:45 UTC
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.

Comment 11 Philipp Gassmann 2014-11-07 10:57:10 UTC
The Problem also occurs when migrating from Pulp 2.3 to Pulp 2.4

https://roidelapluie.be/blog/2014/10/08/pulp-horror-fest/


Note You need to log in before you can comment on or make changes to this bug.