Created attachment 1194270 [details] evm.log which contains the call trace Description of problem: Multi-rate chargeback report can not be queued. Version-Release number of selected component (if applicable): CFME-5.6.1 How reproducible: 100% (From customer's environment) Steps to Reproduce: 1. Create a tag category called 'chargeback'; 2. Create two tags 'sample0' and 'sample1' in the category that we just created; 3. Switch to 'Cloud Intel' -> 'Chargeback' -> 'Rates' and create two new ones called 'Low-Rate Sample' and 'High-Rate Sample'; 4. Switch to 'Assignments', and assign rate 'Low-Rate Sample' to tag 'sample0' and 'High-Rate Sample' to 'sample1'; 5. Switch to 'Compute' -> 'Cloud' -> 'Instances', tag some vms/instances with 'sample0', and the others with 'sample1'; 6. Switch to 'Cloud Intel' -> 'Reports' -> 'Reports', Create a new report called 'Custom Chargeback', which is based on 'Chargeback for VMs'; 7. Edit the report we just created, and add the following fields to the report: * CPU Total * CPU Total Cost * Memory Total * Memory Total Cost * Storage Total * Storage Total Cost * Owner * Fixed Total Cost * Total Cost 8. Then click the 'Queue' button to generate a new report sheet. Actual results: Call trace was found in the evm.log [----] E, [2016-08-26T10:37:40.435421 #3580:a77998] ERROR -- : [NoMethodError]: undefined method `name' for nil:NilClass Method:[rescue in _async_generate_table] [----] E, [2016-08-26T10:37:40.435519 #3580:a77998] ERROR -- : /var/www/miq/vmdb/app/models/chargeback_vm.rb:93:in `get_keys_and_extra_fields' /var/www/miq/vmdb/app/models/chargeback.rb:45:in `block (2 levels) in build_results_for_report_chargeback' /opt/rh/cfme-gemset/gems/activerecord-5.0.0/lib/active_record/relation/delegation.rb:38:in `each' /opt/rh/cfme-gemset/gems/activerecord-5.0.0/lib/active_record/relation/delegation.rb:38:in `each' /var/www/miq/vmdb/app/models/chargeback.rb:43:in `block in build_results_for_report_chargeback' /var/www/miq/vmdb/app/models/chargeback.rb:34:in `each' /var/www/miq/vmdb/app/models/chargeback.rb:34:in `each_cons' /var/www/miq/vmdb/app/models/chargeback.rb:34:in `build_results_for_report_chargeback' /var/www/miq/vmdb/app/models/chargeback_vm.rb:85:in `build_results_for_report_ChargebackVm' /var/www/miq/vmdb/app/models/miq_report/generator.rb:201:in `_generate_table' /var/www/miq/vmdb/app/models/miq_report/generator.rb:176:in `block in generate_table' /var/www/miq/vmdb/app/models/user.rb:280:in `with_user' /var/www/miq/vmdb/app/models/miq_report/generator.rb:176:in `generate_table' /var/www/miq/vmdb/app/models/miq_report/generator/async.rb:96:in `_async_generate_table' /var/www/miq/vmdb/app/models/miq_queue.rb:345:in `block in deliver' /opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:89:in `block in timeout' /opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `block in catch' /opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `catch' /opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `catch' /opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:104:in `timeout' /var/www/miq/vmdb/app/models/miq_queue.rb:341: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:134:in `deliver_message' /var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:152:in `block in do_work' /var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:146:in `loop' /var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:146:in `do_work' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:334:in `block in do_work_loop' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:331:in `loop' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:331:in `do_work_loop' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:153:in `run' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:128: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:347:in `block in start' /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:345:in `start' /var/www/miq/vmdb/app/models/miq_worker.rb:274:in `start_worker' /var/www/miq/vmdb/app/models/miq_worker.rb:154:in `block in sync_workers' /var/www/miq/vmdb/app/models/miq_worker.rb:154:in `times' /var/www/miq/vmdb/app/models/miq_worker.rb:154:in `sync_workers' Expected results: The report should be able to be queued Additional info: This is HuaWei PoC case so forgive me for such a high severity.
Created attachment 1194272 [details] Screenshot when generating the report
Hi Libor, Thank you very much for your hotfix. I will provide the feedback after HuaWei applied the hotfix. Best Regards, Chen
Hi Libor, The customer has confirmed that the hotfix is working in their environment. Thank you very much for your help ! One more concern is that the "Storage Total" is showing too much for their report. You can see in the screenshot for VM "aaaa" that the "Storage Total" is 53 TB but in fact they don't have any VMs whose disk is larger than 1 TB. Should I open a new bug for this issue ? Best Regards, Chen
Created attachment 1195210 [details] VM aaaa is using 53TB in the report.
Hi Chen, yes new BZ will be better, can you also provide copy of their DB or appliance ? (I guess that rates and assignments we be included in the copy ) so then we can recreate the issue. thank you
Hi Libor, Thank you for your guide ! Sure I I will ask for a copy of DB. I will create the bug if I think the engineering has to be involved. Best Regards, Chen
Gregg, please add the PR link.
https://github.com/ManageIQ/manageiq/pull/10812
Verified in 5.7.0.4
*** Bug 1379419 has been marked as a duplicate of this bug. ***