Bug 1786114

Summary: Insight plugin doesn't understand host location.
Product: Red Hat Satellite Reporter: Parag Kamble <pakamble>
Component: RH Cloud - InsightsAssignee: Shimon Shtein <sshtein>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: high Docs Contact:
Priority: medium    
Version: 6.7.0CC: jyejare, mmccune
Target Milestone: 6.7.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-14 13:28:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Parag Kamble 2019-12-23 13:54:24 UTC
Description of problem:
Insight plugin doesn't understand host location. 

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

How reproducible: 
always

Steps to Reproduce:
1. Create Organization and Location at satellite.
2. register host under same org and location.
3. install insight client on all register host.
4. run any playbook from insight-> planner menu.



Actual results:

above mentioned step gets fail with following error message
   "Failed to create job. Ensure your systems are registered in forman.

Expected results:
 insight -> planner playbook should run without any error.

Additional info:
This is not regression.


    # hammer -u admin -p changeme location list
    ---|------------------|------------------|------------
    ID | TITLE            | NAME             | DESCRIPTION
    ---|------------------|------------------|------------
    2  | Default Location | Default Location |            
    4  | PUNE             | PUNE             |            
    ---|------------------|------------------|------------
     
    [root@dhcp-2-10 ~]# hammer -u admin -p changeme organization list
    ---|----------------------|----------------------|-------------|---------------------
    ID | TITLE                | NAME                 | DESCRIPTION | LABEL              
    ---|----------------------|----------------------|-------------|---------------------
    1  | Default Organization | Default Organization |             | Default_Organization
    3  | REDHAT               | REDHAT               |             | REDHAT              
    ---|----------------------|----------------------|-------------|---------------------
     
    [root@dhcp-2-10 ~]# hammer -u admin -p changeme host list --organization-id 3 --location-id 4
    ---|------|------------------|------------|----|-----|---------------|--------------|----------------------
    ID | NAME | OPERATING SYSTEM | HOST GROUP | IP | MAC | GLOBAL STATUS | CONTENT VIEW | LIFECYCLE ENVIRONMENT
    ---|------|------------------|------------|----|-----|---------------|--------------|----------------------
     
    # hammer -u admin -p changeme host list --organization-id 3
    ---|-----------------------------------|------------------|------------|-----------|-------------------|---------------|---------------------------|----------------------
    ID | NAME                              | OPERATING SYSTEM | HOST GROUP | IP        | MAC               | GLOBAL STATUS | CONTENT VIEW              | LIFECYCLE ENVIRONMENT
    ---|-----------------------------------|------------------|------------|-----------|-------------------|---------------|---------------------------|----------------------
    4  | XYZ | RedHat 7.7       |            | XXX.XXX.XXX.XXX | XX:XX:XX:XX:XX:XX | Error         | Default Organization View | Library              
    3  | XYZ | RedHat 7.7       |            | XXX.XXX.XXX.XXX | XX:XX:XX:XX:XX:XX | Error         | Default Organization View | Library              
    ---|-----------------------------------|------------------|------------|-----------|-------------------|---------------|---------------------------|----------------------

Comment 5 Marek Hulan 2020-01-14 16:11:48 UTC
This is a remote execution / organizations and locations bug rather than insights plugin bug. IIRC the user needs to be assigned to all locations of hosts the remediation runs on.

Comment 8 Mike McCune 2020-03-06 19:30:28 UTC
Can we get a re-test of this? I tried this on the latest snap 15 and it ran without error.

Comment 10 jcallaha 2020-03-13 18:26:31 UTC
Unable to reproduce in Satellite 6.7 Snap 15, when using a user assigned to the same organization/location as the host.

Comment 12 errata-xmlrpc 2020-04-14 13:28:12 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-2020:1454