Bug 1634728 - Discovered host assign organization or assign location failure
Summary: Discovered host assign organization or assign location failure
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Discovery Plugin
Version: 6.4
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: Unspecified
Assignee: Lukas Zapletal
QA Contact: Jitendra Yejare
URL: https://projects.theforeman.org/issue...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-01 12:55 UTC by Djebran Lezzoum
Modified: 2020-07-10 15:23 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-01 13:30:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 25095 0 High New Discovered host assign organization or assign location failure 2020-10-05 07:34:59 UTC
Red Hat Bugzilla 1593553 0 unspecified CLOSED Error while assigning location to a number of hosts that is larger than per_page setting 2021-09-09 14:40:47 UTC

Internal Links: 1593553

Description Djebran Lezzoum 2018-10-01 12:55:08 UTC
Created attachment 1489034 [details]
foreman-debug output

Description of problem:
An Error "Oops, we're sorry but something went wrong" when trying to assign organization or Location for a discovered host

Version-Release number of selected component (if applicable):
* candlepin-2.4.8-1.el7.noarch
* candlepin-selinux-2.4.8-1.el7.noarch
* foreman-1.18.0.36-1.el7sat.noarch
* foreman-bootloaders-redhat-201801241201-3.el7sat.noarch
* foreman-bootloaders-redhat-tftpboot-201801241201-3.el7sat.noarch
* foreman-cli-1.18.0.36-1.el7sat.noarch
* foreman-compute-1.18.0.36-1.el7sat.noarch
* foreman-debug-1.18.0.36-1.el7sat.noarch
* foreman-discovery-image-3.5.3-1.el7sat.noarch
* foreman-ec2-1.18.0.36-1.el7sat.noarch
* foreman-gce-1.18.0.36-1.el7sat.noarch
* foreman-installer-1.18.0.1-1.el7sat.noarch
* foreman-installer-katello-3.7.0.9-1.el7sat.noarch
* foreman-libvirt-1.18.0.36-1.el7sat.noarch
* foreman-openstack-1.18.0.36-1.el7sat.noarch
* foreman-ovirt-1.18.0.36-1.el7sat.noarch
* foreman-postgresql-1.18.0.36-1.el7sat.noarch
* foreman-proxy-1.18.0.1-1.el7sat.noarch
* foreman-proxy-content-3.7.0-8.el7sat.noarch
* foreman-rackspace-1.18.0.36-1.el7sat.noarch
* foreman-selinux-1.18.0.1-1.el7sat.noarch
* foreman-vmware-1.18.0.36-1.el7sat.noarch
* katello-3.7.0-8.el7sat.noarch
* katello-ca-consumer-sat-r220-02.lab.eng.rdu2.redhat.com-1.0-6.noarch
* katello-certs-tools-2.4.0-2.el7sat.noarch
* katello-client-bootstrap-1.6.0-1.el7sat.noarch
* katello-common-3.7.0-8.el7sat.noarch
* katello-debug-3.7.0-8.el7sat.noarch
* katello-default-ca-1.0-1.noarch
* katello-installer-base-3.7.0.9-1.el7sat.noarch
* katello-selinux-3.0.3-2.el7sat.noarch
* katello-server-ca-1.0-1.noarch
* katello-service-3.7.0-8.el7sat.noarch
* openldap-2.4.44-15.el7_5.x86_64
* pulp-client-1.0-1.noarch
* pulp-docker-plugins-3.1.4.1-1.el7sat.noarch
* pulp-katello-1.0.2-5.el7sat.noarch
* pulp-maintenance-2.16.4.1-1.el7sat.noarch
* pulp-ostree-plugins-1.3.0-1.el7sat.noarch
* pulp-puppet-plugins-2.16.4-3.el7sat.noarch
* pulp-puppet-tools-2.16.4-3.el7sat.noarch
* pulp-rpm-plugins-2.16.4.1-5.el7sat.noarch
* pulp-selinux-2.16.4.1-1.el7sat.noarch
* pulp-server-2.16.4.1-1.el7sat.noarch
* python-ldap-2.4.15-2.el7.x86_64
* tfm-rubygem-ldap_fluff-0.4.7-2.el7sat.noarch
* tfm-rubygem-net-ldap-0.15.0-2.el7sat.noarch


