manageiq icon indicating copy to clipboard operation
manageiq copied to clipboard

oparin-1.1 custom buttons on service do not work

Open eggoide opened this issue 1 year ago • 24 comments

Hi all, I would like to kindly ask you for a help. We have recently upgraded from Najdorf to Oparin. However, on most of our services, the custom buttons do not work. When clicked, it returns 204 Error.

image

Only issue logged is the following:

Mar 03 10:24:24 vncco0177 production[2137]: INFO -- production: Processing by ServiceController#button as JS Mar 03 10:24:24 vncco0177 production[2137]: INFO -- production: Parameters: {"button_id"=>"54", "cls"=>"ServiceAnsibleTower", "desc"=>"TEST", "id"=>"3144", "pressed"=>"custom_button"} Mar 03 10:24:24 vncco0177 production[2137]: INFO -- production: No template found for ServiceController#button, rendering head :no_content Mar 03 10:24:24 vncco0177 production[2137]: INFO -- production: Completed 204 No Content in 26ms (ActiveRecord: 6.9ms | Allocations: 4483)

The button has its own dialog, but no dialog opens. I tried to edit existing buttons and its dialog, also tried creating new button from the scratch with no luck. I googled but could not find any relevant information on what template is missing. Anyone can advise?

Thank you!

eggoide avatar Mar 03 '23 09:03 eggoide

@jeffibm Can you take a look at this one? I think it might be realted to the services screen rewrite to react.

Fryguy avatar Mar 29 '23 19:03 Fryguy

Hey @eggoide, could you provide some screenshots from the UI so that I can pinpoint on debugging this?

jeffibm avatar Mar 31 '23 10:03 jeffibm

Hey @eggoide, could you provide some screenshots from the UI so that I can pinpoint on debugging this?

Hi, sure, what screenshot do you need? However, there is not much to see, the button just does nothing. I have enabled developer tools and uploaded what it does when clicked. As well as the log. In my original post.

eggoide avatar Mar 31 '23 10:03 eggoide

Hey @eggoide, could you provide some screenshots from the UI so that I can pinpoint on debugging this?

Hi, sure, what screenshot do you need? However, there is not much to see, the button just does nothing. I have enabled developer tools and uploaded what it does when clicked. As well as the log. In my original post.

screenshot of the page (with breadcrumbs) and mark which buttons are not working

jeffibm avatar Mar 31 '23 10:03 jeffibm

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

miq-bot avatar Jul 03 '23 00:07 miq-bot

Hello,

We have the same problem after upgrading from Najdorf to Oparin. All our buttons are not functional. Same problem with the buton retire service.

Have you solved the problem?

Thank you in advance for your help.

rabah-beldi avatar Oct 02 '23 08:10 rabah-beldi

Here is an example of a trace: browser: {"explorer":"flash","replacePartials":{"flash_msg_div":"\u003cdiv id='flash_msg_div' style=''\u003e\n\u003cdiv class='flash_text_div'\u003e\n\u003cdiv class='alert alert-danger alert-dismissable'\u003e\n\u003cbutton class='close' data-dismiss='alert'\u003e\n\u003cspan class='pficon pficon-close'\u003e\u003c/span\u003e\n\u003c/button\u003e\n\u003cspan class='pficon pficon-error-circle-o'\u003e\u003c/span\u003e\n\u003cstrong\u003eThe user is not authorized for this task or item.\u003c/strong\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n"},"scrollTop":true}

MIQ: Oct 2 10:19:05 XXX production[2659]: INFO -- production: No template found for ServiceController#button, rendering head :no_content Oct 2 10:19:05 XXX production[2659]: INFO -- production: Completed 204 No Content in 11ms (ActiveRecord: 1.5ms | Allocations: 4010)

rabah-beldi avatar Oct 02 '23 08:10 rabah-beldi

and here's the error message when using the "lifecycle > retire this service" button: image

rabah-beldi avatar Oct 02 '23 08:10 rabah-beldi

For the record, our custom buttons are functional for EC2 and VMWARE instances. The problem only affects services buttons.

EX of custom button of a custom service, when you click on any button, nothing happens:

tempsnip

rabah-beldi avatar Oct 04 '23 11:10 rabah-beldi

Debugging -

In my local environment's master branch, the Retire Service button click event is working and its being redirected to another page as expected.

However, the service I used to test didn't have custom buttons. After creating one and hitting the button- image

A request is made to POST "/service/button/245" with parameters - {"button_id"=>"1", "cls"=>"Service", "desc"=>"op_pb", "id"=>"245", "pressed"=>"custom_button"} and nothing was rendered.

The only response it shows in the logs is - No template found for ServiceController#button, rendering head :no_content

And the reason is we are not handling the event for custom_button in ServiceController#button action.

This was probably removed during the De explorization of Service Pages #8229 and not put it back...

jeffibm avatar Oct 05 '23 05:10 jeffibm

Debugging -

While trying to put the codes back - I got stuck in here -application_controller/ dialog_initialize

says FATAL -- : SystemStackError (stack level too deep):

Seems like there is a problem with ResourceActionWorkflow.new() method

jeffibm avatar Oct 05 '23 07:10 jeffibm

