Bug 975980 - the pulp server never notifies consumers of relative url changes for rpm repos
Summary: the pulp server never notifies consumers of relative url changes for rpm repos
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: rpm-support
Version: 2.2 Beta
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 2.3.0
Assignee: Barnaby Court
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-19 17:42 UTC by Jeremy Cline
Modified: 2013-12-09 14:32 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-09 14:32:01 UTC
Embargoed:


Attachments (Terms of Use)

Description Jeremy Cline 2013-06-19 17:42:47 UTC
Description of problem: After a consumer is bound to a repository, the server never notifies consumers of relative url changes. However, since old relative pathes and symlinks are not cleaned up, this is only a problem if you create a new repo, bind a consumer, then change the relative url and sync.


Version-Release number of selected component (if applicable): pulp-server-2.2.0-0.4.beta.fc18.noarch


How reproducible: always


Steps to Reproduce:
Since repos don't clean up after themselves when they're deleted, make sure /var/lib/pulp/published/https/repos is cleaned up before trying to reproduce this.

1. pulp-admin rpm repo create --repo-id=zoo --feed=http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/
2. pulp-admin rpm consumer bind --consumer-id=jeremy --repo-id=zoo
3. pulp-admin rpm repo update --repo-id=zoo --relative-url=my/zoo
4. pulp-admin rpm repo sync run --repo-id=zoo
5. pulp-admin rpm consumer package install run --consumer-id=jeremy --name=bear

Actual results: Package fails to install


Expected results: The package successfully installs


