When canceling the actionplan, the log cannot be printed normally

Bug #1877956 reported by Min Li
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
watcher
Triaged
Undecided
Unassigned

Bug Description

When I cancel an ongoing action plan, the watcher-applier log does not print properly:

2020-05-11 03:39:27.738 1 WARNING watcher.applier.workflow_engine.default [req-97485bde-2762-4833-92a8-c9d716e845c1 - - - - -] Aborting action: action_type:migrate uuid:f5cf4e5c-d37f-4eb7-86d6-08c27c56a5ec
2020-05-11 03:39:27.751 1 WARNING watcher.applier.workflow_engine.default [req-97485bde-2762-4833-92a8-c9d716e845c1 - - - - -] Aborting action: action_type:migrate uuid:04e10f3b-be00-4bb9-8a74-e19d77c88635
2020-05-11 03:39:31.729 1 ERROR watcher.common.exception [req-b6e4a74e-e0c2-4084-8e6d-706c5e867b7f - - - - -] Exception in string format operation: KeyError: u'uuid'
2020-05-11 03:39:31.729 1 ERROR watcher.common.exception Traceback (most recent call last):
2020-05-11 03:39:31.729 1 ERROR watcher.common.exception File "/usr/local/lib/python2.7/dist-packages/watcher/common/exception.py", line 82, in __init__
2020-05-11 03:39:31.729 1 ERROR watcher.common.exception message = self.msg_fmt % kwargs
2020-05-11 03:39:31.729 1 ERROR watcher.common.exception KeyError: u'uuid'
2020-05-11 03:39:31.729 1 ERROR watcher.common.exception
2020-05-11 03:39:31.730 1 ERROR watcher.common.exception [req-b6e4a74e-e0c2-4084-8e6d-706c5e867b7f - - - - -] code: 500
2020-05-11 03:39:31.731 1 ERROR watcher.applier.action_plan.default [req-b6e4a74e-e0c2-4084-8e6d-706c5e867b7f - - - - -] Action Plan with UUID %(uuid)s is cancelled by user: ActionPlanCancelled: Action Plan with UUID %(uuid)s is cancelled by user
2020-05-11 03:39:31.731 1 ERROR watcher.applier.action_plan.default Traceback (most recent call last):
2020-05-11 03:39:31.731 1 ERROR watcher.applier.action_plan.default File "/usr/local/lib/python2.7/dist-packages/watcher/applier/action_plan/default.py", line 57, in execute
2020-05-11 03:39:31.731 1 ERROR watcher.applier.action_plan.default applier.execute(self.action_plan_uuid)
2020-05-11 03:39:31.731 1 ERROR watcher.applier.action_plan.default File "/usr/local/lib/python2.7/dist-packages/watcher/applier/default.py", line 63, in execute
2020-05-11 03:39:31.731 1 ERROR watcher.applier.action_plan.default return self.engine.execute(actions)
2020-05-11 03:39:31.731 1 ERROR watcher.applier.action_plan.default File "/usr/local/lib/python2.7/dist-packages/watcher/applier/workflow_engine/default.py", line 99, in execute
2020-05-11 03:39:31.731 1 ERROR watcher.applier.action_plan.default raise exception.ActionPlanCancelled
2020-05-11 03:39:31.731 1 ERROR watcher.applier.action_plan.default ActionPlanCancelled: Action Plan with UUID %(uuid)s is cancelled by user

Revision history for this message
Dantali0n (dantalion) wrote :

To what version of Watcher does this apply?

Revision history for this message
Min Li (limin0801) wrote :

The watcher version is Rocky.
When I cancel an ongoing action plan, the vm migration can stop, only the watcher-applier log does not print properly.

Ronelle Landy (rlandy)
tags: added: needs-re-triage
Changed in watcher:
status: New → Triaged
Revision history for this message
Douglas Viroel (dviroel) wrote :

I could find just one place that is raising the Exception without providing the mandatory uuid parameter:

https://opendev.org/openstack/watcher/src/commit/022d150d20e9acf8e5304c373b8a1654211a1053/watcher/applier/workflow_engine/default.py#L123

Revision history for this message
sean mooney (sean-k-mooney) wrote :

so the exception was added in https://github.com/openstack/watcher/commit/d7a44739a6dae8f4a6fa66408d46dad9b6fd8262

the execution message body expects a uuid

https://github.com/openstack/watcher/commit/d7a44739a6dae8f4a6fa66408d46dad9b6fd8262#diff-d5c47c04b7daf92caed57df729c6140574dc088be57eb01e4a80dad8e449a7f2R277

it seam to be raised here

https://github.com/openstack/watcher/blob/master/watcher/applier/workflow_engine/default.py#L123

by raising an reference to a class and without contructign it properly

we should be raising it like this

https://github.com/openstack/watcher/blob/master/watcher/applier/workflow_engine/base.py#L163

or if we are constructing it form a different error i think we need to also copyu the relevant fields.

so this looks like a real bug

https://github.com/openstack/watcher/blob/master/watcher/applier/workflow_engine/default.py#L123 should be constructed dby taking the uuid form e

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.