ManageIQ / manageiq-ui-classic

Classic UI of ManageIQ
Apache License 2.0
50 stars 358 forks source link

Clicking on a service in the My Services page throws a 500 error #8786

Closed agrare closed 8 months ago

agrare commented 1 year ago

When clicking on a service in the My Services page I hit a 500 error stack level too deep when listing the service

This was on the petrosian branch, ui-classic sha 47519695f45b

image

[----] D, [2023-05-11T11:10:39.064827 #324965:13dd0] DEBUG -- development:   Service Inst Including Associations (0.0ms - 1rows)
[----] D, [2023-05-11T11:10:39.065177 #324965:13dd0] DEBUG -- development:   CACHE ServiceResource Load (0.0ms)  SELECT "service_resources".* FROM "service_resources" WHERE "service_resources"."service_id" = $1 AND "service_resources"."resource_type" = $2 ORDER BY group_idx ASC  [["service_id", 1], ["resource_type", "VmOrTemplate"]]
[----] D, [2023-05-11T11:10:39.065240 #324965:13dd0] DEBUG -- development:   ServiceResource Inst Including Associations (0.0ms - 0rows)
[----] D, [2023-05-11T11:10:39.089741 #324965:13dd0] DEBUG -- development:   Rendered /home/grare/adam/.gem/ruby/3.0.0/bundler/gems/manageiq-ui-classic-47519695f45b/app/views/layouts/_textual_groups_generic.html.haml (Duration: 32.8ms | Allocations: 158581)
[----] D, [2023-05-11T11:10:39.089931 #324965:13dd0] DEBUG -- development:   Rendered /home/grare/adam/.gem/ruby/3.0.0/bundler/gems/manageiq-ui-classic-47519695f45b/app/views/service/_svcs_show.html.haml (Duration: 33.1ms | Allocations: 158782)
[----] I, [2023-05-11T11:10:39.090032 #324965:13dd0]  INFO -- development:   Rendered /home/grare/adam/.gem/ruby/3.0.0/bundler/gems/manageiq-ui-classic-47519695f45b/app/views/service/show.html.haml within layouts/application (Duration: 33.3ms | Allocations: 158864)
[----] I, [2023-05-11T11:10:39.090113 #324965:13dd0]  INFO -- development:   Rendered layout /home/grare/adam/.gem/ruby/3.0.0/bundler/gems/manageiq-ui-classic-47519695f45b/app/views/layouts/application.html.haml (Duration: 33.4ms | Allocations: 158966)
[----] I, [2023-05-11T11:10:39.090451 #324965:13dd0]  INFO -- development: Completed 500 Internal Server Error in 43ms (ActiveRecord: 1.6ms | Allocations: 167435)

[----] F, [2023-05-11T11:10:39.095432 #324965:13dd0] FATAL -- development:   
SystemStackError (stack level too deep):

activesupport (6.1.7.3) lib/active_support/core_ext/object/json.rb:174:in `each'
activesupport (6.1.7.3) lib/active_support/core_ext/object/json.rb:174:in `as_json'
activesupport (6.1.7.3) lib/active_support/core_ext/object/json.rb:175:in `block in as_json'
activesupport (6.1.7.3) lib/active_support/core_ext/object/json.rb:174:in `each'
activesupport (6.1.7.3) lib/active_support/core_ext/object/json.rb:174:in `as_json'

Here is the service in the console:

>> pp Service.find(1)
#<Service:0x000055ef9cd7e600
 id: 1,
 name: "Provision a VM-20230511-110318",
 description: nil,
 guid: "9e73b03a-135f-4a84-90f9-5c1fa9459c0a",
 type: nil,
 service_template_id: 1,
 options: {:dialog=>{"dialog_text_box_1"=>"Order a VM"}},
 visible: true,
 created_at: Thu, 11 May 2023 15:03:15.666975000 UTC +00:00,
 updated_at: Thu, 11 May 2023 15:05:35.226247000 UTC +00:00,
 evm_owner_id: 1,
 miq_group_id: 2,
 retired: false,
 retires_on: nil,
 retirement_warn: nil,
 retirement_last_warn: nil,
 retirement_state: nil,
 retirement_requester: nil,
 tenant_id: 1,
 ancestry: nil,
 initiator: "user",
 lifecycle_state: "error_in_provisioning",
 currency_id: nil,
 price: nil>

Unsure if this is relevant but this service failed to provision. Still shouldn't fail this way but might be necessary for reproducing the error.

jeffibm commented 1 year ago

Findings -

the error appeared to be coming in from/app/views/layouts/_textual_groups_generic.html.haml

the props named options for TextualSummaryWrapper component is too big.

its supposed to be something like this {:src_ids=>["2983"], :request_type=>:vm_reconfigure, :org_controller=>"vm"}

instead, we get

Screenshot 2023-05-12 at 3 18 19 PM
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.

agrare commented 1 year ago

@jeffibm is this still a bug?

jeffibm commented 1 year ago

@jeffibm is this still a bug?

it's been a while. let me try and replicate this error again..

jeffibm commented 1 year ago

@jeffibm is this still a bug?

I was not able to replicate this error in my local petrosian branch. seems to be working fine.

now I am getting a null for options

https://github.com/ManageIQ/manageiq-ui-classic/issues/8786#issuecomment-1545519546

Is there a specific type of record or page that we need to check this?

agrare commented 1 year ago

@jeffibm I ordered a service that provisioned a VM and this was the result. I don't think that nil options realistically represents the issue.

jeffibm commented 1 year ago

@jeffibm I ordered a service that provisioned a VM and this was the result. I don't think that nil options realistically represents the issue.

yes, that's what I thought in the beginning. but when I commented the big object in options value, the page then got rendered.

now, I just checked all records in my local petsosian and am able to see pages without any problems. are you still seeing any issues?

Fryguy commented 1 year ago

We have a reproducible error in an internal demo environment.

miq-bot commented 11 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.

agrare commented 11 months ago

@jeffibm please investigate

jeffibm commented 11 months ago

@jeffibm please investigate

Yes, will investigate further.

This happens randomly in the local environment.

And, when it does, we get the long object mentioned in the comment

Then, we have to logout and login and when we visit the same page again, the error does not occur.

miq-bot commented 8 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.

jeffibm commented 8 months ago

This was fixed in https://github.com/ManageIQ/manageiq-ui-classic/pull/9030