Bug 1591939 - Saved Report "2018-04-09 11:18:31 +03" not found, Schedule may have failed
Summary: Saved Report "2018-04-09 11:18:31 +03" not found, Schedule may have failed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Reporting
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.9.3
Assignee: Libor Pichler
QA Contact: Tasos Papaioannou
URL:
Whiteboard:
Depends On: 1566452
Blocks: 1561041
TreeView+ depends on / blocked
 
Reported: 2018-06-15 19:55 UTC by Satoe Imaishi
Modified: 2022-07-09 09:54 UTC (History)
12 users (show)

Fixed In Version: 5.9.3.3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1566452
Environment:
Last Closed: 2018-07-12 13:16:26 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:2184 0 None None None 2018-07-12 13:17:04 UTC

Comment 2 CFME Bot 2018-06-15 20:36:27 UTC
New commits detected on ManageIQ/manageiq/gaprindashvili:

https://github.com/ManageIQ/manageiq/commit/9310fadb24285de5dbd986f6fc0a634e64cd260d
commit 9310fadb24285de5dbd986f6fc0a634e64cd260d
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Wed Jun 13 11:47:21 2018 -0400
Commit:     Gregg Tanzillo <gtanzill>
CommitDate: Wed Jun 13 11:47:21 2018 -0400

    Merge pull request #17538 from lpichler/replace_remove_duplicate_timestamp_by_sql_version

    Replace remove duplicate timestamp by sql version for chargeback
    (cherry picked from commit 887cc81051bb528784dd7599408270ea9b66894b)

    https://bugzilla.redhat.com/show_bug.cgi?id=1591939

 app/models/chargeback/consumption_history.rb | 33 +-
 app/models/chargeback/report_options.rb | 4 -
 2 files changed, 30 insertions(+), 7 deletions(-)


https://github.com/ManageIQ/manageiq/commit/d3719f36ec51e530e19c169449861160601b0344
commit d3719f36ec51e530e19c169449861160601b0344
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Thu Jun 14 09:22:45 2018 -0400
Commit:     Gregg Tanzillo <gtanzill>
CommitDate: Thu Jun 14 09:22:45 2018 -0400

    Merge pull request #17552 from lpichler/get_rid_off_big_query

    Get rid off query "All in One" in Chargeback
    (cherry picked from commit 019d2ad8bffc6afdcfc0d468ca7396a34ad92604)

    https://bugzilla.redhat.com/show_bug.cgi?id=1591939

 app/models/chargeback/consumption_history.rb | 13 +-
 spec/models/chargeback_vm_spec.rb | 15 +-
 2 files changed, 10 insertions(+), 18 deletions(-)


https://github.com/ManageIQ/manageiq/commit/d24aa428a372d367b1cc94c7f613362d928f99ab
commit d24aa428a372d367b1cc94c7f613362d928f99ab
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Thu Jun 14 17:23:51 2018 -0400
Commit:     Gregg Tanzillo <gtanzill>
CommitDate: Thu Jun 14 17:23:51 2018 -0400

    Merge pull request #17558 from lpichler/refactor_tag_tag_list_with_prefix

    Refactor tag_list_with_prefix in Metric::ChargebackHelper
    (cherry picked from commit 9c48f0a8b1cd2cdc18a14269ed9e1c708b49c95e)

    https://bugzilla.redhat.com/show_bug.cgi?id=1591939

 app/models/metric/chargeback_helper.rb | 31 +-
 spec/models/metric_rollup/chargeback_helper_spec.rb | 32 +-
 2 files changed, 51 insertions(+), 12 deletions(-)


https://github.com/ManageIQ/manageiq/commit/4f909bc4a0c478bf4a08f4b9798b944f85ff65a8
commit 4f909bc4a0c478bf4a08f4b9798b944f85ff65a8
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Fri Jun 15 13:54:53 2018 -0400
Commit:     Gregg Tanzillo <gtanzill>
CommitDate: Fri Jun 15 13:54:53 2018 -0400

    Merge pull request #17560 from lpichler/use_pluck_metric_rollup_query_in_chargeback

    Use pluck on  metric rollup query in chargeback
    (cherry picked from commit 8180f01d945045b305f722aaaca6240aacd26961)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1591939

 app/models/chargeable_field.rb | 11 +-
 app/models/chargeback/consumption_history.rb | 2 +-
 app/models/chargeback/consumption_with_rollups.rb | 90 +-
 app/models/metric/chargeback_helper.rb | 39 -
 app/models/metric_rollup.rb | 6 -
 spec/models/chargeable_field_spec.rb | 26 +
 spec/models/chargeback/consumption_with_rollups_spec.rb | 43 +-
 spec/models/chargeback_vm_spec.rb | 34 +-
 spec/models/metric_rollup/chargeback_helper_spec.rb | 29 -
 9 files changed, 176 insertions(+), 104 deletions(-)