How reproducible:
Always

Steps to Reproduce:
1. Goto Hosts > Discovered hosts
2. Select one discovered host
3. Apply action Assign Organization (or Assign Location)
4. In the dialog box: select the target organization (or Location in case of Assign Location)
5. Press submit

Actual results:
an error Message is displayed:
Oops, we're sorry but something went wrong PG::AmbiguousColumn: ERROR: column reference "id" is ambiguous LINE 1: ...zation_id" = 1 AND "hosts"."location_id" = 2 AND (id IN ('10... ^ : SELECT "hosts"."id" FROM "hosts" LEFT OUTER JOIN "models" ON "models"."id" = "hosts"."model_id" LEFT OUTER JOIN "fact_values" ON "fact_values"."host_id" = "hosts"."id" LEFT OUTER JOIN "nics" ON "nics"."host_id" = "hosts"."id" LEFT OUTER JOIN "taxonomies" ON "taxonomies"."id" = "hosts"."location_id" AND "taxonomies"."type" IN ('Location') LEFT OUTER JOIN "taxonomies" "organizations_hosts" ON "organizations_hosts"."id" = "hosts"."organization_id" AND "organizations_hosts"."type" IN ('Organization') WHERE "hosts"."type" IN ('Host::Discovered') AND "hosts"."organization_id" = 1 AND "hosts"."location_id" = 2 AND (id IN ('10') or name IN (NULL)) ORDER BY hosts.created_at DESC


Expected results:
The select Organization is assigned to the discovered host

Additional info:
for Assign location the error message is:
Oops, we're sorry but something went wrong PG::AmbiguousColumn: ERROR: column reference "id" is ambiguous LINE 1: ...zation_id" = 1 AND "hosts"."location_id" = 2 AND (id IN ('10... ^ : SELECT "hosts"."id" FROM "hosts" LEFT OUTER JOIN "models" ON "models"."id" = "hosts"."model_id" LEFT OUTER JOIN "fact_values" ON "fact_values"."host_id" = "hosts"."id" LEFT OUTER JOIN "nics" ON "nics"."host_id" = "hosts"."id" LEFT OUTER JOIN "taxonomies" ON "taxonomies"."id" = "hosts"."location_id" AND "taxonomies"."type" IN ('Location') LEFT OUTER JOIN "taxonomies" "organizations_hosts" ON "organizations_hosts"."id" = "hosts"."organization_id" AND "organizations_hosts"."type" IN ('Organization') WHERE "hosts"."type" IN ('Host::Discovered') AND "hosts"."organization_id" = 1 AND "hosts"."location_id" = 2 AND (id IN ('10') or name IN (NULL)) ORDER BY hosts.created_at DESC

Comment 5 Lukas Zapletal 2018-10-02 07:09:58 UTC
Workaround: Move taxonomy during provisioning in the quick form.

Comment 6 Lukas Zapletal 2018-10-02 07:36:07 UTC
Unable to reproduce with Foreman Core develop. Unable to reproduce on older snap:

[root@next ~]# rpm -qa foreman katello
foreman-1.18.0.14-1.el7sat.noarch
katello-3.7.0-5.el7sat.noarch

Installing the latest snap.

Comment 7 Lukas Zapletal 2018-10-02 14:17:12 UTC
Regression created by https://bugzilla.redhat.com/show_bug.cgi?id=1593553 - see upstream tickets for more discussion.

Comment 8 Bryan Kearney 2020-05-01 13:30:57 UTC
Satellite 6.4 is now End of Life. These bus will not be fixed on the 6.4 stream. Users of Satellite should upgrade to the latest version of Satellite to get access to the most current set of bugfixes and feature improvements.

Comment 9 Jitendra Yejare 2020-07-10 15:23:15 UTC
qe-test-coverage + : Covered from Ui test `test_positive_update_default_taxonomies` discovery test.


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