Bug 995096 - Recursive rpm copy for errata failing.
Recursive rpm copy for errata failing.
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: user-experience (Show other bugs)
2.2 Beta
Unspecified Unspecified
urgent Severity unspecified
: ---
: 2.2.0
Assigned To: Michael Hrivnak
Preethi Thomas
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-08 10:23 EDT by Partha Aji
Modified: 2013-09-10 11:43 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-10 11:43:13 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Partha Aji 2013-08-08 10:23:05 EDT
Get a stack trace when copying errata between repos with "recursive" turned on.


Version Info
```
$ rpm -qa|grep pulp
python-pulp-rpm-common-2.2.0-0.22.beta.fc18.noarch
pulp-admin-client-2.2.0-0.22.beta.fc18.noarch
m2crypto-0.21.1.pulp-7.fc18.x86_64
pulp-rpm-plugins-2.2.0-0.22.beta.fc18.noarch
python-pulp-agent-lib-2.2.0-0.22.beta.fc18.noarch
pulp-agent-2.2.0-0.22.beta.fc18.noarch
python-pulp-common-2.2.0-0.22.beta.fc18.noarch
pulp-builtins-admin-extensions-2.2.0-0.22.beta.fc18.noarch
pulp-rpm-handlers-2.2.0-0.22.beta.fc18.noarch
pulp-rpm-admin-extensions-2.2.0-0.22.beta.fc18.noarch
python-pulp-bindings-2.2.0-0.22.beta.fc18.noarch
pulp-builtins-consumer-extensions-2.2.0-0.22.beta.fc18.noarch
pulp-selinux-2.2.0-0.22.beta.fc18.noarch
katello-glue-pulp-1.3.25-1.fc18.noarch
python-pulp-rpm-extension-2.2.0-0.22.beta.fc18.noarch
pulp-server-2.2.0-0.22.beta.fc18.noarch
python-pulp-client-lib-2.2.0-0.22.beta.fc18.noarch
pulp-rpm-consumer-extensions-2.2.0-0.22.beta.fc18.noarch
pulp-rpm-yumplugins-2.2.0-0.22.beta.fc18.noarch
createrepo-0.9.9-21.2.pulp.fc18.noarch
pulp-consumer-client-2.2.0-0.22.beta.fc18.noarch
python-isodate-0.5.0-1.pulp.fc18.noarch
```
```
Steps:
$ pulp-admin rpm repo create --repo-id=zoo1 --feed=http://partha.fedorapeople.org/test-repos/zoo-lander2/
$  pulp-admin rpm repo sync run --repo-id=zoo1
$  pulp-admin rpm repo create --repo-id=zoo2
$ pulp-admin rpm repo copy errata  --from-repo-id=zoo1 --to-repo-id=zoo2 --recursive
```
Fails with the following error
```
[-]
Waiting to begin...

[-]
Running...

Task Failed

[u'PulpExecutionException: Pulp exception occurred: PulpExecutionException\n']
```


Stack Trace from /var/log/pulp