Comment 3 Tasos Papaioannou 2018-06-20 15:24:55 UTC
Failed on 5.9.3.2. Chargeback report generation errors out, with traceback in evm.log:

****
[----] I, [2018-06-20T11:01:32.725394 #11998:1267108]  INFO -- : MIQ(MiqTask#update_status) Task: [2] [Active] [Ok] [Generating report]
[----] I, [2018-06-20T11:01:32.864730 #11998:1267108]  INFO -- : MIQ(ChargebackVm.build_results_for_report_chargeback) Calculating chargeback costs...
[----] I, [2018-06-20T11:01:34.970963 #11998:1267108]  INFO -- : MIQ(Chargeback::ConsumptionHistory.for_report) Found 10 records for time range [2018-06-11 00:00:00 UTC, 2018-06-17 23:59:59 UTC]
[----] E, [2018-06-20T11:01:39.328139 #11998:1267108] ERROR -- : [TypeError]: no implicit conversion from nil to integer  Method:[block in method_missing]
[----] E, [2018-06-20T11:01:39.328728 #11998:1267108] ERROR -- : /var/www/miq/vmdb/app/models/chargeback/consumption_with_rollups.rb:157:in `[]'
/var/www/miq/vmdb/app/models/chargeback/consumption_with_rollups.rb:157:in `block in values'
/var/www/miq/vmdb/app/models/chargeback/consumption_with_rollups.rb:157:in `collect'
/var/www/miq/vmdb/app/models/chargeback/consumption_with_rollups.rb:157:in `values'
/var/www/miq/vmdb/app/models/chargeback/consumption_with_rollups.rb:108:in `none?'
/var/www/miq/vmdb/app/models/chargeable_field.rb:51:in `measure'
/var/www/miq/vmdb/app/models/chargeback_rate_detail.rb:227:in `metric_and_cost_by'
/var/www/miq/vmdb/app/models/chargeback_rate_detail.rb:90:in `charge'
/var/www/miq/vmdb/app/models/chargeback.rb:141:in `block (2 levels) in calculate_costs'
/var/www/miq/vmdb/app/models/chargeback.rb:140:in `each'
/var/www/miq/vmdb/app/models/chargeback.rb:140:in `block in calculate_costs'
/var/www/miq/vmdb/app/models/chargeback.rb:139:in `each'
/var/www/miq/vmdb/app/models/chargeback.rb:139:in `calculate_costs'
/var/www/miq/vmdb/app/models/chargeback.rb:33:in `block in build_results_for_report_chargeback'
/var/www/miq/vmdb/app/models/chargeback/consumption_history.rb:30:in `block (2 levels) in for_report'
/var/www/miq/vmdb/app/models/chargeback/consumption_history.rb:27:in `each_value'
/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:9:in `each'
/var/www/miq/vmdb/app/models/chargeback/consumption_history.rb:9:in `each_cons'
/var/www/miq/vmdb/app/models/chargeback/consumption_history.rb:9:in `for_report'
/var/www/miq/vmdb/app/models/chargeback.rb:20:in `build_results_for_report_chargeback'
/var/www/miq/vmdb/app/models/chargeback_vm.rb:79:in `build_results_for_report_ChargebackVm'
/var/www/miq/vmdb/app/models/miq_report/generator.rb:199:in `_generate_table'
/var/www/miq/vmdb/app/models/miq_report/generator.rb:173:in `block in generate_table'
/var/www/miq/vmdb/app/models/user.rb:254:in `with_user'
/var/www/miq/vmdb/app/models/miq_report/generator.rb:173:in `generate_table'
/var/www/miq/vmdb/app/models/miq_report/generator/async.rb:94:in `_async_generate_table'
/var/www/miq/vmdb/app/models/miq_queue.rb:449:in `block in dispatch_method'
[...]
****

The TypeError occurs in code added in commit 218b65f17f007e483075aa62fa64df28c771193d:

app/models/chargeback/consumption_with_rollups.rb
@@ -112,7 +112,9 @@ class Chargeback
 
     def values(metric, sub_metric = nil)
       @values ||= {}
-      @values["#{metric}#{sub_metric}"] ||= sub_metric ? sub_metric_rollups(sub_metric) : @rollups.collect(&metric.to_sym).compact
+      @values["#{metric}#{sub_metric}"] ||= begin
+        sub_metric ? sub_metric_rollups(sub_metric) : @rollup_array.collect { |x| x[ChargeableField.col_index(metric)] }.compact
+      end

Comment 5 Gregg Tanzillo 2018-06-21 12:34:13 UTC
Would it be possible to get the DB from the appliance where this failed? Or, at a minimum, access to the appliance itself so that we can investigate?

Thanks!

Comment 8 Satoe Imaishi 2018-06-26 16:18:11 UTC
https://github.com/ManageIQ/manageiq/pull/17639

Comment 9 Tasos Papaioannou 2018-06-29 19:15:40 UTC
Verified on 5.9.3.3.

Comment 11 errata-xmlrpc 2018-07-12 13:16:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:2184


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