ManageIQ / manageiq

ManageIQ Open-Source Management Platform
https://manageiq.org
Apache License 2.0
1.34k stars 897 forks source link

oparin-1.1 custom buttons on service do not work #22390

Open eggoide opened 1 year ago

eggoide commented 1 year ago

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!

Fryguy commented 1 year ago

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

jeffibm commented 1 year ago

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

eggoide commented 1 year ago

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.

jeffibm commented 1 year ago

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

miq-bot commented 1 year ago

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.

rabah-beldi commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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

rabah-beldi commented 11 months ago

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

jeffibm commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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

rabah-beldi commented 11 months ago

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

rabah-beldi commented 11 months ago

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 commented 11 months ago

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

jeffibm commented 11 months ago

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
rabah-beldi commented 11 months ago

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

` 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 commented 10 months ago

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 commented 10 months ago

our service deletion issue fixed with upgrade to Petrosian version

miq-bot commented 7 months ago

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 commented 4 months ago

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 commented 3 weeks ago

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.