```
2013-08-08 01:44:04,264 pulp.server.managers.repo.unit_association:ERROR: Exception from importer [yum_importer] while importing units into repository [zoo2]
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/unit_association.py", line 276, in associate_from_repo
    call_config, units=transfer_units)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/importer.py", line 68, in import_units
    return associate.associate(source_repo, dest_repo, import_conduit, config, units)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/associate.py", line 69, in associate
    group_ids, rpm_names, rpm_unit_keys = identify_children_to_copy(associated_units)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/associate.py", line 269, in identify_children_to_copy
    rpm_unit_keys.extend(model.package_unit_keys)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/common/models.py", line 219, in package_unit_keys
    checksum = package['sum'][1]
TypeError: 'NoneType' object has no attribute '__getitem__'
2013-08-08 01:44:04,264 pulp.server.dispatch.task:ERROR: Pulp exception occurred: PulpExecutionException
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/dispatch/task.py", line 138, in _run
    result = call(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/unit_association.py", line 276, in associate_from_repo
    call_config, units=transfer_units)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/importer.py", line 68, in import_units
    return associate.associate(source_repo, dest_repo, import_conduit, config, units)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/associate.py", line 69, in associate
    group_ids, rpm_names, rpm_unit_keys = identify_children_to_copy(associated_units)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/associate.py", line 269, in identify_children_to_copy
    rpm_unit_keys.extend(model.package_unit_keys)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/common/models.py", line 219, in package_unit_keys
    checksum = package['sum'][1]
PulpExecutionException: Pulp exception occurred: PulpExecutionException
2013-08-08 01:44:04,265 pulp.server.dispatch.task:INFO: FAILURE: Task 15234dab-f064-4c2a-9676-c339350f3c8e: CallRequest: RepoUnitAssociationManager.associate_from_repo('zoo1', u'zoo2', import_config_override=****, criteria=****)
```
Comment 1 Michael Hrivnak 2013-08-09 15:43:06 EDT
https://github.com/pulp/pulp_rpm/pull/301
Comment 2 Jeff Ortel 2013-08-12 10:49:18 EDT
build: 2.2.0-0.25.beta.
Comment 3 Preethi Thomas 2013-08-12 15:01:41 EDT
root@cloud-qe-9 ~]# rpm -q pulp-server
pulp-server-2.2.0-0.25.beta.el6.noarch
[root@cloud-qe-9 ~]# 

[root@cloud-qe-9 ~]# pulp-admin rpm repo copy  errata  -f errata -t copy --recursive
This command may be exited via ctrl+c without affecting the request.

[-]
Waiting to begin...

[-]
Running...

Units:
  RHEA-2010:9999
  grinder_test_2
  grinder_test_3
  grinder_test_4

[root@cloud-qe-9 ~]# pulp-admin rpm repo list
+----------------------------------------------------------------------+
                            RPM Repositories
+----------------------------------------------------------------------+

Id:                  errata
Display Name:        errata
Description:         None
Content Unit Counts: 
  Erratum: 4
  Rpm:     11

Id:                  copy
Display Name:        copy
Description:         None
Content Unit Counts: 
  Erratum: 4
  Rpm:     3


[root@cloud-qe-9 ~]#  pulp-admin rpm repo create --repo-id=zoo1 --feed=http://partha.fedorapeople.org/test-repos/zoo-lander2/
Successfully created repository [zoo1]

[root@cloud-qe-9 ~]# pulp-admin rpm repo sync run --repo-id=zoo1
+----------------------------------------------------------------------+
                    Synchronizing Repository [zoo1]
+----------------------------------------------------------------------+

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:       33/33 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: 33/33 items
... completed

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

Generating metadata
[\]
... completed

Publishing repository over HTTPS
[-]
... completed

[root@cloud-qe-9 ~]# ulp-admin rpm repo create --repo-id=zoo2
-bash: ulp-admin: command not found
[root@cloud-qe-9 ~]# pulp-admin rpm repo create --repo-id=zoo2
Successfully created repository [zoo2]

[root@cloud-qe-9 ~]#  pulp-admin rpm repo copy errata  --from-repo-id=zoo1 --to-repo-id=zoo2 --recursive
This command may be exited via ctrl+c without affecting the request.

[-]
Waiting to begin...

[-]
Running...

Units:
  RHEA-2012:0055
  RHEA-2012:0056
  RHEA-2012:0057
  RHEA-2012:0058

[root@cloud-qe-9 ~]# pulp-admin repo list
+----------------------------------------------------------------------+
                              Repositories
+----------------------------------------------------------------------+

Id:                  errata
Display Name:        errata
Description:         None
Content Unit Counts: 
  Erratum: 4
  Rpm:     11

Id:                  copy
Display Name:        copy
Description:         None
Content Unit Counts: 
  Erratum: 4
  Rpm:     3

Id:                  zoo1
Display Name:        zoo1
Description:         None
Content Unit Counts: 
  Erratum:       4
  Package Group: 2
  Rpm:           33

Id:                  zoo2
Display Name:        zoo2
Description:         None
Content Unit Counts: 
  Erratum: 4


[root@cloud-qe-9 ~]#
Comment 4 Preethi Thomas 2013-09-10 11:43:13 EDT
2.2 released
http://repos.fedorapeople.org/repos/pulp/pulp/stable/2.2/

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