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 1494688

Summary: Duplicate entries in taxable_taxonomies table
Product: Red Hat Satellite Reporter: Jonathon Turel <jturel>
Component: Organizations and LocationsAssignee: Tomer Brisker <tbrisker>
Status: CLOSED ERRATA QA Contact: Ales Dujicek <adujicek>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.11CC: adujicek, akarsale, cduryee, mhulan, tbrisker, tstrachota
Target Milestone: 6.4.0Keywords: FieldEngineering, PrioBumpField, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 19:00:56 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 Jonathon Turel 2017-09-22 20:20:05 UTC
Description of problem:

It is possible for duplicate entries to be placed in taxable_taxonomies table.

Example:

  id   | taxonomy_id | taxable_id | taxable_type |         created_at         |         updated_at         
-------+-------------+------------+--------------+----------------------------+----------------------------
 17766 |          15 |         76 | Subnet       | 2017-08-10 09:05:41.651359 | 2017-08-10 09:05:41.651359
 17767 |          15 |         76 | Subnet       | 2017-08-10 09:05:41.687729 | 2017-08-10 09:05:41.687729

Notice the consecutive ids and virtually identical created_at timestamps


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


How reproducible: No known reproducer - but seems like the point in time which the row is created is a good starting point. Possible that a unique constraint could be placed around (taxonomy_id, taxable_id).


Steps to Reproduce:
1.
2.
3.

Actual results: Duplicate entries as shown in the example

Expected results:

select taxable_type, taxable_id, taxonomy_id, COUNT(*) as Duplicates from taxable_taxonomies GROUP BY taxable_type, taxable_id,taxonomy_id HAVING COUNT(*) > 1;

This query should not ever return results.


Additional info: This manifests via APIs which deal with taxonomies such as Locations

curl -X GET -k -u admin https://localhost/api/v2/subnets/:subnet_id/locations"

Comment 3 Tomer Brisker 2017-11-26 12:59:36 UTC
Created redmine issue http://projects.theforeman.org/issues/21766 from this bug

Comment 4 Satellite Program 2017-11-26 13:22:17 UTC
Upstream bug assigned to tbrisker

Comment 5 Satellite Program 2017-11-26 13:22:22 UTC
Upstream bug assigned to tbrisker

Comment 6 Satellite Program 2017-11-27 15:19:33 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/21766 has been resolved.

Comment 8 Bryan Kearney 2018-10-16 19:00:56 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