Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1509809 - Ui :Server Error occurs when adding ansible playbook service catalog item with the same name
Summary: Ui :Server Error occurs when adding ansible playbook service catalog item wit...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.10.0
Assignee: Martin Hradil
QA Contact: Niyaz Akhtar Ansari
URL:
Whiteboard:
Depends On:
Blocks: 1439135 1513618
TreeView+ depends on / blocked
 
Reported: 2017-11-06 07:01 UTC by Niyaz Akhtar Ansari
Modified: 2018-06-21 20:25 UTC (History)
8 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1513618 (view as bug list)
Environment:
Last Closed: 2018-06-21 20:25:51 UTC
Category: ---
Cloudforms Team: ---


Attachments (Terms of Use)
server api error (deleted)
2017-11-06 07:01 UTC, Niyaz Akhtar Ansari
no flags Details

Description Niyaz Akhtar Ansari 2017-11-06 07:01:10 UTC
Created attachment 1348424 [details]
server api error

Description of problem:


Version-Release number of selected component (if applicable):
Version 5.9.0.5.20171102023815_209f732 

How reproducible:
100%

Steps to Reproduce:
1.Enable Embedded Ansible role.
2.Add some repositories with ansible playbooks.
3.Navigate to Services/Catalogs/Catalog Items.
4.Create "Ansible Playbook" catalog item
5.Again repeat step 4 with the same name 

Actual results:


Expected results:


Additional info:
Evm.log error:

[----] E, [2017-11-06T01:58:49.028334 #13144:1317134] ERROR -- : AnsibleTowerClient::Middleware::RaiseTowerError Response Body:
[----] E, [2017-11-06T01:58:49.028934 #13144:1317134] ERROR -- : MIQ(MiqQueue#deliver) Message id: [1128], Error: [{"name":["Job template with this Name already exists."]}]
[----] E, [2017-11-06T01:58:49.029187 #13144:1317134] ERROR -- : [AnsibleTowerClient::ClientError]: {"name":["Job template with this Name already exists."]}  Method:[block in method_missing]
[----] E, [2017-11-06T01:58:49.029276 #13144:1317134] ERROR -- : /opt/rh/cfme-gemset/gems/ansible_tower_client-0.12.2/lib/ansible_tower_client/middleware/raise_tower_error.rb:23:in `on_complete'

Comment 2 Martin Hradil 2017-11-14 17:11:22 UTC
So.. what is the BZ about? 

It's a bit hard to guess without Actual results and Expected results - hence the fields' existence in the template ;).


I can confirm I see the error.
I also see a flash message about the error.
The error seems valid given the steps.


(Perhaps the resolution should be to not show the error modal on validation errors and only show the flash message?)

Comment 5 CFME Bot 2017-11-15 12:28:15 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:
https://github.com/ManageIQ/manageiq-ui-classic/commit/dafc94e68ca0041891bfcb1b5d58850cf4864aae

commit dafc94e68ca0041891bfcb1b5d58850cf4864aae
Author:     Martin Hradil <mhradil@redhat.com>
AuthorDate: Tue Nov 14 18:22:10 2017 +0000
Commit:     Martin Hradil <mhradil@redhat.com>
CommitDate: Tue Nov 14 18:22:10 2017 +0000

    PostService - skipError on 400, deduplicate
    
    go to Services > Catalogs, Catalog Items accordion
    create a new Catalog Item, of type Ansible Playbook
    do stuff to trigger a validation error on saving (duplicate name, badly configured embedded ansible)
    
    Before - you'll see the error modal pop up, and a flash message.
    
    Now - you'll only see the flash message.
    
    This also cleans up postService:
      * there were 2 identical brances differing in `action: 'edit'` vs `action: 'create'`
      * handleSuccess handled errors, separately from handleFailure but same way
      * $timeout was being used to compensate for not having originally injected the angular API variant
    
    (`postService` is only used by that single form - but that's a TODO for later)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1509809

 app/assets/javascripts/services/post_service.js | 85 +++++++++++--------------
 1 file changed, 38 insertions(+), 47 deletions(-)


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