Bug 1023948 - pulp-manage-db upgrade fails from 2.1.1 to 2.2.0
pulp-manage-db upgrade fails from 2.1.1 to 2.2.0
Product: Pulp
Classification: Community
Component: rpm-support (Show other bugs)
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: pulp-bugs
Depends On:
  Show dependency treegraph
Reported: 2013-10-28 08:35 EDT by Tom Bamford
Modified: 2013-10-30 12:10 EDT (History)
1 user (show)

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

Attachments (Terms of Use)

  None (edit)
Description Tom Bamford 2013-10-28 08:35:24 EDT
Description of problem:
pulp-manage-db upgrade fails from 2.1.1 to 2.2.0

Version-Release number of selected component (if applicable):
2.1.1 to 2.2.0

How reproducible:
Works fine when there are only a few repositories. Only occurs when there are about 20 yum repositories being managed.

Steps to Reproduce:
1. yum upgrade pulp*
2. pulp-manage-db

Actual results:

Output of pulp-manage-db is...
Beginning database migrations.
Migration package pulp.server.db.migrations is up to date at version 4
Migration package pulp_puppet.plugins.migrations is up to date at version 0
Applying pulp_rpm.migrations version 8
Migration to pulp_rpm.migrations version 8 complete.
Applying pulp_rpm.migrations version 9
Migration to pulp_rpm.migrations version 9 complete.
Applying pulp_rpm.migrations version 10
Migration to pulp_rpm.migrations version 10 complete.
Applying pulp_rpm.migrations version 11
Applying migration pulp_rpm.migrations.0011_new_importer failed.  See log for details.
2013-10-28 11:40:21,611 db:CRITICAL: Applying migration pulp_rpm.migrations.0011_new_importer failed.
2013-10-28 11:40:21,611 db:CRITICAL: 'repodata'
2013-10-28 11:40:21,611 db:CRITICAL: Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp/server/db/manage.py", line 79, in migrate_database
    update_current_version=not options.test)
  File "/usr/lib/python2.6/site-packages/pulp/server/db/migrate/models.py", line 161, in apply_migration
  File "/usr/lib/python2.6/site-packages/pulp_rpm/migrations/0011_new_importer.py", line 29, in migrate
  File "/usr/lib/python2.6/site-packages/pulp_rpm/migrations/0011_new_importer.py", line 39, in _migrate_collection
    text = package['repodata']['primary'].encode(codec)
KeyError: 'repodata'

Database migrations complete.
Loading content types.
Content types loaded.

Expected results:

Database upgrade completes without error

Additional info:
Comment 1 Tom Bamford 2013-10-28 08:37:33 EDT
I am in the #pulp IRC channel, username rocketeer125.
Comment 2 Tom Bamford 2013-10-28 09:07:50 EDT
Suspect there is some edge case around a specific repository not being handled correctly.
Comment 3 Tom Bamford 2013-10-28 09:59:30 EDT
Issue was due to a specific RPM. Workaround achieved by deleting the RPM and rerunning pulp-manage-db. This RPM was at fault:

SON([(u'_storage_path', u'/var/lib/pulp/content/rpm/.//vmware-open-vm-tools-common/8.3.17/784891.el6/x86_64/ad611ef70b76c22a52b153c7f869d12da67b4761a6d42ad0bdb1435093e29d6f/vmware-open-vm-tools-common-8.3.17-784891.el6.x86_64.rpm'), (u'name', u'vmware-open-vm-tools-common'), (u'release_sort_index', u'06-784891.$el.01-6'), (u'checksum', u'ad611ef70b76c22a52b153c7f869d12da67b4761a6d42ad0bdb1435093e29d6f'), (u'filename', u'vmware-open-vm-tools-common-8.3.17-784891.el6.x86_64.rpm'), (u'epoch', u'0'), (u'version', u'8.3.17'), (u'version_sort_index', u'01-8.01-3.02-17'), (u'arch', u'x86_64'), (u'_content_type_id', u'rpm'), (u'release', u'784891.el6'), (u'_id', u'b66e8519-d7e7-4ce1-a6d6-3a1391366a09'), (u'relativepath', u'vmware-open-vm-tools-common-8.3.17-784891.el6.x86_64.rpm'), (u'_ns', u'units_rpm'), (u'checksumtype', u'sha256')])

Bug case left open for QA incase you want to follow up.

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