Bug 1252849

Summary: Heat stack deployment gets stuck when stack parameter is not found
Product: Red Hat CloudForms Management Engine Reporter: Marius Cornea <mcornea>
Component: ProvisioningAssignee: Bill Wei <bilwei>
Status: CLOSED ERRATA QA Contact: Marius Cornea <mcornea>
Severity: medium Docs Contact:
Priority: high    
Version: 5.4.0CC: dclarizi, gmccullo, hkataria, jfrey, jhardy, mfeifer, mpovolny, obarenbo
Target Milestone: GA   
Target Release: 5.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.5.0.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1273191 (view as bug list) Environment:
Last Closed: 2015-12-08 13:26:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1273191    
Attachments:
Description Flags
stack error
none
Provisioning failed with proper error message
none
stack create none

Description Marius Cornea 2015-08-12 11:21:40 UTC
Created attachment 1061911 [details]
stack error

Description of problem:
I'm trying to deploy a Heat stack by using the Orchestration Templates. Template can be found in the gist below. If the key parameter doesn't exist on the Openstack cloud the service request gets stuck with Pending state and Creating Stack as last message. The evm.log shows the stack validation error. Attaching error message.

https://gist.githubusercontent.com/mcornea/b9fb556e279b75db9abc/raw/392824501529fb9a5bad9602d86dd10bb20c156d/heat-wordpress

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

How reproducible:
100%

Steps to Reproduce:
Go to Services -> Catalogs -> Orchestration Templates
Click on Configuration -> Create new Orchestration Template
Write name and description for template, select Openstack Heat template type and copy paste template from https://gist.githubusercontent.com/mcornea/b9fb556e279b75db9abc/raw/392824501529fb9a5bad9602d86dd10bb20c156d/heat-wordpress
Cick Add
Go to Services -> Catalogs -> Orchestration Templates
Click on the template you created in previous step
Click on Configuration -> Create Service Dialog from Orchestration Template; Input name
Go to Services -> Catalogs -> Catalog Items
Click on Configuration; Add a New Catalog Item
Choose Orchestration Catalog Type
Input name/descr; select Display in Catalog
Choose Web Blogs Catalog
Choose the service dialog created in previous step
Choose the orchestration template created in previous step
Choose the overcloud Openstack as provider; click Add
Go to Services -> Catalogs -> Service Catalogs
Click on Web Blogs and choose the catalog item created in previous step; Click Order
Input stack name, the other parameters should work fine with defaults; Click Submit
Click on the newly created request; 

Actual results:
Stack doesn't get created and the service request ends up in pending state.

Expected results:
Proper error output would be shown in the UI.

Comment 2 Bill Wei 2015-08-18 03:56:17 UTC
This issue had been resolved in the past as part of https://bugzilla.redhat.com/show_bug.cgi?id=1218436

When I tried to reproduce this issue I was able to see the expected result. See the attachment screenshot.

I am going to close this bug if there is no further question.

Comment 3 Bill Wei 2015-08-18 03:59:07 UTC
Created attachment 1064147 [details]
Provisioning failed with proper error message

Comment 4 Marius Cornea 2015-08-28 15:54:15 UTC
Created attachment 1068069 [details]
stack create

I've checked 5.4.2.0.20150820153254_83e434d and this issue seems to be still present. You can find attached screenshot with service status minutes after the error in /var/www/miq/vmdb/log/evm.log shows up.

You may find the log here:
http://paste.openstack.org/raw/431065/

Comment 6 CFME Bot 2015-08-31 21:45:26 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/646e35de9c0456d70de6ccea9b5369cb9aca93f7

commit 646e35de9c0456d70de6ccea9b5369cb9aca93f7
Author:     Bill Wei <bilwei>
AuthorDate: Mon Aug 31 14:50:12 2015 -0400
Commit:     Bill Wei <bilwei>
CommitDate: Mon Aug 31 15:49:19 2015 -0400

    truncate user message to 255 characters which will be saved in a string column
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1252849

 .../StateMachines/Methods.class/__methods__/check_provisioned.rb | 2 +-
 .../StateMachines/Methods.class/__methods__/provision.rb         | 2 +-
 .../method_validation/orchestration_check_provisioned_spec.rb    | 9 +++++++++
 .../unit/method_validation/orchestration_provision_spec.rb       | 9 +++++++++
 4 files changed, 20 insertions(+), 2 deletions(-)

