Bug 1454910 - Custom button failing to execute
Summary: Custom button failing to execute
Keywords:
Status: CLOSED CURRENTRELEASE
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.9.0
Assignee: Chris Hale
QA Contact: Shveta
URL:
Whiteboard:
Depends On:
Blocks: 1455311 1460316
TreeView+ depends on / blocked
 
Reported: 2017-05-23 18:19 UTC by Chris Kacerguis
Modified: 2018-03-06 15:17 UTC (History)
8 users (show)

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


Attachments (Terms of Use)
Error submititng reuqest (88.69 KB, image/png)
2017-06-05 16:34 UTC, Shveta
no flags Details

Description Chris Kacerguis 2017-05-23 18:19:31 UTC
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:

[----] I, [2017-05-23T10:11:39.736924 #7746:105511c]  INFO -- : Started POST "/api/services/1000000000001" for 127.0.0.1 at 2017-05-23 10:11:39 -0400
[----] I, [2017-05-23T10:11:39.739517 #7746:105511c]  INFO -- : Processing by Api::ServicesController#update as JSON
[----] I, [2017-05-23T10:11:39.739652 #7746:105511c]  INFO -- :   Parameters: {"c_id"=>"1000000000001", "service"=>{}}
[----] I, [2017-05-23T10:11:39.769864 #7746:105511c]  INFO -- : Completed 400 Bad Request in 30ms (Views: 0.2ms | ActiveRecord: 4.3ms)

Comment 2 Chris Hale 2017-05-23 18:29:11 UTC
Ive traced back through our custom button logic and we are calling button actions as specified by documentation on this link.  http://manageiq.org/docs/reference/latest/api/reference/service_custom_actions


Here is where we call the api for button actions. 
https://github.com/ManageIQ/manageiq-ui-service/blob/master/client/app/services/custom-button/custom-button.component.js#L35

I recommend someone from the API team take a look and let us know their thoughts.

Comment 3 Loic Avenel 2017-05-24 07:49:19 UTC
Does it make sense to call Service_custom_actions for a button at VM level?

Comment 4 Jillian Tullo 2017-05-24 16:56:19 UTC
It appears that the actions are not working on subresources (ie POST /api/services/:service_id/vms/:vm_id). I am currently working on a fix, but it is a complex problem.

If an immediate fix is necessary in the SUI, a workaround would be to call the custom action via:
POST /api/vms/:vm_id as I have verified that to work.

Comment 5 Jillian Tullo 2017-05-24 17:45:15 UTC
After discussing with Chris Hale, for the time being the SUI will use the workaround to call custom actions on the vms collection endpoint rather than with VMs as a subcollection so that this particular issue can be resolved. 

The greater issue from the API perspective is something Tim has been working on and is a big change in the api. Now that this bug has been discovered, I think it's best to create a separate BZ for the API portion.

Comment 6 Jillian Tullo 2017-05-26 11:30:14 UTC
Assigning back to Chris as I believe he has fixed this issue.

Comment 10 Shveta 2017-06-05 16:33:45 UTC
On clicking custom button the page does navigate to show the dialog.
But when request is submitted shows error " Error submitting this request"

Comment 11 Shveta 2017-06-05 16:34:43 UTC
Created attachment 1285088 [details]
Error submititng reuqest

I can open a separate bug for this if required ?

Comment 13 Shveta 2017-10-14 00:22:26 UTC
Working in 5.9.0.2.20171010190026_0413a06


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