Debugging -

if ResourceActionWorkflow.new is through, it is supposed to run replace_right_cell(:action => "dialog_provision", :dialog_locals => options[:dialog_locals]) (This function is now removed though...)

and then the file app/views/shared/dialogs/dialog_provision.html.haml must be rendered inside a new url

BCC @DavidResende0 (since we went though this file last day...)

jeffibm avatar Oct 05 '23 11:10 jeffibm

Debugging -

While trying to put the codes back - I got stuck in here -application_controller/ dialog_initialize

says FATAL -- : SystemStackError (stack level too deep):

Seems like there is a problem with ResourceActionWorkflow.new() method

this error seems to be solved after a bin/update and server restart..

jeffibm avatar Oct 06 '23 04:10 jeffibm

Fixes - https://github.com/ManageIQ/manageiq-ui-classic/pull/8930

jeffibm avatar Oct 06 '23 10:10 jeffibm

Thanks for fixing the bug. My tests are OK for custom buttons.

rabah-beldi avatar Oct 06 '23 12:10 rabah-beldi

However, the "Lifecycle > Retire this Service" button still doesn't work for me. cmp_retire

ERROR in logs: Oct 6 14:27:04 XXXX evm[3244]: ERROR -- evm: MIQ(service_controller-button): Retirement action does not apply to selected items

rabah-beldi avatar Oct 06 '23 12:10 rabah-beldi

The 'Set Retirement Dates for this Service' button, on the other hand, works."

rabah-beldi avatar Oct 06 '23 12:10 rabah-beldi

Debugging in master branch ...

after hitting 'Retire the service' button from the Service show page/ Lifecycle / , we get a confirmation dialog box image

then, a post request is made to - service_controller#button - Note: same as oparin

Started POST "/service/button/189?pressed=service_retire_now"
Processing by ServiceController#button as JS
Parameters: {"pressed"=>"service_retire_now", "id"=>"189"}

then the page redirects to image

jeffibm avatar Oct 10 '23 05:10 jeffibm

that's strange! in my case, the confirmation window appears. Then I get the error message when I click on OK. retire_service_ko

after clicking OK. image

Here are the details of my environment:

bundle exec rake about;date About your application's environment Rails version 6.1.7 Ruby version ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux] RubyGems version 3.2.33 Rack version 2.2.5 Middleware SecureHeaders::Middleware, ActionDispatch::HostAuthorization, Rack::Sendfile, ActionDispatch::Executor, ActiveSupport::Cache::Strategy::LocalCache::Middleware, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, ActionDispatch::RemoteIp, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::ActionableExceptions, ActionDispatch::Callbacks, ActionDispatch::Cookies, ActionDispatch::Session::MemCacheStore, ActionDispatch::Flash, ActionDispatch::ContentSecurityPolicy::Middleware, ActionDispatch::PermissionsPolicy::Middleware, Rack::Head, Rack::ConditionalGet, Rack::ETag, Rack::TempfileReaper, RequestStartedOnMiddleware Application root /var/www/miq/vmdb Environment production Database adapter postgresql Database schema version 20221114165219 Tue Oct 10 10:44:00 CEST 2023

ruby -v && psql --version && date ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux] psql (PostgreSQL) 13.7 Tue Oct 10 10:42:48 CEST 2023

vmdb && cat VERSION && echo;date oparin-1.1

`Checking EVM status...

Region Zone Server Status PID SPID Workers Version Started Heartbeat MB Usage Roles
0 Internal EVM* started 2525 2672 52 oparin-1.1 08:26:07UTC 08:41:53UTC 344 automate:database_operations:database_owner:ems_inventory:ems_operations:event:git_owner:notifier:remote_console:reporting:scheduler:smartstate:user_interface:web_services
  • marks a master appliance

` The only error in the logs is:

evm[2750]: ERROR -- evm: MIQ(service_controller-button): Retirement action does not apply to selected items

network trace: Post: /service/button/6289?pressed=service_retire_now Response: { "explorer": "flash", "replacePartials": { "flash_msg_div": "\u003cdiv id='flash_msg_div' style=''\u003e\n\u003cdiv class='flash_text_div'\u003e\n\u003cdiv class='alert alert-danger alert-dismissable'\u003e\n\u003cbutton class='close' data-dismiss='alert'\u003e\n\u003cspan class='pficon pficon-close'\u003e\u003c/span\u003e\n\u003c/button\u003e\n\u003cspan class='pficon pficon-error-circle-o'\u003e\u003c/span\u003e\n\u003cstrong\u003eRetirement action does not apply to selected items\u003c/strong\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n" }, "scrollTop": true }

rabah-beldi avatar Oct 10 '23 09:10 rabah-beldi

Could you please help us correct this issue? We are stuck on the production platform upgrade. I am at your disposal if you need more information. Thank you in advance for your assistance.

rabah-beldi avatar Oct 20 '23 08:10 rabah-beldi

our service deletion issue fixed with upgrade to Petrosian version

rabah-beldi avatar Nov 10 '23 08:11 rabah-beldi

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

miq-bot avatar Feb 12 '24 00:02 miq-bot

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

miq-bot avatar May 13 '24 00:05 miq-bot