Bug 805222 - no migration for timeout_delta on task_snapshot
no migration for timeout_delta on task_snapshot
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: z_other (Show other bugs)
1.1.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Sayli Karmarkar
Preethi Thomas
: Triaged
Depends On: 804188
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-20 12:54 EDT by James Slagle
Modified: 2015-03-22 21:11 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 804188
Environment:
Last Closed: 2012-05-25 10:15:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description James Slagle 2012-03-20 12:54:41 EDT
+++ 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@redhat.com 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@redhat.com 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@redhat.com 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 12:55:06 EDT
cherry picked to pulp_v1 6f88504e11bd82cec15565a5f8fb2180be6145cf
Comment 2 Jeff Ortel 2012-04-12 18:59:12 EDT
build: 0.282
Comment 3 Preethi Thomas 2012-05-02 15:19:46 EDT
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 10:15:10 EDT
Pulp v1.1 Release

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