Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1564986 - Dashboard widget is not providing exact content due to Type conversion Exception.
Summary: Dashboard widget is not providing exact content due to Type conversion Except...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.8.0
Hardware: All
OS: All
high
high
Target Milestone: GA
: 5.10.0
Assignee: Yuri Rudman
QA Contact: Dmitry Misharov
URL:
Whiteboard:
Depends On:
Blocks: 1573539 1573540
TreeView+ depends on / blocked
 
Reported: 2018-04-09 06:19 UTC by Neha Chugh
Modified: 2021-06-10 15:43 UTC (History)
10 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1573539 1573540 (view as bug list)
Environment:
Last Closed: 2019-02-11 14:03:15 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:


Attachments (Terms of Use)
sample_report_widget_is_not_working (2.26 KB, text/x-vhdl)
2018-04-12 05:53 UTC, Neha Chugh
no flags Details

Description Neha Chugh 2018-04-09 06:19:56 UTC
Description of problem:

While generating the content from dashboard widgets, below exception observed:

[----] E, [2018-04-09T02:07:34.420909 #4965:ec7138] ERROR -- : [TypeError]: no implicit conversion from nil to integer  Method:[rescue in generate_one_content_for_user]

Version-Release number of selected component (if applicable):
5.8.3.4

How reproducible:
For specific widgets in the customer's environment.

Steps to Reproduce:
1. Custom report was generated and its providing required records.
2. For few widgets based on the custom reports, while generating the content, it is throwing type conversion exception for example "Groups: vCPU (Total)" it throws below exception:

[----] E, [2018-04-09T02:07:34.421192 #4965:ec7138] ERROR -- : /opt/rh/cfme-gemset/bundler/gems/manageiq-ui-classic-176dad0f32b3/lib/report_formatter/c3.rb:80:in `[]'
/opt/rh/cfme-gemset/bundler/gems/manageiq-ui-classic-176dad0f32b3/lib/report_formatter/c3.rb:80:in `build_document_header'
/opt/rh/cfme-gemset/bundler/gems/ruport-3727775479b0/lib/ruport/controller.rb:598:in `maybe'
/opt/rh/cfme-gemset/bundler/gems/ruport-3727775479b0/lib/ruport/controller.rb:584:in `block in execute_stages'
/opt/rh/cfme-gemset/bundler/gems/ruport-3727775479b0/lib/ruport/controller.rb:583:in `each'
/opt/rh/cfme-gemset/bundler/gems/ruport-3727775479b0/lib/ruport/controller.rb:583:in `execute_stages'
/opt/rh/cfme-gemset/bundler/gems/ruport-3727775479b0/lib/ruport/controller.rb:574:in `_run_'
/opt/rh/cfme-gemset/bundler/gems/ruport-3727775479b0/lib/ruport/controller.rb:520:in `run'
/opt/rh/cfme-gemset/bundler/gems/ruport-3727775479b0/lib/ruport/controller.rb:436:in `render'
/var/www/miq/vmdb/app/models/miq_report/formatters/graph.rb:13:in `to_chart'
/var/www/miq/vmdb/app/models/miq_widget/chart_content.rb:8:in `generate'
/var/www/miq/vmdb/app/models/miq_widget.rb:285:in `generate_one_content_for_user'
/var/www/miq/vmdb/app/models/miq_widget/content_generator.rb:32:in `block in determine_content'
/var/www/miq/vmdb/app/models/miq_widget/content_generator.rb:32:in `collect'
/var/www/miq/vmdb/app/models/miq_widget/content_generator.rb:32:in `determine_content'
/var/www/miq/vmdb/app/models/miq_widget/content_generator.rb:8:in `generate'
/var/www/miq/vmdb/app/models/miq_widget.rb:221:in `generate_content'
/var/www/miq/vmdb/app/models/miq_queue.rb:347:in `block in deliver'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:91:in `block in timeout'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `block in catch'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `catch'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `catch'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:106:in `timeout'
/var/www/miq/vmdb/app/models/miq_queue.rb:343:in `deliver'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:106:in `deliver_queue_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:135:in `deliver_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:153:in `block in do_work'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:147:in `loop'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:147:in `do_work'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:340:in `block in do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:337:in `loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:337:in `do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:160:in `run'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:134:in `start'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:21:in `start_worker'
/var/www/miq/vmdb/app/models/miq_worker.rb:357:in `block in start_runner'
/opt/rh/cfme-gemset/gems/nakayoshi_fork-0.0.3/lib/nakayoshi_fork.rb:24:in `fork'
/opt/rh/cfme-gemset/gems/nakayoshi_fork-0.0.3/lib/nakayoshi_fork.rb:24:in `fork'
/var/www/miq/vmdb/app/models/miq_worker.rb:355:in `start_runner'
/var/www/miq/vmdb/app/models/miq_worker.rb:366:in `start'
/var/www/miq/vmdb/app/models/miq_worker.rb:266:in `start_worker'
/var/www/miq/vmdb/app/models/miq_worker.rb:150:in `block in sync_workers'
/var/www/miq/vmdb/app/models/miq_worker.rb:150:in `times'
/var/www/miq/vmdb/app/models/miq_worker.rb:150:in `sync_workers'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:53:in `block in sync_workers'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:50:in `each'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:50:in `sync_workers'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:22:in `monitor_workers'
/var/www/miq/vmdb/app/models/miq_server.rb:349:in `block in monitor'
/opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-a29aab0471c6/lib/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store'
/opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-a29aab0471c6/lib/gems/pending/util/extensions/miq-benchmark.rb:30:in `realtime_block'
/var/www/miq/vmdb/app/models/miq_server.rb:349:in `monitor'
/var/www/miq/vmdb/app/models/miq_server.rb:371:in `block (2 levels) in monitor_loop'
/opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-a29aab0471c6/lib/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store'

Actual results:
It is throwing type conversion error:

[----] E, [2018-04-09T02:07:34.420909 #4965:ec7138] ERROR -- : [TypeError]: no implicit conversion from nil to integer  Method:[rescue in generate_one_content_for_user]
[----] E, [2018-04-09T02:07:34.421192 #4965:ec7138] ERROR -- : /opt/rh/cfme-gemset/bundler/gems/manageiq-ui-classic-176dad0f32b3/lib/report_formatter/c3.rb:80:in `[]'
/opt/rh/cfme-gemset/bundler/gems/manageiq-ui-classic-176dad0f32b3/lib/report_formatter/c3.rb:80:in `build_document_header'



Expected results:

It should not throw any exception and generate the contents for all the widgets.

Additional info:

I have checked at rails console, below is the result:


irb(main):001:0> widget_object = MiqWidget.find_by_id('99000000000065')

PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0
=> #<MiqWidget id: 99000000000065, guid: "0c4ff776-d122-11e6-9e30-00505680312b", description: "Groups: vCPU (Total)", title: "Groups: vCPU (Total)", content_type: "chart", options: {}, visibility: {:roles=>["_ALL_"]}, user_id: nil, resource_id: 99000000000189, resource_type: "MiqReport", miq_schedule_id: 99000000000091, enabled: true, read_only: false, created_at: "2017-01-02 19:31:24", updated_at: "2018-04-09 06:07:36", last_generated_content_on: "2018-04-09 06:07:36", miq_task_id: 99000000894270>

irb(main):002:0> widget_object.queue_generate_content_for_users_or_group

=> #<MiqQueue id: 99000089321939, target_id: nil, priority: 100, method_name: "generate_content", state: "ready", created_on: "2018-04-09 06:18:34", updated_on: "2018-04-09 06:18:34", lock_version: 0, task_id: nil, deliver_on: nil, queue_name: "reporting", class_name: "MiqWidget", instance_id: 99000000000065, args: [], miq_callback: {:class_name=>"MiqWidget", :instance_id=>99000000000065, :method_name=>:generate_content_complete_callback}, msg_data: nil, zone: nil, role: "reporting", server_guid: nil, msg_timeout: 3600, handler_id: nil, handler_type: nil, for_user: nil, for_user_id: nil, expires_on: nil>

Comment 7 Neha Chugh 2018-04-12 05:53:19 UTC
Created attachment 1420689 [details]
sample_report_widget_is_not_working

Comment 17 CFME Bot 2018-05-01 13:41:36 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/d7a37e8ff374e040fc946cc6246f038baa18823a
commit d7a37e8ff374e040fc946cc6246f038baa18823a
Author:     Yuri Rudman <yrudman@redhat.com>
AuthorDate: Thu Apr 26 09:08:38 2018 -0400
Commit:     Yuri Rudman <yrudman@redhat.com>
CommitDate: Thu Apr 26 09:08:38 2018 -0400

    do not change current_group for super admin user when executing Rbac#lookup_user_group
    Example when updating user.current_group in group's look-up is bad: if widget set-up for different group than during content generation (triggered manually from UI) the last group will become current group for super user and this may throw unexpectd errors ( like failing ApplicationController.assert_privileges(widget_refresh)
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1564986

 lib/rbac/filterer.rb | 8 +-
 1 file changed, 5 insertions(+), 3 deletions(-)

Comment 18 CFME Bot 2018-05-01 13:43:41 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/d7a37e8ff374e040fc946cc6246f038baa18823a
commit d7a37e8ff374e040fc946cc6246f038baa18823a
Author:     Yuri Rudman <yrudman@redhat.com>
AuthorDate: Thu Apr 26 09:08:38 2018 -0400
Commit:     Yuri Rudman <yrudman@redhat.com>
CommitDate: Thu Apr 26 09:08:38 2018 -0400

    do not change current_group for super admin user when executing Rbac#lookup_user_group
    Example when updating user.current_group in group's look-up is bad: if widget set-up for different group than during content generation (triggered manually from UI) the last group will become current group for super user and this may throw unexpectd errors ( like failing ApplicationController.assert_privileges(widget_refresh)
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1564986

 lib/rbac/filterer.rb | 8 +-
 1 file changed, 5 insertions(+), 3 deletions(-)

Comment 21 Dmitry Misharov 2018-06-26 12:04:22 UTC
Fixed and verified in 5.10.0.1.20180619163011_900fdc4. Widget content is generated successfully.


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