Bug 1471732

Summary: unable to export reports with "Couldn't find MiqReportResult with ID" errors
Product: Red Hat CloudForms Management Engine Reporter: Felix Dewaleyne <fdewaley>
Component: UI - OPSAssignee: Martin Povolny <mpovolny>
Status: CLOSED DUPLICATE QA Contact: Niyaz Akhtar Ansari <nansari>
Severity: high Docs Contact:
Priority: high    
Version: 5.7.0CC: cpelland, dajohnso, fdewaley, gaetan.quentin, hkataria, jhardy, jocarter, mpovolny, nansari, obarenbo, simaishi, slukasik, yrudman
Target Milestone: GA   
Target Release: 5.7.4   
Hardware: All   
OS: All   
Whiteboard: report
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-15 15:16:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:

Description Felix Dewaleyne 2017-07-17 11:03:05 UTC
Description of problem:
unable to export reports with "Couldn't find MiqReportResult with ID" errors

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

How reproducible:
all the time

Steps to Reproduce:
1. access cloud intel -> reports
2.  click on export button ( csv or pdf)
3. 

Actual results:
[----] I, [2017-07-13T09:51:31.967656 #2975:88aa40]  INFO -- : Completed 200 OK in 53ms (Views: 0.8ms | ActiveRecord: 15.6ms)
[----] I, [2017-07-13T09:51:31.996675 #2975:88aa40]  INFO -- : Started GET "/report/send_report_data" for 127.0.0.1 at 2017-07-13 09:51:31 +0200
[----] I, [2017-07-13T09:51:31.998019 #2975:88aa40]  INFO -- : Processing by ReportController#send_report_data as HTML
[----] F, [2017-07-13T09:51:32.026871 #2975:88aa40] FATAL -- : Error caught: [ActiveRecord::RecordNotFound] Couldn't find MiqReportResult with 'id'=1000000002345 [WHERE ("miq_report_results"."miq_group_id" IS NOT NULL)]
/opt/rh/cfme-gemset/gems/activerecord-5.0.3/lib/active_record/relation/finder_methods.rb:353:in `raise_record_not_found_exception!'
/opt/rh/cfme-gemset/gems/activerecord-5.0.3/lib/active_record/relation/finder_methods.rb:479:in `find_one'
/opt/rh/cfme-gemset/gems/activerecord-5.0.3/lib/active_record/relation/finder_methods.rb:458:in `find_with_ids'
/opt/rh/cfme-gemset/gems/activerecord-5.0.3/lib/active_record/relation/finder_methods.rb:66:in `find'
/var/www/miq/vmdb/app/controllers/application_controller/report_downloads.rb:91:in `send_report_data'
/opt/rh/cfme-gemset/gems/actionpack-5.0.3/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.3/lib/abstract_controller/base.rb:188:in `process_action'


Expected results:
able to download the report in format wanted

Additional info:
this happens for all reports since the last version

Comment 2 Gaetan QUENTIN 2017-07-20 14:08:19 UTC
Could you confirm this bug we reported in support case 01889539 and give us a date for a fix?

Regards

Gaétan QUENTIN

Comment 4 Šimon Lukašík 2017-07-26 08:52:26 UTC
More about this issue: Previously, ManageIQ genenareted report_results without any information about who can view the results. This was considered vulnerability in the product. The traceback you are seeing is caused by MiqReportResult with 1000000002345 does not have miq_group_id set.

There was a fix for issue with the similar effects in https://github.com/ManageIQ/manageiq/pull/15389 it went life with bug 1462353. Is it possible that this issue was already fixed by bug 1462353 and the content is just not regenerated? 

In any case, this may as well be duplicate of a bug 1471014.

Comment 5 Felix Dewaleyne 2017-08-14 10:46:58 UTC
this does look like it could be the same but the other bug doesn't have a trace so I can't say.

they are already running cfme 5.7.3.2 - so they have the fix of bz#1462353 

they are asking for us to prioritise the issue

Comment 6 Felix Dewaleyne 2017-08-14 11:38:58 UTC
additional usage info :

they are using another user to download reports, but it is in the same group/Role than admin: EvmGroup-super_administrator/EvmRole-super_administrator

I advised to create a new group & role as, as per bz#1471014 that should help work around the issue.

Comment 8 Felix Dewaleyne 2017-08-14 12:00:43 UTC
update : using another group & user to generate & download reports does not help (same error) - this does not look entirely like bz#1471014 or there is more to that issue than what was discovered in that bz.

Comment 11 Felix Dewaleyne 2017-08-14 12:36:00 UTC
users with a read only role also cannot load the definition of the report

Comment 13 Yuri Rudman 2017-08-15 15:16:57 UTC

*** This bug has been marked as a duplicate of bug 1471014 ***