Bug 1632899 - Listing report fails after adding default organization/location
Summary: Listing report fails after adding default organization/location
Status: POST
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Organizations and Locations   
(Show other bugs)
Version: 6.4
Hardware: All
OS: All
unspecified
medium vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Keywords: Regression, Triaged
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-25 19:12 UTC by Ranjan Kumar
Modified: 2019-04-16 03:15 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 25277 None None None 2018-10-23 07:04 UTC
Red Hat Bugzilla 1631379 None POST Listing puppet classes fails after adding default organization/location 2019-04-16 12:36 UTC
Red Hat Knowledge Base (Solution) 3955681 None None None 2019-03-03 14:38 UTC

Internal Trackers: 1631379

Description Ranjan Kumar 2018-09-25 19:12:40 UTC
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'

Comment 3 Marek Hulan 2018-10-23 07:04:20 UTC
Created redmine issue https://projects.theforeman.org/issues/25277 from this bug

Comment 4 pm-sat@redhat.com 2018-12-11 09:10:50 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25277 has been resolved.

Comment 5 Lucas Crownover 2019-04-09 21:07:52 UTC
Bug is not restricted to having a default organization.

Bug occurs when trying to filter job-invocations by organization.


[root@is-rhnsrv-p1 ~]# hammer defaults list
----------|------
PARAMETER | VALUE
----------|------

[root@is-rhnsrv-p1 ~]# hammer job-invocation list --organization IS
Association not found for organization



Log (truncated to single error):

[root@is-rhnsrv-p1 ~]# cat .hammer/log/hammer.log
[ERROR 2019-04-09T14:04:56 API] 500 Internal Server Error
[ERROR 2019-04-09T14:04:56 Exception] Association not found for organization
[ERROR 2019-04-09T14:04:56 Exception]

RestClient::InternalServerError (500 Internal Server Error):
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:223:in `exception_with_response'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:103:in `return!'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:353:in `block in rest_client_call_block'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:807:in `process_result'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:725:in `block in transmit'
    /opt/rh/rh-ruby24/root/usr/share/ruby/net/http.rb:877:in `start'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:715:in `transmit'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:145:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:52:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/resource.rb:51:in `get'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:327:in `call_client'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:240:in `http_call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:190:in `call_action'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:185:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/resource.rb:21:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/apipie/command.rb:51:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.13.2.3/lib/hammer_cli_foreman/commands.rb:168:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.13.2.3/lib/hammer_cli_foreman/commands.rb:224:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.13.2.3/lib/hammer_cli_foreman/commands.rb:259:in `retrieve_all'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.13.2.3/lib/hammer_cli_foreman/commands.rb:243:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/bin/hammer:143:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'


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