Bug #25277
closedListing report fails after adding default organization/location
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1632899
Description of problem: After adding default organization/location, Listing reports fails with error "Association not found for organization/location"
Version-Release number of selected component (if applicable): Satellite 6.4
satellite-6.4.0-14.el7sat.noarch
How reproducible: Always
Steps to Reproduce:
[root@satellite64 ~]# hammer organization list
---|----------------------|----------------------|-------------|----------------------
ID | TITLE | NAME | DESCRIPTION | LABEL
---|----------------------|----------------------|-------------|----------------------
1 | Default Organization | Default Organization | | Default_Organization
---|----------------------|----------------------|-------------|----------------------
[root@satellite64 ~]# hammer defaults list
----------------|------
PARAMETER | VALUE
----------------|------
organization_id | 1
----------------|------
[root@satellite64 ~]# hammer report list
Association not found for organization
Actual results: Failed to list report
Expected results: Should list reports
Additional info:
This is working in satellite 6.3
Applied the patch https://github.com/theforeman/foreman/pull/6075 but still failing
Production log:
2018-09-25T22:47:20 [W|app|823fe] Action failed
RuntimeError: Association not found for location
/usr/share/foreman/app/controllers/api/base_controller.rb:79:in `parent_scope'
/usr/share/foreman/app/controllers/api/base_controller.rb:64:in `resource_scope'
/usr/share/foreman/app/controllers/api/v2/reports_controller.rb:74:in `resource_scope'
/usr/share/foreman/app/controllers/api/base_controller.rb:104:in `resource_scope_for_index'
/usr/share/foreman/app/controllers/api/v2/reports_controller.rb:16:in `index'