Bug 1290528

Summary: [upgrade] async_tasks_map is out of sync
Product: [oVirt] ovirt-engine Reporter: Simone Tiraboschi <stirabos>
Component: Setup.EngineAssignee: Yedidyah Bar David <didi>
Status: CLOSED CURRENTRELEASE QA Contact: Gonza <grafuls>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 3.6.0CC: amureini, bugs, didi, gklein, lveyde, nsednev, oourfali, rmartins, sbonazzo, stirabos, ylavi
Target Milestone: ovirt-3.6.3Flags: rule-engine: ovirt-3.6.z+
rule-engine: blocker+
ylavi: planning_ack+
sbonazzo: devel_ack+
pstehlik: testing_ack+
Target Release: 3.6.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-18 11:07:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1285700, 1294361, 1295178    

Description Simone Tiraboschi 2015-12-10 17:42:12 UTC
Description of problem:

engine upgrade failed cause a task of unknown type was running.

2015-12-10 12:48:20 DEBUG otopi.ovirt_engine_setup.engine_common.database database.execute:214 Result: [{'started_at': datetime.datetime(2015, 12, 10, 11, 24, 20, 316000, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=60, name=None)), 'task_id': 'fd62d708-8e9c-4209-956c-3bfc627b3117', 'action_type': 36, 'name': 'Default'}]
2015-12-10 12:48:20 DEBUG otopi.context context._executeMethod:152 method exception
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/otopi/context.py", line 142, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine/upgrade/asynctasks.py", line 448, in _validateAsyncTasks
    ) = self._checkRunningTasks()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine/upgrade/asynctasks.py", line 341, in _checkRunningTasks
    self._getRunningTasks(dbstatement),
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine/upgrade/asynctasks.py", line 202, in _getRunningTasks
    for entry in tasks
KeyError: '36'
2015-12-10 12:48:20 ERROR otopi.context context._executeMethod:161 Failed to execute stage 'Setup validation': '36'


Version-Release number of selected component (if applicable):


How reproducible:
Just trying to upgrade when a task with action_type = 36 is active.

Steps to Reproduce:
1. Understand what task 36 is, start it
2. try to upgrade while the task 36 is running
3.

Actual results:
it fails with:
2015-12-10 12:48:20 ERROR otopi.context context._executeMethod:161 Failed to execute stage 'Setup validation': '36'

Expected results:
It should know about tasks with action_type = 36 and also if not for newer task it should fail but just decode as 'Unknown type'

Additional info:

Comment 1 Red Hat Bugzilla Rules Engine 2016-01-11 07:28:54 UTC
Fixed bug tickets must have target milestone set prior to fixing them. Please set the correct milestone and move the bugs back to the previous status after this is corrected.

Comment 2 Yedidyah Bar David 2016-01-13 13:00:24 UTC
Note to QE: See the comment having 'Verified+1' in [1] for how I tested this. You are of course welcome to try other more real scenarios for the first part instead of manually inserting a line.

[1] https://gerrit.ovirt.org/51230

Comment 3 Yedidyah Bar David 2016-01-13 13:26:42 UTC
*** Bug 1295178 has been marked as a duplicate of this bug. ***

Comment 4 Gonza 2016-02-03 10:23:49 UTC
verified with upgrade to:
rhevm-3.6.3-0.1.el6.noarch

insert into async_tasks (task_id, action_type, status, storage_pool_id, result, command_id) values ('00000001-0001-0001-0001-0000000002e6', 224, 0, '00000001-0001-0001-0001-0000000002e5', 0, '00000001-0001-0001-0001-0000000002e7');

Upgrade completed successfully.