Bug 805222

Summary: no migration for timeout_delta on task_snapshot
Product: [Retired] Pulp Reporter: James Slagle <jslagle>
Component: z_otherAssignee: Sayli Karmarkar <skarmark>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.1.0CC: cperry, kbidarka, sghai, tsanders
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 804188 Environment:
Last Closed: 2012-05-25 14:15:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 804188    
Bug Blocks:    

Description James Slagle 2012-03-20 16:54:41 UTC
+++ This bug was initially created as a clone of Bug #804188 +++

commit 8c7533f4e1c49ea4c0bbc77d66f9f17c8049f68b changed one of the pickle fields for tasks from timeout to timeout_delta.  

this was committed after pulp 0.214 was tagged for rhui 2.0 (and thus 2.0.1).  We need a db migration for this change.

--- Additional comment from jslagle on 2012-03-16 15:13:12 EDT ---

Resulting traceback:

    [Fri Mar 16 14:35:35 2012] [notice] Apache/2.2.15 (Unix) DAV/2 mod_ssl/2.2.15 OpenSSL/1.0.0-fips mod_wsgi/3.3 Python/2.6.6 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
    [Fri Mar 16 14:35:36 2012] [error] mod_wsgi (pid=3804): Target WSGI script '/srv/pulp/webservices.wsgi' cannot be loaded as Python module.
    [Fri Mar 16 14:35:36 2012] [error] mod_wsgi (pid=3804): Exception occurred processing WSGI script '/srv/pulp/webservices.wsgi'.
    [Fri Mar 16 14:35:36 2012] [error] Traceback (most recent call last):
    [Fri Mar 16 14:35:36 2012] [error]   File "/srv/pulp/webservices.wsgi", line 19, in <module>
    [Fri Mar 16 14:35:36 2012] [error]     application = wsgi_application()
    [Fri Mar 16 14:35:36 2012] [error]   File "/usr/lib/python2.6/site-packages/pulp/server/webservices/application.py", line 247, in wsgi_application
    [Fri Mar 16 14:35:36 2012] [error]     _initialize_pulp()
    [Fri Mar 16 14:35:36 2012] [error]   File "/usr/lib/python2.6/site-packages/pulp/server/webservices/application.py", line 221, in _initialize_pulp
    [Fri Mar 16 14:35:36 2012] [error]     async.initialize()
    [Fri Mar 16 14:35:36 2012] [error]   File "/usr/lib/python2.6/site-packages/pulp/server/async.py", line 179, in initialize
    [Fri Mar 16 14:35:36 2012] [error]     _load_persisted_tasks()
    [Fri Mar 16 14:35:36 2012] [error]   File "/usr/lib/python2.6/site-packages/pulp/server/async.py", line 150, in _load_persisted_tasks
    [Fri Mar 16 14:35:36 2012] [error]     task = TaskSnapshot(snapshot).to_task()
    [Fri Mar 16 14:35:36 2012] [error]   File "/usr/lib/python2.6/site-packages/pulp/server/db/model/persistence.py", line 64, in to_task
    [Fri Mar 16 14:35:36 2012] [error]     return cls.from_snapshot(self)
    [Fri Mar 16 14:35:36 2012] [error]   File "/usr/lib/python2.6/site-packages/pulp/server/api/repo_sync_task.py", line 77, in from_snapshot
    [Fri Mar 16 14:35:36 2012] [error]     task = super(RepoSyncTask, cls).from_snapshot(snapshot)
    [Fri Mar 16 14:35:36 2012] [error]   File "/usr/lib/python2.6/site-packages/pulp/server/tasking/task.py", line 335, in from_snapshot
    [Fri Mar 16 14:35:36 2012] [error]     setattr(task, field, pickle.loads(snapshot[field]))
    [Fri Mar 16 14:35:36 2012] [error] KeyError: 'timeout_delta'

--- Additional comment from jslagle on 2012-03-16 15:33:12 EDT ---

There is a workaround for this:

Make sure mongod is started:
$ service mongod start

Log into the mongo shell:
$ mongo pulp_database

Drop task snapshots:
> db.task_snapshots.drop()
> exit

Restart pulp-server:
$ service pulp-server restart

Any tasks there were running before the update will start again on their next scheduled time.

--- Additional comment from jconnor on 2012-03-19 15:35:01 EDT ---

snapshot fields are not controlled by a db model, so they are note really "migratable". I've add a call in the migrate script to drop the persisted tasks as part of the standard workflow to avoid these problems in the future.

fix pushed in:
82a4def58ab08dd57677c566df385b9d252b6fe9

Comment 1 James Slagle 2012-03-20 16:55:06 UTC
cherry picked to pulp_v1 6f88504e11bd82cec15565a5f8fb2180be6145cf

Comment 2 Jeff Ortel 2012-04-12 22:59:12 UTC
build: 0.282

Comment 3 Preethi Thomas 2012-05-02 19:19:46 UTC
verified
pulp-migrate completed successfully 

[root@pulp-v1-server ~]# pulp-migrate
removing persisted tasks
database migration to version 40 complete

Comment 4 Preethi Thomas 2012-05-25 14:15:10 UTC
Pulp v1.1 Release