Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eggoide opened this issue Mar 3, 2023 · 25 comments
Open

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

eggoide opened this issue Mar 3, 2023 · 25 comments
Assignees

Comments

@eggoide
Copy link

eggoide commented Mar 3, 2023

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
Copy link
Member

Fryguy commented Mar 29, 2023

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

@jeffibm
Copy link
Member

jeffibm commented Mar 31, 2023

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

@eggoide
Copy link
Author

eggoide commented Mar 31, 2023

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
Copy link
Member

jeffibm commented Mar 31, 2023

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 miq-bot added the stale label Jul 3, 2023
@miq-bot
Copy link
Member

miq-bot commented Jul 3, 2023

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
Copy link

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
Copy link

rabah-beldi commented Oct 2, 2023

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
Copy link

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

@rabah-beldi
Copy link

rabah-beldi commented Oct 4, 2023

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
Copy link
Member

jeffibm commented Oct 5, 2023

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
Copy link
Member

jeffibm commented Oct 5, 2023

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
Copy link
Member

jeffibm commented Oct 5, 2023

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
Copy link
Member

jeffibm commented Oct 6, 2023

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
Copy link
Member

jeffibm commented Oct 6, 2023

Fixes - ManageIQ/manageiq-ui-classic#8930

@rabah-beldi
Copy link

rabah-beldi commented Oct 6, 2023

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

@rabah-beldi
Copy link

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
Copy link

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

@jeffibm
Copy link
Member

jeffibm commented Oct 10, 2023

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
Copy link

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
Copy link

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
Copy link

our service deletion issue fixed with upgrade to Petrosian version

@miq-bot
Copy link
Member

miq-bot commented Feb 12, 2024

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.

3 similar comments
@miq-bot
Copy link
Member

miq-bot commented May 13, 2024

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
Copy link
Member

miq-bot commented Aug 19, 2024

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
Copy link
Member

miq-bot commented Nov 25, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants