Bug 1460316 - Custom button failing to execute
Summary: Custom button failing to execute
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - Service
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.8.1
Assignee: Allen W
QA Contact: Shveta
URL:
Whiteboard: service
: 1469305 1470129 (view as bug list)
Depends On: 1454910
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-09 16:51 UTC by Satoe Imaishi
Modified: 2022-07-09 08:39 UTC (History)
14 users (show)

Fixed In Version: 5.8.1.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1454910
Environment:
Last Closed: 2017-08-02 17:28:27 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
error (58.61 KB, image/png)
2017-06-30 15:37 UTC, Shveta
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:1758 0 normal SHIPPED_LIVE Important: Red Hat CloudForms security, bug fix, and enhancement update 2017-08-02 21:23:43 UTC

Comment 2 CFME Bot 2017-06-09 16:58:08 UTC
New commit detected on ManageIQ/manageiq-ui-service/fine:
https://github.com/ManageIQ/manageiq-ui-self_service/commit/2663f3b2df17f99ccf17cb3874ce591248559242

commit 2663f3b2df17f99ccf17cb3874ce591248559242
Author:     Chris Kacerguis <chriskacerguis.github.com>
AuthorDate: Thu May 25 09:47:37 2017 -0500
Commit:     Satoe Imaishi <simaishi>
CommitDate: Fri Jun 9 12:52:59 2017 -0400

    Merge pull request #791 from chalettu/vm-custom-button-actions
    
    Added support for a vm to submit a custom button action
    (cherry picked from commit 9860bdc1093adbb452b386a19eed98b38bfe9aec)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1460316

 .../custom-button/custom-button.component.js       |  6 +++
 .../custom-button/custom-button.component.spec.js  | 44 ++++++++++++++++++++++
 client/app/services/vm-details/vm-details.html     |  1 +
 3 files changed, 51 insertions(+)

Comment 3 Shveta 2017-06-29 06:25:08 UTC
Verification blocked by https://bugzilla.redhat.com/show_bug.cgi?id=1466114

Comment 4 Shveta 2017-06-30 15:37:38 UTC
Created attachment 1293285 [details]
error

Please check the attached screenshot .
Appliance : https://10.8.198.31/ui/service
Service - custom_button

Comment 5 Chris Hale 2017-07-05 20:08:28 UTC
Shveta.  I am going to need steps to reproduce this and if you possibly have this issue set up on an appliance that we can look at , please let me know.

Comment 6 Shveta 2017-07-05 20:40:20 UTC
Appliance - https://10.8.197.236/ui/service/

Service name - custom_button.
Click on the VM , Custom_button and click on Submit button. 
See Error .

Comment 7 Chris Kacerguis 2017-07-05 20:54:55 UTC
Seeing this error:

{"error":{"kind":"bad_request","message":"Unsupported Custom Action button for the services resource specified","klass":"Api::BadRequestError"}}

@Gregg - Can you take a look?

Comment 9 Chris Hale 2017-07-05 21:04:54 UTC
I attempted to reproduce the issue you had reported.  The API reported back 400 {"error":{"kind":"bad_request","message":"Unsupported Custom Action button for the services resource specified","klass":"Api::BadRequestError"}}.

For more detail, we posted 

{"action":"button","resource":{"service_name":"nAHlUqtPFZ"}}


to https://10.8.197.236/api/services/1

Comment 10 Tim Wade 2017-07-06 15:40:43 UTC
Chris H,

That looks like expected behavior. I've inspected that appliance and it looks like there are no CustomButtons set up for services. This needs to be done first.

Comment 11 Chris Kacerguis 2017-07-06 15:58:22 UTC
@Shveta - Can you please confirm that CustomButtons are set up for services?

Comment 12 Shveta 2017-07-06 16:14:06 UTC
The custom button was set up for VM and hence when clicked on VM the button shows up . 
 
The bug summary says " When clicking a custom button in the VM details level it failed with "Action to able to submit" in the UI, the production.log shows the following:"

On Vm details page , only VM button shows up .

Comment 13 Chris Kacerguis 2017-07-06 17:13:13 UTC
@Tim thoughts?

@Chris thoughts?

Comment 14 Jillian Tullo 2017-07-07 15:09:53 UTC
After looking into this bug, it appears that the SUI is making a call to the wrong href.

Because the custom button is on the VM, not on the service, the POST call should be made to

/api/vms/:id 
with 
{"action":"button","resource":{"service_name":"nAHlUqtPFZ"}}

not to /api/services/:id 

I went into the SUI to see what call is being made, and noticed that the call is being made incorrectly to services. I was then was able to verify that making the same call to the vms endpoint works correctly:

https://10.8.197.236/api/vms/59
{
  "action": "button",
  "resource": {
    "service_name": "nAHlUqtPFZ"
  }
}

Results in:
{"success":true,"message":"Invoked custom dialog action button for vms id: 59","href":"https://10.8.197.236/api/vms/59"}

Let me know if you have any questions!

Comment 16 Chris Kacerguis 2017-07-07 16:08:43 UTC
A Pivotal Tracker story has been created for this Bug: https://www.pivotaltracker.com/story/show/148493525

Comment 17 Allen W 2017-07-07 17:28:07 UTC
GOOD NEWS this plagues both master and fine, sooooo pr will be made master and packported.  Issue is we treat vm custom buttons the same as service custom buttons, working on the least invasive most natural course of differentiation.

Comment 19 Chris Kacerguis 2017-07-07 20:59:53 UTC
Chris Kacerguis added a comment in Pivotal Tracker:   
   
Commit by Allen Wight
https://github.com/ManageIQ/manageiq-ui-service/commit/c303177e74e3cdb0f433e74a40dbd15d9f014505

Ensure action target collection matches button class [Fixes #148493525]

Also addresses issue of inactionable error message

Comment 20 CFME Bot 2017-07-07 21:58:27 UTC
New commit detected on ManageIQ/manageiq-ui-service/fine:
https://github.com/ManageIQ/manageiq-ui-self_service/commit/a9986b0cda5a7911cb4f7c08a63801345f9d24e4

commit a9986b0cda5a7911cb4f7c08a63801345f9d24e4
Author:     Chris Kacerguis <chriskacerguis.github.com>
AuthorDate: Fri Jul 7 15:59:49 2017 -0500
Commit:     Satoe Imaishi <simaishi>
CommitDate: Fri Jul 7 17:56:10 2017 -0400

    Merge pull request #837 from AllenBW/BZ/#1460316-customInaction
    
    BZ#1460316 - Ensure action target collection matches button class
    (cherry picked from commit b3106155b4c2c760289d6d7352c16577a2e49a52)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1460316

 .../custom_button_details/custom_button_details.state.js       | 10 ++++++----
 .../custom_button_details/custom_button_details.state.spec.js  |  3 ++-
 2 files changed, 8 insertions(+), 5 deletions(-)

Comment 21 Shveta 2017-07-13 16:33:46 UTC
Fixed in 5.8.1.2.20170712143358_461cde4

Comment 22 Jillian Tullo 2017-07-14 19:04:56 UTC
*** Bug 1469305 has been marked as a duplicate of this bug. ***

Comment 23 Jillian Tullo 2017-07-14 19:11:01 UTC
*** Bug 1470129 has been marked as a duplicate of this bug. ***

Comment 25 errata-xmlrpc 2017-08-02 17:28:27 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-2017:1758


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