"get_attribute" to multi-instance node template returns HTTP 500

Description

When get_attribute is invoked and the target node template has more than one instance, it is an error condition. A message is sent to the REST logs:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 04/04/2018 07:48:25 [ERROR] [manager_rest.server] Internal Error Traceback (most recent call last): File "/opt/manager/env/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request rv = self.dispatch_request() File "/opt/manager/env/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/opt/manager/env/lib/python2.7/site-packages/flask_restful/__init__.py", line 261, in wrapper resp = resource(*args, **kwargs) File "/opt/manager/env/lib/python2.7/site-packages/flask/views.py", line 84, in view return self.dispatch_request(*args, **kwargs) File "/opt/manager/env/lib/python2.7/site-packages/flask_restful/__init__.py", line 341, in dispatch_request resp = meth(*args, **kwargs) File "/opt/manager/env/lib/python2.7/site-packages/manager_rest/security/secured_resource.py", line 38, in wrapper return func(*args, **kwargs) File "/opt/manager/env/lib/python2.7/site-packages/manager_rest/rest/rest_decorators.py", line 477, in wrapper return func(*args, **kwargs) File "/opt/manager/env/lib/python2.7/site-packages/manager_rest/rest/resources_v3.py", line 623, in get node['deployment_id']) File "/opt/manager/env/lib/python2.7/site-packages/manager_rest/dsl_functions.py", line 40, in evaluate_intrinsic_functions raise FunctionsEvaluationError(str(e)) FunctionsEvaluationError: Unable to evaluate get_attribute function: More than one node instance found for node "host_IP_Address". Cannot resolve a node instance unambiguously.

However, this error message doesn't get to the dispatcher at all. The Management Workers log shows something like this:

1 2 3 4 5 6 7 8 9 10 11 12 13 [2018-04-03 16:10:08,966: ERROR/MainProcess] Task cloudify.dispatch.dispatch[e4f19557-289a-4fbc-acaa-095e4e6fa2b8] raised unexpected: RecoverableError(u'500: Internal Server Error',) Traceback (most recent call last): File "/opt/mgmtworker/env/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task R = retval = fun(*args, **kwargs) File "/opt/mgmtworker/env/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__ return self.run(*args, **kwargs) File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/dispatch.py", line 616, in dispatch return handler.handle_or_dispatch_to_subprocess_if_remote() File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/dispatch.py", line 99, in handle_or_dispatch_to_subprocess_if_remote return self.dispatch_to_subprocess() File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify/dispatch.py", line 174, in dispatch_to_subprocess **known_exception_type_kwargs) RecoverableError: 500: Internal Server Error

Making it VERY cumbersome to track.

This error shouldn't actually return HTTP 500, ever.

Steps to Reproduce

Environment:
OS (CLI), HA cluster, cloud provider
------------------------------------

Steps to reproduce:
------------------
1.
2.
3.

Expected result:
---------------

Actual result:
-------------

Why Propose Close?

None

Status

Assignee

Łukasz Maksymczuk

Reporter

Isaac Shabtay

Labels

None

Severity

Medium

Target Version

4.5

Premium Only

no

Found In Version

4.1

QA Owner

Lital Hamami

Bug Type

legacy bug

Customer Encountered

Yes

Customer Name

None

Release Notes

yes

Priority

None

Sprint

None

Priority

Unprioritized
Configure