exceptions raised during deployment are 'ignored' because they cause "TypeError: exception_result() takes exactly 2 arguments (1 given)"

Bug #1428058 reported by Radek Pospisil
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
Critical
Kirill Zaitsev

Bug Description

It seems, that murano after 'Commit 73f8368024acc2f79ef4494b1fbfcc3d2452e494 (Adds API to obtain action result...)' does not correctly handle exceptions in exception_result - it is called with one argument, but it requires two arguments:
engine.py: 63: result['action'] = TaskExecutor.exception_result(e)
engine.py:188: def exception_result(exception, exception_traceback):

I'm using policy enforcement - when it finds policy violation (ValidationError), then the TaskProcessingEndpoint.handle_task captures the ValidationError, but it fails due to TypeError. In this case the deployment fails, but it is reported as 'Ready', because the exception is 'lost' and it is not processed - deploy action is ended as 'success'.

2015-03-04 09:36:16.352 30930 ERROR murano.policy.model_policy_enforcer [-] Murano object model validation failed:
  Unsupported application detected: io.murano.databases.PostgreSql, PostgreDB
2015-03-04 09:36:16.355 30930 ERROR murano.common.engine [-] Error during task execution for tenant 2866e4ed44dc4ad2be1a19d04da9f4b7
2015-03-04 09:36:16.355 30930 TRACE murano.common.engine Traceback (most recent call last):
2015-03-04 09:36:16.355 30930 TRACE murano.common.engine File "/opt/stack/murano/murano/common/engine.py", line 59, in handle_task
2015-03-04 09:36:16.355 30930 TRACE murano.common.engine result = task_executor.execute()
2015-03-04 09:36:16.355 30930 TRACE murano.common.engine File "/opt/stack/murano/murano/common/engine.py", line 133, in execute
2015-03-04 09:36:16.355 30930 TRACE murano.common.engine return self._execute(pkg_loader)
2015-03-04 09:36:16.355 30930 TRACE murano.common.engine File "/opt/stack/murano/murano/common/engine.py", line 145, in _execute
2015-03-04 09:36:16.355 30930 TRACE murano.common.engine self._validate_model(obj, self.action, class_loader)
2015-03-04 09:36:16.355 30930 TRACE murano.common.engine File "/opt/stack/murano/murano/common/engine.py", line 206, in _validate_model
2015-03-04 09:36:16.355 30930 TRACE murano.common.engine class_loader)
2015-03-04 09:36:16.355 30930 TRACE murano.common.engine File "/opt/stack/murano/murano/policy/model_policy_enforcer.py", line 93, in validate
2015-03-04 09:36:16.355 30930 TRACE murano.common.engine raise ValidationError(msg)
2015-03-04 09:36:16.355 30930 TRACE murano.common.engine ValidationError: Murano object model validation failed:
2015-03-04 09:36:16.355 30930 TRACE murano.common.engine Unsupported application detected: io.murano.databases.PostgreSql, PostgreDB
2015-03-04 09:36:16.355 30930 TRACE murano.common.engine
2015-03-04 09:36:16.356 30930 DEBUG oslo_messaging._drivers.amqpdriver [-] MSG_ID is f721636da71f49bf8d1750e55b3a0073 _send /usr/local/lib/python2.7/dist-pa
2015-03-04 09:36:16.357 30930 DEBUG oslo_messaging._drivers.amqp [-] Pool creating new connection create /usr/local/lib/python2.7/dist-packages/oslo_messagi
2015-03-04 09:36:16.358 30930 INFO oslo_messaging._drivers.impl_rabbit [-] Connecting to AMQP server on 16.60.142.48:5672
2015-03-04 09:36:16.370 30930 INFO oslo_messaging._drivers.impl_rabbit [-] Connected to AMQP server on 16.60.142.48:5672
2015-03-04 09:36:16.374 30930 DEBUG oslo_messaging._drivers.amqp [-] UNIQUE_ID is 2bb363e557b84b8ba35f520a1b8ba64b. _add_unique_id /usr/local/lib/python2.7/
2015-03-04 09:36:16.374 30930 DEBUG oslo_messaging._drivers.amqp [-] Pool creating new connection create /usr/local/lib/python2.7/dist-packages/oslo_messagi
2015-03-04 09:36:16.374 30930 INFO oslo_messaging._drivers.impl_rabbit [-] Connecting to AMQP server on 16.60.142.48:5672
2015-03-04 09:36:16.385 30930 INFO oslo_messaging._drivers.impl_rabbit [-] Connected to AMQP server on 16.60.142.48:5672
2015-03-04 09:36:16.445 30930 ERROR oslo_messaging.rpc.dispatcher [-] Exception during message handling: exception_result() takes exactly 2 arguments (1 giv
2015-03-04 09:36:16.445 30930 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2015-03-04 09:36:16.445 30930 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142
2015-03-04 09:36:16.445 30930 TRACE oslo_messaging.rpc.dispatcher executor_callback))
2015-03-04 09:36:16.445 30930 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186
2015-03-04 09:36:16.445 30930 TRACE oslo_messaging.rpc.dispatcher executor_callback)
2015-03-04 09:36:16.445 30930 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 130
2015-03-04 09:36:16.445 30930 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2015-03-04 09:36:16.445 30930 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/murano/murano/common/engine.py", line 63, in handle_task
2015-03-04 09:36:16.445 30930 TRACE oslo_messaging.rpc.dispatcher result['action'] = TaskExecutor.exception_result(e)
2015-03-04 09:36:16.445 30930 TRACE oslo_messaging.rpc.dispatcher TypeError: exception_result() takes exactly 2 arguments (1 given)
2015-03-04 09:36:16.445 30930 TRACE oslo_messaging.rpc.dispatcher

summary: - exception raised during deployment are 'ignored' because it causes
+ exceptions raised during deployment are 'ignored' because they cause
"TypeError: exception_result() takes exactly 2 arguments (1 given)"
Revision history for this message
Radek Pospisil (radek-pospisil) wrote :

This is probably correct fix:
murano/common/engine.py:63: result['action'] = TaskExecutor.exception_result(e,traceback.format_exc())

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (master)

Fix proposed to branch: master
Review: https://review.openstack.org/161157

Changed in murano:
assignee: nobody → Stan Lagun (slagun)
status: New → In Progress
Changed in murano:
importance: Undecided → Critical
milestone: none → kilo-3
Changed in murano:
assignee: Stan Lagun (slagun) → Kirill Zaitsev (kzaitsev)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (master)

Reviewed: https://review.openstack.org/161157
Committed: https://git.openstack.org/cgit/stackforge/murano/commit/?id=b3e665c63a73c15194d3339f751f68aa05dc2b20
Submitter: Jenkins
Branch: master

commit b3e665c63a73c15194d3339f751f68aa05dc2b20
Author: Stan Lagun <email address hidden>
Date: Wed Mar 4 13:08:14 2015 +0300

    Makes exception_traceback optional for exception_result

    Change-Id: Icd6d655e615fbe92bbf7ba6caaffe5b74c67ffab
    Closes-Bug: #1428058

Changed in murano:
status: In Progress → Fix Committed
Changed in murano:
status: Fix Committed → Fix Released
Changed in murano:
milestone: kilo-3 → 2015.1.0
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.