Bug 1167908 - 2.5.X -> 2.6.0 upgrade causes traceback
Summary: 2.5.X -> 2.6.0 upgrade causes traceback
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: async/tasks
Version: 2.5
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: 2.6.0
Assignee: Dennis Kliban
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-25 15:37 UTC by Brian Bouterse
Modified: 2015-02-28 22:45 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 22:45:39 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 628 0 None None None Never

Description Brian Bouterse 2014-11-25 15:37:19 UTC
Chris got this error after upgrading from 2.5.0 to 2.6.0 alpha:

pulp: celery.worker.strategy:INFO: Received task: pulp.server.async.tasks._queue_reserved_task[3b65119e-5f49-449a-b67a-5f5dec5d50eb]
beavqe-net0 pulp: celery.worker.job:ERROR: (5357-96480) Task pulp.server.async.tasks._queue_reserved_task[3b65119e-5f49-449a-b67a-5f5dec5d50eb] raised unexpected: KeyError('worker_name',)
pulp: celery.worker.job:ERROR: (5357-96480) Traceback (most recent call last):
pulp: celery.worker.job:ERROR: (5357-96480)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
pulp: celery.worker.job:ERROR: (5357-96480)     R = retval = fun(*args, **kwargs)
pulp: celery.worker.job:ERROR: (5357-96480)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 437, in __protected_call__
pulp: celery.worker.job:ERROR: (5357-96480)     return self.run(*args, **kwargs)
pulp: celery.worker.job:ERROR: (5357-96480)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 64, in _queue_reserved_task
pulp: celery.worker.job:ERROR: (5357-96480)     worker = resources.get_unreserved_worker()
pulp: celery.worker.job:ERROR: (5357-96480)   File "/usr/lib/python2.7/site-packages/pulp/server/managers/resources.py", line 62, in get_unreserved_worker
pulp: celery.worker.job:ERROR: (5357-96480)     reserved_names = [r['worker_name'] for r in resources.ReservedResource.get_collection().find()]
pulp: celery.worker.job:ERROR: (5357-96480) KeyError: 'worker_name'


The cause is the ReservedResource model change [0]. The solution is to create a new migration that deletes all documents from the reserved_resource collection. It's safe to do because the workers will recreate them once they start with the right attributes for the 2.6 code.

[0]: https://github.com/pulp/pulp/pull/1158/files?diff=unified#diff-5d58b00ed0c231fdf673ede3a6680640R88

Comment 1 Brian Bouterse 2014-11-25 15:38:39 UTC
Adding medium priority and 2.6.0 release because we can't release with this issue which is introduced in 2.6.0.

Comment 2 Dennis Kliban 2014-12-09 15:07:20 UTC
https://github.com/pulp/pulp/pull/1405

Comment 3 Chris Duryee 2014-12-23 20:52:50 UTC
fixed in pulp 2.6.0-0.2.beta

Comment 4 Preethi Thomas 2015-01-27 15:19:13 UTC
verified
Upgraded 2.5.3 -> 2.6

[root@gizmo ~]# 
[root@gizmo ~]# sudo -u apache pulp-manage-db
Mongo database for connection is version 2.4.12
Loading content types.
Loading type descriptors [iso_support.json, rpm_support.json, puppet.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]
/usr/lib/python2.6/site-packages/pulp/server/db/connection.py:162: DeprecationWarning: The safe parameter is deprecated. Please use write concern options instead.
  return method(*args, **kwargs)
Content types loaded.
Ensuring the admin role and user are in place.
Mongo database for connection is version 2.4.12
Admin role and user are in place.
Beginning database migrations.
Applying pulp.server.db.migrations version 11
Migration to pulp.server.db.migrations version 11 complete.
Applying pulp.server.db.migrations version 12
Migration to pulp.server.db.migrations version 12 complete.
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 18
Database migrations complete.
[root@gizmo ~]# 
[root@gizmo ~]# 
[root@gizmo ~]# 
[root@gizmo ~]# 
[root@gizmo ~]#

Comment 5 Brian Bouterse 2015-02-28 22:45:39 UTC
Moved to https://pulp.plan.io/issues/628


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