Project

Profile

Help

Issue #916

closed

pulp-manage-db raising stack trace

Added by paji@redhat.com about 9 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
Master
Platform Release:
2.7.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

On EL6 and EL7, when running pulp-manage-db the following stack trace happens:

sudo -u apache /usr/bin/pulp-manage-db

Migration package pulp.server.db.migrations is up to date at version 16
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 21
type object 'RepositoryContentUnit' has no attribute 'ensure_indexes'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 134, in main
    return _auto_manage_db(options)
  File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 195, in _auto_manage_db
    migrate_database(options)
  File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 103, in migrate_database
    ensure_database_indexes()
  File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 117, in ensure_database_indexes
    model.RepositoryContentUnit.ensure_indexes()
AttributeError: type object 'RepositoryContentUnit' has no attribute 'ensure_indexes

I am running the 0.7.10 version of mongoengine.

$ rpm -qa|grep mongoe
python-mongoengine-0.7.10-2.el7.noarch

And here are my packages:

[lib]$ rpm -qa|grep pulp
pulp-puppet-handlers-2.7.0-0.2.alpha.git.3.bf0e19d.el7.noarch
pulp-nodes-common-2.7.0-0.2.alpha.git.112.d2a2776.el7.noarch
python-kombu-3.0.24-7.pulp.git.270.985c711.el7.noarch
pulp-puppet-admin-extensions-2.7.0-0.2.alpha.git.3.bf0e19d.el7.noarch
pulp-docker-admin-extensions-1.1.0-0.1.alpha.git.6.2cbd4f5.el7.noarch
python-pulp-puppet-common-2.7.0-0.2.alpha.git.3.bf0e19d.el7.noarch
pulp-puppet-plugins-2.7.0-0.2.alpha.git.3.bf0e19d.el7.noarch
pulp-consumer-client-2.7.0-0.2.alpha.git.112.d2a2776.el7.noarch
pulp-puppet-tools-2.7.0-0.2.alpha.git.3.bf0e19d.el7.noarch
python-pulp-bindings-2.7.0-0.2.alpha.git.112.d2a2776.el7.noarch
pulp-admin-client-2.7.0-0.2.alpha.git.112.d2a2776.el7.noarch
python-pulp-repoauth-2.7.0-0.2.alpha.git.112.d2a2776.el7.noarch
python-isodate-0.5.0-4.pulp.el7.noarch
python-pulp-rpm-common-2.7.0-0.2.alpha.git.24.a708668.el7.noarch
pulp-puppet-consumer-extensions-2.7.0-0.2.alpha.git.3.bf0e19d.el7.noarch
pulp-server-2.7.0-0.2.alpha.git.112.d2a2776.el7.noarch
python-pulp-client-lib-2.7.0-0.2.alpha.git.112.d2a2776.el7.noarch
pulp-docker-plugins-1.1.0-0.1.alpha.git.6.2cbd4f5.el7.noarch
pulp-selinux-2.7.0-0.2.alpha.git.112.d2a2776.el7.noarch
python-pulp-ostree-common-1.0.0-0.1.alpha.el7.noarch
pulp-ostree-plugins-1.0.0-0.1.alpha.el7.noarch
pulp-rpm-plugins-2.7.0-0.2.alpha.git.24.a708668.el7.noarch
python-pulp-common-2.7.0-0.2.alpha.git.112.d2a2776.el7.noarch
pulp-nodes-parent-2.7.0-0.2.alpha.git.112.d2a2776.el7.noarch
pulp-ostree-admin-extensions-1.0.0-0.1.alpha.el7.noarch
pulp-katello-0.4-1.el7.noarch
python-pulp-agent-lib-2.7.0-0.2.alpha.git.112.d2a2776.el7.noarch
python-pulp-docker-common-1.1.0-0.1.alpha.git.6.2cbd4f5.el7.noarc

Related issues

Has duplicate Pulp - Issue #900: unable to run pulp-manage-db on 2.7.0 alpha 2 on RHEL6CLOSED - DUPLICATEActions
Actions #1

Updated by bmbouter about 9 years ago

  • Description updated (diff)
  • Priority changed from Normal to High
  • Severity changed from 2. Medium to 3. High
  • Platform Release set to 2.7.0
Actions #2

Updated by bmbouter about 9 years ago

The 0.7.10 version of mongoengine does not support the ensure_indexes call. ensure_indexes was added in a newer version of mongoengine.

One way we could fix this is by reverting commit d4ecfd33ab2ed564ac606a84c235c9575bb8ea78. That would let mongoengine just handle it for us, but would have the downside of and indexes that need to get created happen at runtime instead of pulp-manage-db time.

Another way we can fix this by attempting to call ensure_indexes, and if it creates the exception shown in the traceback, we should call the ensure_index that is available in mongoengine 0.7.10 on the queryset. We can probably do that in a generalized way.

I do not think we should start delivering a newer version of mongoengine just for this issue. We also cannot have just one implementation of this that will work in all versions because in the newer version, ensure_index on the queryset is deprecated

Actions #3

Updated by bcourt about 9 years ago

If there is a way to make the call and fail back to the older version on the queryset in 0.7.10 I would go with that.

Actions #4

Updated by cduryee almost 9 years ago

  • Triaged changed from No to Yes
Actions #5

Updated by bcourt almost 9 years ago

  • Assignee set to bcourt
Actions #6

Updated by bcourt almost 9 years ago

  • Status changed from NEW to POST
Actions #7

Updated by bmbouter almost 9 years ago

  • Has duplicate Issue #900: unable to run pulp-manage-db on 2.7.0 alpha 2 on RHEL6 added
Actions #8

Updated by bmbouter almost 9 years ago

I notice this issue is at post, but there is no link to the PR in it.

Added by bcourt almost 9 years ago

Revision 62c7b605 | View on GitHub

Ensure_indexes on both old & new style mongoengine

fixes #916

Added by bcourt almost 9 years ago

Revision 62c7b605 | View on GitHub

Ensure_indexes on both old & new style mongoengine

fixes #916

Actions #9

Updated by bcourt almost 9 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #10

Updated by dkliban@redhat.com almost 9 years ago

  • Status changed from MODIFIED to 5
Actions #11

Updated by igulina@redhat.com almost 9 years ago

on RH7:

>> rpm -qa pulp-server
pulp-server-2.7.0-0.3.beta.el7.noarch

>> rpm -qa|grep mongoe
python-mongoengine-0.8.4-3.el7.noarch

>> sudo -u apache /usr/bin/pulp-manage-db
Mongo database for connection is version 2.6.9
Loading content types.
Loading type descriptors [iso_support.json, rpm_support.json, puppet.json, docker.json]
Parsing type descriptors
Validating type descriptor syntactic integrity
Validating type descriptor semantic integrity
Updating the database with types [iso, distribution, drpm, erratum, package_group, package_category, package_environment, rpm, srpm, yum_repo_metadata_file, puppet_module, docker_image]
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 18
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 21
Database migrations complete.

SO far there is no traceback on RH6, but check one more time after #1065 fix, just to be sure.

Actions #12

Updated by igulina@redhat.com over 8 years ago

  • Status changed from 5 to 6
Actions #13

Updated by amacdona@redhat.com over 8 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #15

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF