Actions
Issue #3876
closedCan't recursively copy RPM between repos
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.18.0
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 40
Quarter:
Description
Let's say one tries to recursively copy an RPM from one repository to another with this command:
pulp-admin rpm repo copy rpm \
--from-repo-id 73a3e0b0-2265-4ae3-bd1c-7a1d32fde068 \
--to-repo-id 501c7a1a-9b90-4a71-b1d0-0b889390cd27 \
--str-eq name=walrus \
--str-eq version=0.71 \
--recursive
It will fail with a message like this:
This command may be exited via ctrl+c without affecting the request.
[\]
Running...
Task Failed
str2dir() got an unexpected keyword argument 'create'
Here's what the logs show on the target host:
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) Exception from importer [yum_importer] while importing units into repository [bd200d7f-2c78-425a-bdc8-d77e9612f1fc]
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) Traceback (most recent call last):
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/unit_association.py", line 273, in associate_from_repo
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) units=transfer_units)
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/importer.py", line 58, in import_units
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) return associate.associate(source_repo, dest_repo, import_conduit, config, units)
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/associate.py", line 55, in associate
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) solver.load()
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/pulp_solv.py", line 360, in load
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) self.mapping.add_repo_units(self._repo_units(repo_name), repo_name)
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/pulp_solv.py", line 259, in add_repo_units
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) solvable = factory(repo, unit)
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/pulp_solv.py", line 218, in <lambda>
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) return lambda solv_repo, unit: unit_solvable_converter(solv_repo, unit, *attribute_factories)
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/pulp_solv.py", line 213, in unit_solvable_converter
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) attribute_factory(solvable, unit)
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/pulp_solv.py", line 190, in rpm_filelist_conversion
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) dirname_id = repodata.str2dir(dirname, create=True)
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.managers.repo.unit_association:ERROR: [99d0db51] (1860-42976) TypeError: str2dir() got an unexpected keyword argument 'create'
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: pulp.server.async.tasks:INFO: [99d0db51] Task failed : [99d0db51-c2f2-42b6-b577-2a50fc4d2f37]
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: celery.app.trace:ERROR: [99d0db51] (1860-42976) Task pulp.server.managers.repo.unit_association.associate_from_repo[99d0db51-c2f2-42b6-b577-2a50fc4d2f37] raised unexpected: TypeError("str2dir() got an unexpected keyword argument 'create'",)
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: celery.app.trace:ERROR: [99d0db51] (1860-42976) Traceback (most recent call last):
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: celery.app.trace:ERROR: [99d0db51] (1860-42976) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 367, in trace_task
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: celery.app.trace:ERROR: [99d0db51] (1860-42976) R = retval = fun(*args, **kwargs)
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: celery.app.trace:ERROR: [99d0db51] (1860-42976) File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 529, in __call__
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: celery.app.trace:ERROR: [99d0db51] (1860-42976) return super(Task, self).__call__(*args, **kwargs)
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: celery.app.trace:ERROR: [99d0db51] (1860-42976) File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 107, in __call__
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: celery.app.trace:ERROR: [99d0db51] (1860-42976) return super(PulpTask, self).__call__(*args, **kwargs)
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: celery.app.trace:ERROR: [99d0db51] (1860-42976) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 622, in __protected_call__
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: celery.app.trace:ERROR: [99d0db51] (1860-42976) return self.run(*args, **kwargs)
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: celery.app.trace:ERROR: [99d0db51] (1860-42976) File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/unit_association.py", line 291, in associate_from_repo
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: celery.app.trace:ERROR: [99d0db51] (1860-42976) raise (e, None, sys.exc_info()[2])
Jul 20 13:06:14 rhel-7-pulp-2-17-nightly pulp[1860]: celery.app.trace:ERROR: [99d0db51] (1860-42976) TypeError: str2dir() got an unexpected keyword argument 'create'
This occurs on Pulp 2 nightly (to-be 2.17). Here's the RPMs used on the test VM:
[root@rhel-7-pulp-2-17-nightly ~]# rpm -qa | grep pulp | sort
pulp-admin-client-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
pulp-deb-admin-extensions-1.8.0-0.1.alpha.201807190515git4df9825.el7.noarch
pulp-deb-plugins-1.8.0-0.1.alpha.201807190515git4df9825.el7.noarch
pulp-docker-admin-extensions-3.2.0-0.1.alpha.201807190502git4356228.el7.noarch
pulp-docker-plugins-3.2.0-0.1.alpha.201807190502git4356228.el7.noarch
pulp-ostree-admin-extensions-1.4.0-0.1.alpha.201807190504git2c2d534.el7.noarch
pulp-ostree-plugins-1.4.0-0.1.alpha.201807190504git2c2d534.el7.noarch
pulp-puppet-admin-extensions-2.17.0-0.1.alpha.201807190505git44a02f8.el7.noarch
pulp-puppet-plugins-2.17.0-0.1.alpha.201807190505git44a02f8.el7.noarch
pulp-puppet-tools-2.17.0-0.1.alpha.201807190505git44a02f8.el7.noarch
pulp-python-admin-extensions-2.1.0-0.1.alpha.201807190501gitfabd48c.el7.noarch
pulp-python-plugins-2.1.0-0.1.alpha.201807190501gitfabd48c.el7.noarch
pulp-rpm-admin-extensions-2.17.0-0.1.alpha.201807190507git17a2f5d.el7.noarch
pulp-rpm-plugins-2.17.0-0.1.alpha.201807190507git17a2f5d.el7.noarch
pulp-selinux-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
pulp-server-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
python-isodate-0.5.0-4.pulp.el7.noarch
python-pulp-bindings-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
python-pulp-client-lib-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
python-pulp-common-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
python-pulp-deb-common-1.8.0-0.1.alpha.201807190515git4df9825.el7.noarch
python-pulp-docker-common-3.2.0-0.1.alpha.201807190502git4356228.el7.noarch
python-pulp-oid_validation-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
python-pulp-ostree-common-1.4.0-0.1.alpha.201807190504git2c2d534.el7.noarch
python-pulp-puppet-common-2.17.0-0.1.alpha.201807190505git44a02f8.el7.noarch
python-pulp-python-common-2.1.0-0.1.alpha.201807190501gitfabd48c.el7.noarch
python-pulp-repoauth-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
python-pulp-rpm-common-2.17.0-0.1.alpha.201807190507git17a2f5d.el7.noarch
python-pulp-streamer-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
To reproduce, run an existing test: python -m unittest pulp_2_tests.tests.rpm.cli.test_copy_units.UpdateRpmTestCase
.
Actions
Remove create kwarg since by default it's true
We discovered an issue where on some versions of python2-solv, there was no create kwarg for str2dir. So we're removing it from this call since by default it's True anyway.
Note that this is not really a fix for #3876
https://pulp.plan.io/issues/3876 ref #3876