Description of problem: After syncing a repository with packages and errata, i can query the repositories packages just fine, but querying the errata always comes back empty. a POST to https://dhcp231-16.rdu.redhat.com/pulp/api/v2/repositories/integration_test_id/search/units/ with body: {"criteria":{"sort":{"unit":[["title","ascending"]]},"type_ids":["erratum"]}} always seems to return an empty array. Poking around in the db: > db.units_erratum.find() returns 2 errata. However > db.repo_content_units.find({'unit_type_id':'erratum'}) returns nothing. This was working previously (in the CR).
$ pulp-admin rpm repo create --repo-id=testerrata --feed=http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/pulp_unittest/ Successfully created repository [testerrata] $ pulp-admin rpm repo sync run --repo-id=testerrata +----------------------------------------------------------------------+ Synchronizing Repository [testerrata] +----------------------------------------------------------------------+ 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: 3/3 items Delta RPMs: 0/0 items Tree Files: 3/3 items Files: 0/0 items ... completed Importing errata... [\] ... completed Importing package groups/categories... [-] ... completed Publishing packages... [==================================================] 100% Packages: 0/0 items ... completed Publishing distributions... [==================================================] 100% Distributions: 3/3 items ... completed Generating metadata [\] ... completed Publishing repository over HTTP [-] ... skipped Publishing repository over HTTPS [-] ... completed $ mongo pulp_database MongoDB shell version: 2.0.7 connecting to: pulp_database > db.repo_content_units.find({'unit_type_id':'erratum'}) { "_id" : ObjectId("508ac8f3bf5f9260ad000063"), "updated" : "2012-10-26T21:31:31Z", "repo_id" : "testerrata", "created" : "2012-10-26T21:31:31Z", "_ns" : "repo_content_units", "unit_id" : "8774e826-a723-412e-91fd-b357d8f7c22a", "unit_type_id" : "erratum", "owner_type" : "importer", "id" : "508ac8f3bf5f9260ad000063", "owner_id" : "yum_importer" } ... from the cli I can do an equivalent command: $ pulp-admin rpm repo content errata --repo-id=testerrata --fields=id,title --sort=ascending Id: RHBA-2008:0305 Title: xen bug fix and enhancement update Id: RHBA-2010:0282 Title: python-virtinst bug fix and enhancement update Id: RHEA-2009:1270 Title: libvirt-cim bug fix and enhancement update Id: RHBA-2007:0112 Title: virt-manager bug fix update Id: RHBA-2010:0251 Title: perl-Sys-Virt bug fix update Id: RHBA-2009:0216 Title: python-virtinst enhancement and bug fix update Id: RHSA-2008:0194 Title: Important: xen security and bug fix update Id: RHBA-2009:1092 Title: xen bug fix update Id: RHBA-2007:0611 Title: Virtualization_Guide enhancement update Id: RHEA-2008:0371 Title: python-virtinst enhancement and bug fix update Id: RHBA-2010:0206 Title: libvirt-cim bug fix and enhancement update Id: RHSA-2009:0382 Title: Moderate: libvirt security update Id: RHEA-2007:0636 Title: python-virtinst enhancement update Id: RHBA-2010:0418 Title: xen bug fix update Id: RHSA-2009:0003 Title: Moderate: xen security and bug fix update Id: RHBA-2010:0205 Title: libvirt bug fix and enhancement update Id: RHSA-2008:0892 Title: Important: xen security and bug fix update Id: RHEA-2007:0635 Title: xen enhancement update Id: RHBA-2009:1412 Title: python-virtinst bug fix and enhancement update Id: RHBA-2009:1328 Title: xen bug fix and enhancement update Id: RHBA-2008:0198 Title: virt-manager bug fix update Id: RHBA-2008:0433 Title: Virtualization_Guide enhancement update Id: RHBA-2008:0480 Title: virt-manager bug fix and enhancement update Id: RHBA-2008:0279 Title: xen bug fix update Id: RHBA-2009:1424 Title: libvirt bug fix update Id: RHBA-2009:0118 Title: xen bug fix and enhancement update Id: RHBA-2008:0026 Title: python-virtinst bug fix update Id: RHEA-2009:1269 Title: libvirt bug fix and enhancement update Id: RHBA-2010:0281 Title: virt-manager bug fix update Id: RHEA-2007:0643 Title: libvirt enhancement update Id: RHBA-2008:0291 Title: libvirt bug fix and enhancement update Id: RHBA-2008:0280 Title: xen bug fix update Id: RHBA-2009:0140 Title: new package: libcmpiutil Id: RHBA-2010:0222 Title: libcmpiutil bug fix and enhancement update Id: RHEA-2007:0637 Title: virt-manager enhancement update Id: RHBA-2009:1299 Title: virt-viewer bug fix update Id: RHBA-2009:0401 Title: xen bug fix update Id: RHBA-2009:1421 Title: libvirt-cim bug fix update Id: RHSA-2007:0323 Title: Important: xen security update Id: RHBA-2009:1514 Title: xen bug fix update Id: RHEA-2009:1302 Title: New package: perl-Sys-Virt Id: RHBA-2010:0010 Title: xen bug fix update Id: RHBA-2010:0294 Title: xen bug fix and enhancement update Id: RHBA-2008:0554 Title: Virtualization_Guide bug fix update .. closing as not a bug. Feel free to re-open if you think otherwise.
Reopening. It turns out the problem only occurs if the errata is already associated with an existing repo. Create and sync a repo: pulp-admin rpm repo create --repo-id=testerrata --feed=http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/pulp_unittest/ pulp-admin rpm repo sync run --repo-id=testerrata List the errata: pulp-admin rpm repo content errata --repo-id=testerrata --fields=id,title --sort=ascending works fine. Create another repo with the same URL and sync it: pulp-admin rpm repo create --repo-id=testerrata2 --feed=http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/pulp_unittest/ --relative-url='/foo' pulp-admin rpm repo sync run --repo-id=testerrata2 pulp-admin rpm repo content errata --repo-id=testerrata2 --fields=id,title --sort=ascending NO Errata returned
Actually, i take that back. It doesn't have to already be with an existing repo, i think it just has to be synced.
I have been able to reproduce this issue by creating two different repositories with the same feel URL. I'm looking into the cause, and hopefully I'll be able to reproduce the issue with a unit test.
This branch should solve the issue: https://github.com/pulp/pulp_rpm/pull/16
Fixed. https://github.com/pulp/pulp_rpm/commit/8cad540e75291f28c12850749feecd184e821f95
build: 2.0.6-0.2.beta
verified [root@preethi-el6-pulp ~]# rpm -q pulp-server pulp-server-2.0.6-0.9.beta.noarch [root@preethi-el6-pulp ~]# [root@preethi-el6-pulp ~]# [root@preethi-el6-pulp ~]# pulp-admin rpm repo create --repo-id=testerrata --feed=http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/pulp_unittest/ Successfully created repository [testerrata] [root@preethi-el6-pulp ~]# pulp-admin rpm repo sync run --repo-id=testerrata +----------------------------------------------------------------------+ Synchronizing Repository [testerrata] +----------------------------------------------------------------------+ 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: 3/3 items Delta RPMs: 0/0 items Tree Files: 3/3 items Files: 0/0 items ... completed Importing errata... [\] ... completed Importing package groups/categories... [-] ... completed Publishing packages... [==================================================] 100% Packages: 0/0 items ... completed Publishing distributions... [==================================================] 100% Distributions: 3/3 items ... completed Generating metadata [\] ... completed Publishing repository over HTTPS [-] ... completed Publishing repository over HTTP [-] ... skipped [root@preethi-el6-pulp ~]# pulp-admin rpm repo content errata --repo-id=testerrata --fields=id,title --sort=ascending Id: RHSA-2008:0892 Title: Important: xen security and bug fix update Id: RHBA-2010:0010 Title: xen bug fix update Id: RHSA-2009:1472 Title: Moderate: xen security and bug fix update Id: RHBA-2008:0280 Title: xen bug fix update Id: RHEA-2007:0643 Title: libvirt enhancement update Id: RHBA-2008:0291 Title: libvirt bug fix and enhancement update Id: RHBA-2009:0141 Title: new package: libvirt-cim Id: RHBA-2007:0611 Title: Virtualization_Guide enhancement update Id: RHEA-2009:1270 Title: libvirt-cim bug fix and enhancement update Id: RHBA-2009:0140 Title: new package: libcmpiutil Id: RHBA-2010:0222 Title: libcmpiutil bug fix and enhancement update Id: RHBA-2008:0198 Title: virt-manager bug fix update Id: RHEA-2008:0371 Title: python-virtinst enhancement and bug fix update Id: RHEA-2009:1269 Title: libvirt bug fix and enhancement update Id: RHEA-2009:1302 Title: New package: perl-Sys-Virt Id: RHBA-2010:0206 Title: libvirt-cim bug fix and enhancement update Id: RHBA-2009:1092 Title: xen bug fix update Id: RHBA-2009:1412 Title: python-virtinst bug fix and enhancement update Id: RHEA-2008:0467 Title: new package: virt-viewer Id: RHBA-2008:0554 Title: Virtualization_Guide bug fix update Id: RHBA-2009:0216 Title: python-virtinst enhancement and bug fix update Id: RHBA-2009:1424 Title: libvirt bug fix update Id: RHBA-2009:1299 Title: virt-viewer bug fix update Id: RHBA-2010:0418 Title: xen bug fix update Id: RHBA-2008:0279 Title: xen bug fix update Id: RHBA-2009:0137 Title: virt-manager enhancement and bug fix update Id: RHBA-2008:0026 Title: python-virtinst bug fix update Id: RHBA-2010:0205 Title: libvirt bug fix and enhancement update Id: RHBA-2008:0433 Title: Virtualization_Guide enhancement update Id: RHBA-2009:0118 Title: xen bug fix and enhancement update Id: RHBA-2010:0282 Title: python-virtinst bug fix and enhancement update Id: RHSA-2007:0323 Title: Important: xen security update Id: RHBA-2009:0401 Title: xen bug fix update Id: RHSA-2009:0382 Title: Moderate: libvirt security update Id: RHBA-2008:0480 Title: virt-manager bug fix and enhancement update Id: RHEA-2007:0637 Title: virt-manager enhancement update Id: RHBA-2009:0142 Title: libvirt bug fix and enhancement update Id: RHBA-2010:0251 Title: perl-Sys-Virt bug fix update Id: RHEA-2007:0635 Title: xen enhancement update Id: RHBA-2009:1285 Title: virt-manager enhancement and bug fix update Id: RHBA-2007:0112 Title: virt-manager bug fix update Id: RHBA-2010:0294 Title: xen bug fix and enhancement update Id: RHBA-2008:0305 Title: xen bug fix and enhancement update Id: RHBA-2009:1328 Title: xen bug fix and enhancement update Id: RHBA-2009:1514 Title: xen bug fix update Id: RHSA-2007:0114 Title: Important: xen security update Id: RHEA-2007:0636 Title: python-virtinst enhancement update Id: RHSA-2008:0194 Title: Important: xen security and bug fix update Id: RHBA-2008:0189 Title: libvirt bug fix update Id: RHBA-2010:0281 Title: virt-manager bug fix update Id: RHSA-2009:0003 Title: Moderate: xen security and bug fix update Id: RHBA-2009:1421 Title: libvirt-cim bug fix update [root@preethi-el6-pulp ~]# pulp-admin rpm repo create --repo-id=testerrata2 --feed=http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/pulp_unittest/ --relative-url='/foo' Successfully created repository [testerrata2] [root@preethi-el6-pulp ~]# pulp-admin rpm repo sync run --repo-id=testerrata2 +----------------------------------------------------------------------+ Synchronizing Repository [testerrata2] +----------------------------------------------------------------------+ 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: 3/3 items Delta RPMs: 0/0 items Tree Files: 3/3 items Files: 0/0 items ... completed Importing errata... [\] ... completed Importing package groups/categories... [-] ... completed Publishing packages... [==================================================] 100% Packages: 0/0 items ... completed Publishing distributions... [==================================================] 100% Distributions: 3/3 items ... completed Generating metadata [\] ... completed Publishing repository over HTTPS [-] ... completed Publishing repository over HTTP [-] ... skipped [root@preethi-el6-pulp ~]# pulp-admin rpm repo content errata --repo-id=testerrata2 --fields=id,title --sort=ascending Id: RHSA-2008:0892 Title: Important: xen security and bug fix update Id: RHBA-2010:0010 Title: xen bug fix update Id: RHSA-2009:1472 Title: Moderate: xen security and bug fix update Id: RHBA-2008:0280 Title: xen bug fix update Id: RHEA-2007:0643 Title: libvirt enhancement update Id: RHBA-2008:0291 Title: libvirt bug fix and enhancement update Id: RHBA-2009:0141 Title: new package: libvirt-cim Id: RHBA-2007:0611 Title: Virtualization_Guide enhancement update Id: RHEA-2009:1270 Title: libvirt-cim bug fix and enhancement update Id: RHBA-2009:0140 Title: new package: libcmpiutil Id: RHBA-2010:0222 Title: libcmpiutil bug fix and enhancement update Id: RHBA-2008:0198 Title: virt-manager bug fix update Id: RHEA-2008:0371 Title: python-virtinst enhancement and bug fix update Id: RHEA-2009:1269 Title: libvirt bug fix and enhancement update Id: RHEA-2009:1302 Title: New package: perl-Sys-Virt Id: RHBA-2010:0206 Title: libvirt-cim bug fix and enhancement update Id: RHBA-2009:1092 Title: xen bug fix update Id: RHBA-2009:1412 Title: python-virtinst bug fix and enhancement update Id: RHEA-2008:0467 Title: new package: virt-viewer Id: RHBA-2008:0554 Title: Virtualization_Guide bug fix update Id: RHBA-2009:0216 Title: python-virtinst enhancement and bug fix update Id: RHBA-2009:1424 Title: libvirt bug fix update Id: RHBA-2009:1299 Title: virt-viewer bug fix update Id: RHBA-2010:0418 Title: xen bug fix update Id: RHBA-2008:0279 Title: xen bug fix update Id: RHBA-2009:0137 Title: virt-manager enhancement and bug fix update Id: RHBA-2008:0026 Title: python-virtinst bug fix update Id: RHBA-2010:0205 Title: libvirt bug fix and enhancement update Id: RHBA-2008:0433 Title: Virtualization_Guide enhancement update Id: RHBA-2009:0118 Title: xen bug fix and enhancement update Id: RHBA-2010:0282 Title: python-virtinst bug fix and enhancement update Id: RHSA-2007:0323 Title: Important: xen security update Id: RHBA-2009:0401 Title: xen bug fix update Id: RHSA-2009:0382 Title: Moderate: libvirt security update Id: RHBA-2008:0480 Title: virt-manager bug fix and enhancement update Id: RHEA-2007:0637 Title: virt-manager enhancement update Id: RHBA-2009:0142 Title: libvirt bug fix and enhancement update Id: RHBA-2010:0251 Title: perl-Sys-Virt bug fix update Id: RHEA-2007:0635 Title: xen enhancement update Id: RHBA-2009:1285 Title: virt-manager enhancement and bug fix update Id: RHBA-2007:0112 Title: virt-manager bug fix update Id: RHBA-2010:0294 Title: xen bug fix and enhancement update Id: RHBA-2008:0305 Title: xen bug fix and enhancement update Id: RHBA-2009:1328 Title: xen bug fix and enhancement update Id: RHBA-2009:1514 Title: xen bug fix update Id: RHSA-2007:0114 Title: Important: xen security update Id: RHEA-2007:0636 Title: python-virtinst enhancement update Id: RHSA-2008:0194 Title: Important: xen security and bug fix update Id: RHBA-2008:0189 Title: libvirt bug fix update Id: RHBA-2010:0281 Title: virt-manager bug fix update Id: RHSA-2009:0003 Title: Moderate: xen security and bug fix update Id: RHBA-2009:1421 Title: libvirt-cim bug fix update
*** This bug has been marked as a duplicate of bug 873310 ***