Comment 8 CFME Bot 2015-09-08 22:02:15 UTC
Detected commit referencing this ticket while ticket status is POST.

Comment 10 CFME Bot 2015-09-08 22:03:49 UTC
Detected commit referencing this ticket while ticket status is POST.

Comment 12 CFME Bot 2015-09-08 22:04:45 UTC
Detected commit referencing this ticket while ticket status is POST.

Comment 13 CFME Bot 2015-10-21 16:11:00 UTC
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=b3c56136df791f4a59a8335bae351cac93492845

commit b3c56136df791f4a59a8335bae351cac93492845
Author:     Bill Wei <bilwei>
AuthorDate: Mon Aug 31 14:50:12 2015 -0400
Commit:     Bill Wei <bilwei>
CommitDate: Tue Oct 20 21:09:16 2015 -0400

    Truncate user message to 255 characters which will be saved in a string column
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1252849

 .../Methods.class/__methods__/check_provisioned.rb |  2 +-
 .../Methods.class/__methods__/provision.rb         |  2 +-
 .../orchestration_check_provisioned_spec.rb        | 58 ++++++++++++++++++++++
 .../orchestration_provision_spec.rb                | 29 +++++++++++
 4 files changed, 89 insertions(+), 2 deletions(-)
 create mode 100644 vmdb/spec/automation/unit/method_validation/orchestration_check_provisioned_spec.rb
 create mode 100644 vmdb/spec/automation/unit/method_validation/orchestration_provision_spec.rb

Comment 14 Greg McCullough 2015-10-22 14:26:28 UTC
Clearing needinfo flag which looks to have been set by the bot.

Comment 15 Marius Cornea 2015-11-20 18:07:36 UTC
I verified this in 5.5.0.11. 

The last message in the UI shows:
Expected(201) <=> Actual(400 Bad Request) excon.error.response :body => "{\"explanation\": \"The server could not comply with the request since it is either malformed or otherwise incorrect.\", \"code\": 400, \"error\": {\"message\": \"Prope...

This makes it difficult to figure out what went wrong. I expect to get a clear message in the UI, for example, as heat client shows it:
ERROR: Property error: : resources.floating_ip.properties.floating_network: : Error validating value u'public-net': Unable to find network with name 'public-net'  

The message in evm.log shows:
<Expected(201) <=> Actual(400 Bad Request)
excon.error.response
  :body          => "{\"explanation\": \"The server could not comply with the request since it is either malformed or otherwise incorrect.\", \"code\": 400, \"error\": {\"message\": \"Property error: : resources.floating_ip.properties.floating_network: : Error validating value u'public-net': Unable to find network with name 'public-net'\", \"traceback\": \"Traceback (most recent call last):\\n\\n  File \\\"/usr/lib/python2.7/site-packages/heat/common/context.py\\\", line 300, in wrapped\\n    return func(self, ctx, *args, **kwargs)\\n\\n  File \\\"/usr/lib/python2.7/site-packages/heat/engine/service.py\\\", line 670, in create_stack\\n    parent_resource_name)\\n\\n  File \\\"/usr/lib/python2.7/site-packages/heat/engine/service.py\\\", line 578, in _parse_template_and_validate_stack\\n    stack.validate()\\n\\n  File \\\"/usr/lib/python2.7/site-packages/osprofiler/profiler.py\\\", line 105, in wrapper\\n    return f(*args, **kwargs)\\n\\n  File \\\"/usr/lib/python2.7/site-packages/heat/engine/stack.py\\\", line 596, in validate\\n    raise ex\\n\\nStackValidationFailed: Property error: resources.floating_ip.properties.floating_network: Error validating value u'public-net': Unable to find network with name 'public-net'\\n\", \"type\": \"StackValidationFailed\"}, \"title\": \"Bad Request\"}"

Comment 16 Bill Wei 2015-11-20 18:54:09 UTC
Marius,
The status hanging issue has been resolved. Please open another enhancement BZ to improve the readability of the error message. Thanks!

Comment 17 Marius Cornea 2015-11-20 18:57:15 UTC
Ack. Thanks, Bill.

Comment 19 errata-xmlrpc 2015-12-08 13:26:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:2551