Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1084070

Summary: pulp-manage-db fails on migration 0009_qpid_queues when qpid-tools not installed.
Product: [Retired] Pulp Reporter: Jeff Ortel <jortel>
Component: rel-engAssignee: Brian Bouterse <bmbouter>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 2.4.0CC: pthomas, rbarlow, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: 2.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-09 06:56:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeff Ortel 2014-04-03 14:32:39 UTC
Description of problem:

pulp-manage-db fails on migration 0009_qpid_queues, requires: qpid-tools.

The migration uses qpidtoollibs that is provided by the qpid-tools rpm.  Either pulp needs to have a Requires: qpid-tools.  Or, the migration needs to be optional based on whether qpid-tools is installed.  The danger with doing that is users could be using qpid but not have qpid-tools installed.  In this case a necessary migration will be skipped.

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

2.4.0-0-7.beta

How reproducible:

When qpid-tools is not installed.

Steps to Reproduce:
1.  Make sure qpid-tools is not installed
2.  Install pulp.
3.  Run pulp-manage-db

Actual results:

[root@cloud-qe-13 ~]# sudo -u apache pulp-manage-db
Loading content types.
/usr/lib/python2.6/site-packages/pulp/server/db/connection.py:135: DeprecationWarning: The safe parameter is deprecated. Please use write concern options instead.
  return method(*args, **kwargs)
Content types loaded.
Beginning database migrations.
No module named qpidtoollibs
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp/server/db/manage.py", line 108, in main
    _auto_manage_db(options)
  File "/usr/lib/python2.6/site-packages/pulp/server/db/manage.py", line 140, in _auto_manage_db
    migrate_database(options)
  File "/usr/lib/python2.6/site-packages/pulp/server/db/manage.py", line 58, in migrate_database
    migration_packages = models.get_migration_packages()
  File "/usr/lib/python2.6/site-packages/pulp/server/db/migrate/models.py", line 304, in get_migration_packages
    migration_packages = [MigrationPackage(pulp.server.db.migrations)]
  File "/usr/lib/python2.6/site-packages/pulp/server/db/migrate/models.py", line 139, in __init__
    available_versions = self.available_versions
  File "/usr/lib/python2.6/site-packages/pulp/server/db/migrate/models.py", line 173, in available_versions
    migrations = self.migrations
  File "/usr/lib/python2.6/site-packages/pulp/server/db/migrate/models.py", line 202, in migrations
    migration_modules.append(MigrationModule(module_name))
  File "/usr/lib/python2.6/site-packages/pulp/server/db/migrate/models.py", line 56, in __init__
    self._module = _import_all_the_way(python_module_name)
  File "/usr/lib/python2.6/site-packages/pulp/server/db/migrate/models.py", line 325, in _import_all_the_way
    module = __import__(module_string)
  File "/usr/lib/python2.6/site-packages/pulp/server/db/migrations/0009_qpid_queues.py", line 14, in <module>
    from qpidtoollibs import BrokerAgent
ImportError: No module named qpidtoollibs


Expected results:


Additional info:

Comment 1 Randy Barlow 2014-04-03 15:49:30 UTC
(In reply to Jeff Ortel from comment #0)
> The danger with
> doing that is users could be using qpid but not have qpid-tools installed. 
> In this case a necessary migration will be skipped.

I think we can avoid this danger if we use the broker setting to determine whether the migration is required or not. If their broker string starts with qpid://, then the migration should fail if qpid-tools is not installed (with a useful error message). Otherwise, it's not necessary. What do you think?

Comment 2 Brian Bouterse 2014-04-09 20:18:42 UTC
Potential fix with:

https://fedorahosted.org/pulp/wiki/BugReviewProcess

Comment 3 Brian Bouterse 2014-04-09 22:45:56 UTC
The link is wrong above; here is the actual potential fix:

https://github.com/pulp/pulp/pull/885

Comment 4 Brian Bouterse 2014-04-11 18:27:16 UTC
PR was merged to master.

Comment 5 Preethi Thomas 2014-04-29 16:48:57 UTC
verified

[root@dhcp129-52 ~]# sudo -u apache pulp-manage-db
Loading content types.
Content types loaded.
Ensuring the admin role and user are in place.
Admin role and user are in place.
Beginning database migrations.
Migration package pulp.server.db.migrations is up to date at version 9
Migration package pulp_puppet.plugins.migrations is up to date at version 2
Migration package pulp_rpm.plugins.migrations is up to date at version 15
Database migrations complete.
[root@dhcp129-52 ~]# 

[root@dhcp129-52 ~]# rpm -qa |grep qpid-tools
[root@dhcp129-52 ~]#

Comment 6 Randy Barlow 2014-08-09 06:56:49 UTC
This has been fixed in Pulp 2.4.0-1.