Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1597042

Summary: can not add location to the organization: Resource organization not found by id '1'
Product: Red Hat Satellite Reporter: Jan Hutař <jhutar>
Component: Organizations and LocationsAssignee: Ondřej Pražák <oprazak>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: akarsale, apatel, dhlavacd, kgaikwad, mbacovsk, mhulan, mshira, nkathole, pcreech, rabajaj, sjagtap, tstrachota
Target Milestone: 6.4.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.18.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 19:02:11 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:
Attachments:
Description Flags
hammer -d -u admin -p changeme organization add-location --id 1 --location-id 2
none
foreman-debug none

Description Jan Hutař 2018-07-01 20:34:16 UTC
Description of problem:
I can not add location to the organization: Resource organization not found by id '1'


Version-Release number of selected component (if applicable):
satellite-6.4.0-9.beta.el7sat.noarch
tfm-rubygem-hammer_cli-0.13.0-1.el7sat.noarch
tfm-rubygem-hammer_cli_csv-2.3.1-2.el7sat.noarch
tfm-rubygem-hammer_cli_foreman-0.13.0-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_admin-0.0.8-2.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3.3-3.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_discovery-1.0.0-2.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.6-3.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_openscap-0.1.6-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_remote_execution-0.0.6-2.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_tasks-0.0.12-2.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_templates-0.1.0-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_virt_who_configure-0.0.3-2.el7sat.noarch
tfm-rubygem-hammer_cli_katello-0.13.1-1.el7sat.noarch


How reproducible:
always


Steps to Reproduce:
1. # hammer -d -u admin -p changeme organization add-location --id 1 --location-id 2


Actual results:
# hammer -u admin -p changeme organization add-location --id 1 --location-id 2
Could not associate the location:
  Resource organization not found by id '1'


Expected results:
Should work (maybe I'm just missing something, but in that case error message seems to be miss-leading)


Additional info:
[root@sat640snap9 ~]# hammer -u admin -p changeme organization list
---|----------------------|----------------------|-------------|----------------------|------------
ID | TITLE                | NAME                 | DESCRIPTION | LABEL                | DESCRIPTION
---|----------------------|----------------------|-------------|----------------------|------------
1  | Default Organization | Default Organization |             | Default_Organization |            
---|----------------------|----------------------|-------------|----------------------|------------
[root@sat640snap9 ~]# hammer -u admin -p changeme location list
---|------------------|------------------|------------
ID | TITLE            | NAME             | DESCRIPTION
---|------------------|------------------|------------
22 | 55p2F4T3bX       | 55p2F4T3bX       |            
18 | 7mDP3XxekZ       | 7mDP3XxekZ       |            
39 | BLM6IJ107M       | BLM6IJ107M       |            
31 | crWOZQuMyr       | crWOZQuMyr       |            
2  | Default Location | Default Location |            
42 | LlUgBw5NXg       | LlUgBw5NXg       |            
28 | m4xa3MfGMz       | m4xa3MfGMz       |            
34 | uXImQQja0p       | uXImQQja0p       |            
26 | VyzvZeERfo       | VyzvZeERfo       |            
---|------------------|------------------|------------

Comment 1 Jan Hutař 2018-07-01 20:34:57 UTC
Created attachment 1455798 [details]
hammer -d -u admin -p changeme organization add-location --id 1 --location-id 2

Comment 2 Jan Hutař 2018-07-01 20:36:31 UTC
This was not the case in 6.3 => setting keyword "Regression"

Comment 3 Jan Hutař 2018-07-01 20:37:22 UTC
Created attachment 1455799 [details]
foreman-debug

Comment 4 Jan Hutař 2018-07-01 20:41:23 UTC
I'm getting same error when I try it vice verse:

# hammer -u admin -p changeme location add-organization --id 2 --organization-id 1
Could not associate the organization:
  Resource location not found by id '2'

Comment 7 Marek Hulan 2018-07-10 06:55:50 UTC
*** Bug 1597501 has been marked as a duplicate of this bug. ***

Comment 8 Daniel Lobato Garcia 2018-07-10 14:32:25 UTC
Connecting redmine issue https://projects.theforeman.org/issues/23918 from this bug

Comment 9 Satellite Program 2018-07-10 16:11:09 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/23918 has been resolved.

Comment 10 Nikhil Kathole 2018-07-23 09:58:27 UTC
VERIFIED

Version tested:
Satellite 6.4 snap 13

# hammer -u admin -p changeme location add-organization --id 2 --organization-id 3
The organization has been associated.

# hammer -u admin -p changeme organization add-location --id 3 --location-id 2
The location has been associated.

Comment 11 Bryan Kearney 2018-10-16 19:02:11 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:2927