Bug 1449345 - Ansible playbook : Error when creating new dialog with existing dialog's name
Summary: Ansible playbook : Error when creating new dialog with existing dialog's name
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.9.0
Assignee: Drew Bomhof
QA Contact: Shveta
URL:
Whiteboard: ansible:playbook:dialog:validation
Depends On:
Blocks: 1459990
TreeView+ depends on / blocked
 
Reported: 2017-05-09 17:24 UTC by Shveta
Modified: 2018-03-06 15:52 UTC (History)
8 users (show)

Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1459990 (view as bug list)
Environment:
Last Closed: 2018-03-06 15:52:08 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
err (105.01 KB, image/png)
2017-05-09 17:24 UTC, Shveta
no flags Details

Description Shveta 2017-05-09 17:24:42 UTC
Created attachment 1277408 [details]
err

Description of problem: Error message is shown when trying to create a new dialog with existing dialog's name


Version-Release number of selected component (if applicable):
5.8.0.13-rc2.20170502165848_0f98658 

How reproducible:


Steps to Reproduce:
1. create a catalog item for ansible playbook. Create new dialog with some name say "xyz"
2. Create another catalog item for playbook and "create new dialog" with same name "xyz" 
3. Error displayed : "Could not create Service Template - Validation failed: Label is not unique within region 0"

Actual results:


Expected results:


Additional info:

Comment 2 Shveta 2017-05-09 17:30:23 UTC
Not able to create catalogitem after that even with correct new dialog or using existing dialog .
Message shown : "Could not create Service Template - {"name":["Job template with this Name already exists."]}"

Comment 4 Greg McCullough 2017-05-10 22:54:20 UTC
Correct, looks like we need to either do more validation up front or better error handling and cleanup if we hit an error so the job_template gets cleaned up.

Comment 6 Drew Bomhof 2017-05-16 19:51:50 UTC
PR: https://github.com/ManageIQ/manageiq/pull/15092 addresses the following backend scenario

1. create a catalog item for ansible playbook. Create new dialog with some name say "xyz"
2. Create another catalog item for playbook and "create new dialog" with same name "xyz" 
3. Error displayed : "Could not create Service Template - Validation failed: Label is not unique within region 0"

But only solves the error message below (https://bugzilla.redhat.com/show_bug.cgi?id=1449345#c2) as it now automatically will roll back the 'zombie' job_template created in step 2.

Message shown : "Could not create Service Template - {"name":["Job template with this Name already exists."]}"

The error shown in step 3 is still an issue due to the attempt at creating a dialog with the same name.

We think a possible solution would be to add validation in the UI that wouldn't allow a new Dialog to be created when one in the 'Use Existing' dropdown has the same name.

Comment 8 CFME Bot 2017-05-17 15:53:19 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:
https://github.com/ManageIQ/manageiq-ui-classic/commit/6828c702c718a7b50063d2ecdbd4c9bd00e785ee

commit 6828c702c718a7b50063d2ecdbd4c9bd00e785ee
Author:     Harpreet Kataria <hkataria>
AuthorDate: Tue May 16 17:20:41 2017 -0400
Commit:     Harpreet Kataria <hkataria>
CommitDate: Tue May 16 17:20:41 2017 -0400

    New dialog name validation added.
    
    Show flash message and disable Add/Save button when user enters a dialog name in 'Create New' field that already exists in the db
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1449345

 .../controllers/catalog/catalog_item_form_controller.js        | 10 ++++++++++
 .../layouts/angular/_ansible_form_options_angular.html.haml    |  1 +
 2 files changed, 11 insertions(+)

Comment 10 Shveta 2017-11-14 06:49:38 UTC
Fixed in 5.9.0.8.20171109215303_ed87902


Note You need to log in before you can comment on or make changes to this bug.