Bug 1582873

Summary: [Generic Object] Button added can cause exception page when clicked upon
Product: Red Hat CloudForms Management Engine Reporter: Tsai Li Ming <ltsai>
Component: AutomateAssignee: drew uhlmann <duhlmann>
Status: CLOSED WORKSFORME QA Contact: Martin Kourim <mkourim>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.9.0CC: duhlmann, ltsai, mkanoor, mkourim, obarenbo, tfitzger
Target Milestone: GAKeywords: Reopened
Target Release: cfme-future   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-24 12:09:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
error message
none
Generic objects from service page
none
Generic Object link
none
Edit button on the generic object detail page
none
dialog form
none
mkourim-select_instance_and_click_button
none
mkourim-edit_dialog
none
mkourim-request_submitted none

Description Tsai Li Ming 2018-05-27 15:30:49 UTC
Created attachment 1442419 [details]
error message

Description of problem:

1. Created a Button that calls a Request, 'ansible_tower_job'. 
2. Creates a Generic object that associate with a Service.
3. Go the new Service and instance of the Generic Object. Click on edit button. After filling up dialog form, page errors out with "Couldn't find Service with 'id'=1000000000030 [service/show]"

1000000000030 is the Generic Object ID, and not the Service id that it is associated with. 

There are no indications that the ansible tower job template is being called. 



Version-Release number of selected component (if applicable):
Version 5.9.2.4.20180501195858_35dc609 


How reproducible:
Always

Comment 2 Dave Johnson 2018-05-27 15:43:03 UTC
Please assess the impact of this issue and update the severity accordingly.  Please refer to https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity for a reminder on each severity's definition.

If it's something like a tracker bug where it doesn't matter, please set the severity to Low.

Comment 3 Tsai Li Ming 2018-05-29 16:40:27 UTC
The exception page will occur in the following scenarios:

1. Create an Action button under the Generic Object (Automation -> Generic Object)

- Go to Service -> Instance, view the details of an instance and click on the button.

- The error will not happen if you are at the instance page, select an instance and click on the button. 

2. Create a Button under Automation -> Customization -> Button, under the Generic Object.

Comment 4 Tina Fitzgerald 2018-05-31 13:51:42 UTC

*** This bug has been marked as a duplicate of bug 1583764 ***

Comment 5 Tsai Li Ming 2018-05-31 14:23:01 UTC
This should not be a duplicate #1583764. I will update the title to reflect the Exception page.

Comment 6 drew uhlmann 2018-05-31 15:09:53 UTC
It'd be useful to have the dialog attached to this ticket, as well as any automation code running, please.

Comment 7 Tsai Li Ming 2018-06-01 16:43:00 UTC
Created attachment 1446739 [details]
Generic objects from service page

Comment 8 Tsai Li Ming 2018-06-01 16:43:36 UTC
Created attachment 1446740 [details]
Generic Object link

Comment 9 Tsai Li Ming 2018-06-01 16:44:16 UTC
Created attachment 1446741 [details]
Edit button on the generic object detail page

Comment 10 Tsai Li Ming 2018-06-01 16:46:32 UTC
Created attachment 1446742 [details]
dialog form

Comment 11 Tsai Li Ming 2018-06-01 17:00:56 UTC
1. A static dialog form with a single text box is sufficient to trigger the Exception page.

2. The error won't happen if the button has no dialog form.

Comment 12 drew uhlmann 2018-06-19 19:19:11 UTC
Thanks for the screenshots but I need the dialog and automate domain.

Comment 13 drew uhlmann 2018-07-18 19:13:04 UTC
Hey Tsai can I please have an update about this ticket? I would really like to have a dialog export and automate code, not just screenshots, so I can replicate this.

Comment 14 drew uhlmann 2018-07-18 19:41:34 UTC
May I please have a reproducer?

Comment 15 Martin Kourim 2018-07-24 12:06:01 UTC
I was not able to reproduce the issue.

Steps:

1. create service
POST /api/services
{
    "name": "myservice01",
    "display": true
}

2. create simple dialog with Text Box under Automation / Automate / Customization / Service Dialogs

3. create a generic object class
POST /api/generic_object_definitions
{
  "name": "myclass1",
  "description": "MyClass description"
}

4. create instance of the class
POST /api/generic_objects
{
   "generic_object_definition": {
      "id": "1"
   },
   "name":"go_name1"
}

5. add instance to the service
POST /api/services/1
{
    "action": "add_resource",
    "resource": { "resource": { "href": "https://<addr>/api/generic_objects/1" } }
}

6. create an "Edit" button under Automation / Automate / Generic Objects / All Generic Objects Classes / myclass1
and assign the dialog created in step 2, set "System/Process" to "Request" and "Request" to "ansible_tower_job"

7. go to Services / My Services / myservice01, click on number "1" after "Instances", select the instance (see attached screenshot)

8. click on the "Edit" button, edit the text box (see attached screenshot)

9. click Submit, see "Order Request was Submitted" with no error message (see attached screenshot)

Therefore this can be marked as "worksforme".

Comment 16 Martin Kourim 2018-07-24 12:07:24 UTC
Created attachment 1470278 [details]
mkourim-select_instance_and_click_button

Comment 17 Martin Kourim 2018-07-24 12:08:00 UTC
Created attachment 1470279 [details]
mkourim-edit_dialog

Comment 18 Martin Kourim 2018-07-24 12:08:33 UTC
Created attachment 1470280 [details]
mkourim-request_submitted