Bug 1440917

Summary: Error '[NoMethodError]: undefined method `base_model' for NilClass:Class' generating chargeback for container images report
Product: Red Hat CloudForms Management Engine Reporter: Gregg Tanzillo <gtanzill>
Component: ReportingAssignee: Yuri Rudman <yrudman>
Status: CLOSED CURRENTRELEASE QA Contact: Gilad Shefer <gshefer>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.7.0CC: akarol, cpelland, epacific, gshefer, jhardy, obarenbo, simaishi, yrudman
Target Milestone: GAKeywords: TestOnly
Target Release: 5.9.3Flags: gshefer: needinfo+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1441198 1441199 (view as bug list) Environment:
Last Closed: 2018-05-17 12:03:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Container Management Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1441198, 1441199, 1561041    

Description Gregg Tanzillo 2017-04-10 18:23:55 UTC
Description of problem:
[----] I, [2017-04-10T11:10:52.339494 #7658:e5513c]  INFO -- : MIQ(ChargebackContainerImage.build_results_for_report_chargeback) Calculating chargeback costs...
[----] I, [2017-04-10T11:10:57.361027 #7658:e5513c]  INFO -- : MIQ(Chargeback::ConsumptionHistory.for_report) Found 2513 records for time range [2017-04-09 00:00:00 UTC, 2017-04-09 23:59:59 UTC]
[----] E, [2017-04-10T11:10:59.549572 #7658:e5513c] ERROR -- : [NoMethodError]: undefined method `base_model' for NilClass:Class  Method:[rescue in _async_generate_table]
[----] E, [2017-04-10T11:10:59.549872 #7658:e5513c] ERROR -- : /var/www/miq/vmdb/app/models/mixins/assignment_mixin.rb:146:in `block in get_assigned_for_target'
/var/www/miq/vmdb/app/models/mixins/assignment_mixin.rb:146:in `collect'
/var/www/miq/vmdb/app/models/mixins/assignment_mixin.rb:146:in `get_assigned_for_target'
/var/www/miq/vmdb/app/models/chargeback/rates_cache.rb:13:in `rates'
/var/www/miq/vmdb/app/models/chargeback/rates_cache.rb:7:in `get'
/var/www/miq/vmdb/app/models/chargeback.rb:9:in `block in build_results_for_report_chargeback'
/var/www/miq/vmdb/app/models/chargeback/consumption_history.rb:31:in `block (2 levels) in for_report'
/var/www/miq/vmdb/app/models/chargeback/consumption_history.rb:27:in `each'
/var/www/miq/vmdb/app/models/chargeback/consumption_history.rb:27:in `block in for_report'
/var/www/miq/vmdb/app/models/chargeback/consumption_history.rb:13:in `each'
/var/www/miq/vmdb/app/models/chargeback/consumption_history.rb:13:in `each_cons'
/var/www/miq/vmdb/app/models/chargeback/consumption_history.rb:13:in `for_report'
/var/www/miq/vmdb/app/models/chargeback.rb:8:in `build_results_for_report_chargeback'
/var/www/miq/vmdb/app/models/chargeback_container_image.rb:55:in `build_results_for_report_ChargebackContainerImage'
/var/www/miq/vmdb/app/models/miq_report/generator.rb:198:in `_generate_table'
/var/www/miq/vmdb/app/models/miq_report/generator.rb:172:in `block in generate_table'
/var/www/miq/vmdb/app/models/user.rb:243:in `with_user'
/var/www/miq/vmdb/app/models/miq_report/generator.rb:172:in `generate_table'
/var/www/miq/vmdb/app/models/miq_report/generator/async.rb:96:in `_a

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

How reproducible:
Encountered by customer.

Comment 2 Gregg Tanzillo 2017-04-10 18:27:29 UTC
PR https://github.com/ManageIQ/manageiq/pull/14713

Comment 6 Gilad Shefer 2018-02-07 11:44:51 UTC
Please describe steps to reproduce.

Comment 7 Gilad Shefer 2018-02-07 11:45:51 UTC
Just queuing a chargeback for images report?

Comment 8 Gregg Tanzillo 2018-02-07 19:21:29 UTC
Yes, it should be enough to generate a chargeback report for container images.

Comment 9 Gilad Shefer 2018-02-11 13:24:12 UTC
I tested this under 5.9.0.19, the problem is not solved, see exactly the same error.

Comment 10 Gregg Tanzillo 2018-02-13 16:18:54 UTC
Gilad,

Can you provide access to the environment where you are still seeing this bug? Also, let me know which report to run. I created a chargeback report on a 5.9.0.19 appliance and it successfully generated. I'll need to access your env to see what's different.

an export of your DB would also work.

Comment 13 Einat Pacifici 2018-05-17 09:14:11 UTC
Yuri, 

We do not have a 5.9.3. environment. However, I checked with 5.9.2.4 and I was able to generate the report successfully. No error was seen in the evm.log