Additional info: 
The consumer never hears about a changed url:
2013-06-19 13:28:13,513 [INFO][worker-0] dispatch() @ dispatcher.py:631 - request: {'classname': 'Consumer', 'kws': {}, 'args': [[{'repo_id': 'zoo', 'details': {'ca_cert': None, 'server_name': 'jcline.vm.com', 'relative_path': '/pulp/repos/zoo', 'gpg_keys': [], 'client_cert': None, 'protocols': ['https'], 'repo_name': 'zoo'}, 'type_id': 'yum_distributor'}], {}], 'method': 'bind', 'cntr': None}
2013-06-19 13:28:13,515 [INFO][worker-0] bind() @ bind.py:43 - bind: {'repo_id': 'zoo', 'details': {'ca_cert': None, 'server_name': 'jcline.vm.com', 'relative_path': '/pulp/repos/zoo', 'gpg_keys': [], 'client_cert': None, 'protocols': ['https'], 'repo_name': 'zoo'}}, options:{}
2013-06-19 13:28:13,521 [INFO][worker-0] bind() @ repolib.py:108 - Binding repo [zoo]
2013-06-19 13:28:13,522 [INFO][worker-0] _handle_host_urls() @ repolib.py:342 - Configuring repo [zoo] to use baseurl [https://jcline.vm.com/pulp/repos/zoo]
2013-06-19 13:28:13,522 [INFO][worker-0] bind() @ repolib.py:134 - Adding new repo [zoo]
2013-06-19 13:28:13,522 [INFO][worker-0] sendreply() @ rmi.py:172 - 470ed184-0c5a-4925-b270-19749379886c processed in: 42 (ms)
2013-06-19 13:30:25,112 [INFO][worker-0] dispatch() @ dispatcher.py:631 - request: {'classname': 'Content', 'kws': {}, 'args': [[{'unit_key': {'name': 'bear'}, 'type_id': 'rpm'}], {'apply': True, 'reboot': False, 'importkeys': False}], 'method': 'install', 'cntr': None}
2013-06-19 13:30:25,205 [ERROR][worker-0] install() @ dispatcher.py:80 - handler failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/agent/lib/dispatcher.py", line 76, in install
    report = handler.install(conduit, units, dict(options))
  File "/usr/lib/pulp/agent/handlers/rpm.py", line 99, in install
    details = pkg.install(names)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/handler/rpmtools.py", line 127, in install
    yb.install(pattern=info)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 4447, in install
    mypkgs = self.pkgSack.returnPackages(patterns=pats,
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1014, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 780, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 313, in populateSack
    self.doSetup()
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 138, in doSetup
    self.retrieveAllMD()
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 84, in retrieveAllMD
    dl = repo._async and repo._commonLoadRepoXML(repo)
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1412, in _commonLoadRepoXML
    result = self._getFileRepoXML(local, text)
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1190, in _getFileRepoXML
    size=102400) # setting max size as 100K
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1004, in _getFile
    raise Errors.NoMoreMirrorsRepoError(errstr, errors)
NoMoreMirrorsRepoError: failure: repodata/repomd.xml from zoo: [Errno 256] No more mirrors to try.
https://jcline.vm.com/pulp/repos/zoo/repodata/repomd.xml: [Errno 14] curl#22 - "NSS: client certificate not found (nickname not specified)"
2013-06-19 13:30:25,205 [INFO][worker-0] sendreply() @ rmi.py:172 - f997de7b-84de-4269-b5c8-de2e5eb4e72d processed in: 125 (ms)


and the contents of /etc/yum.repo.d/pulp.repo after a relative url update:
[jeremy@jcline repos]$ cat /etc/yum.repos.d/pulp.repo 
#
# Pulp Repositories
# Managed by Pulp client
#

[zoo]
name = zoo
enabled = 1
sslverify = 0
gpgcheck = 0
baseurl = https://jcline.vm.com/pulp/repos/zoo

Comment 2 Barnaby Court 2013-09-24 20:46:34 UTC
PR: https://github.com/pulp/pulp/pull/630

Comment 3 Jeff Ortel 2013-09-26 15:36:44 UTC
build: 2.3.0-0.15.alpha

Comment 4 Preethi Thomas 2013-09-30 13:16:01 UTC
verified
[root@pulp-v2-server ~]# rpm -qa pulp-server
pulp-server-2.3.0-0.16.alpha.el6.noarch
[root@pulp-v2-server ~]# 

[root@pulp-v2-server ~]# pulp-admin rpm consumer bind --consumer-id pulp-client --repo-id=zoo
This command may be exited via ctrl+c without affecting the request.

-- Updating Pulp Server --
[-]
Waiting to begin...

[-]
Running...

Task Succeeded


-- Notifying the Consumer --
[-]
Waiting to begin...

[-]
Running...

Task Succeeded


[root@pulp-v2-server ~]# pulp-admin rpm repo update --repo-id=zoo --relative-url=my/zoo
Repository [zoo] successfully updated

[root@pulp-v2-server ~]# pulp-admin rpm repo sync run --repo-id=zoo
+----------------------------------------------------------------------+
                     Synchronizing Repository [zoo]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

Downloading metadata...
[\]
... completed

Downloading repository content...
[==================================================] 100%
RPMs:       0/0 items
Delta RPMs: 0/0 items

... completed

Downloading distribution files...
[==================================================] 100%
Distributions: 0/0 items
... completed

Importing errata...
[-]
... completed

Importing package groups/categories...
[-]
... completed

Publishing packages...
[==================================================] 100%
Packages: 32/32 items
... completed

Publishing distributions...
[==================================================] 100%
Distributions: 0/0 items
... completed

Generating metadata
[\]
... completed

Publishing repository over HTTPS
[-]
... completed

[root@pulp-v2-server ~]# pulp-admin rpm consumer package install run --consumer-id=pulp-client --name=bear
This command may be exited via ctrl+c without affecting the request.

[-]
Waiting to begin...
Refresh Repository Metadata             [ OK ]
Downloading Packages                    [ OK ]
Check Package Signatures                [ OK ]
Running Test Transaction                [ OK ]
Running Transaction                     [ OK ]

Install Succeeded

+----------------------------------------------------------------------+
                               Installed
+----------------------------------------------------------------------+

Name:    bear
Version: 4.1
Arch:    noarch
Repoid:  zoo



[root@pulp-v2-server ~]# 
[root@pulp-v2-server ~]#

Comment 5 Preethi Thomas 2013-12-09 14:32:01 UTC
Pulp 2.3 released.


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