Bug 1167908

Summary: 2.5.X -> 2.6.0 upgrade causes traceback
Product: [Retired] Pulp Reporter: Brian Bouterse <bmbouter>
Component: async/tasksAssignee: Dennis Kliban <dkliban>
Status: CLOSED UPSTREAM QA Contact: Preethi Thomas <pthomas>
Severity: high Docs Contact:
Priority: medium    
Version: 2.5CC: dkliban, pthomas
Target Milestone: ---Keywords: Triaged
Target Release: 2.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-28 22:45:39 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 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