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 1510665

Summary: ERROR: insert or update on table "katello_subscription_facet_pools" violates foreign key constraint "katello_sub_facet_pools_sf_id_fk"
Product: Red Hat Satellite Reporter: Jan Hutař <jhutar>
Component: RegistrationAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Katello QA List <katello-qa-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, dgross, jhutar, pmoravec, shbharad
Target Milestone: UnspecifiedKeywords: 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-06-25 18:49:04 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
foreman-debug none

Description Jan Hutař 2017-11-07 23:30:09 UTC
Description of problem:
Noticed following error when registering or deleting 100 containers (acting as normal systems) concurrently. All registrations seems to be OK, I have not found any failed task.


Version-Release number of selected component (if applicable):
satellite-6.3.0-21.0.beta.el7sat.noarch (snap 24.0)


How reproducible:
Seen two of these messages twice in 3 attempts to register/delete 100 hosts concurrently


Steps to Reproduce:
1. Attempt to register 100 containers (acting as hosts) concurrently
2. Attempt to delete all these 100 profiles in one shot (content hosts -> select all -> remove hosts)


Actual results:
2017-11-07 17:55:06 EST ERROR:  insert or update on table "katello_subscription_facet_pools" violates foreign key constraint "katello_sub_facet_pools_sf_id_fk"
2017-11-07 17:55:06 EST DETAIL:  Key (subscription_facet_id)=(98) is not present in table "katello_subscription_facets".
2017-11-07 17:55:06 EST STATEMENT:  INSERT INTO "katello_subscription_facet_pools" ("pool_id", "subscription_facet_id") VALUES ($1, $2) RETURNING "id"
2017-11-07 17:55:29 EST ERROR:  insert or update on table "katello_subscription_facet_pools" violates foreign key constraint "katello_sub_facet_pools_sf_id_fk"
2017-11-07 17:55:29 EST DETAIL:  Key (subscription_facet_id)=(99) is not present in table "katello_subscription_facets".
2017-11-07 17:55:29 EST STATEMENT:  INSERT INTO "katello_subscription_facet_pools" ("pool_id", "subscription_facet_id") VALUES ($1, $2) RETURNING "id"


Expected results:
There should be no error in the PostgreSQL log


Additional info:
Satellite was VM with 8GB RAM, 4 CPUs. Containers used were running on same host as the guest. Host had 32GB RAM.

Did the registration with this ansible playbook:

    - hosts: all
      remote_user: root
      gather_facts: no
      serial: 20
      tasks:
        - name: "Make sure /etc/hosts is OK"
          shell: |
            grep sat630.example.com /etc/hosts || echo "192.168.122.88 sat630.example.com" >> /etc/hosts
        - name: "Rename /etc/rhsm-host and /etc/pki/entitlement-host"
          shell: |
            if [ -d /etc/rhsm-host ]; then mv /etc/rhsm-host{,.ORIG}; else true; fi
            if [ -d /etc/pki/entitlement-host ]; then mv /etc/pki/entitlement-host{,.ORIG}; else true; fi
        - name: "Cleanup"
          shell: |
            subscription-manager unregister
            subscription-manager clean
            yum --disablerepo='*' -y remove 'katello-ca-consumer-*'
          ###ignore_error: true
        - name: Increase the RHSM timeout
          lineinfile:
            dest: /usr/lib64/python2.7/site-packages/rhsm/config.py
            regexp: "^DEFAULT_SERVER_TIMEOUT"
            line: 'DEFAULT_SERVER_TIMEOUT = "380"'
            state: present
        - name: "Install certs"
          command: "rpm -ivh http://sat630.example.com/pub/katello-ca-consumer-latest.noarch.rpm"

    - hosts: all
      remote_user: root
      gather_facts: no
      tasks:
        - name: "Register"
          command: "subscription-manager register --org='Default_Organization' --activationkey 'ActivationKey'"

Comment 2 Jan Hutař 2017-11-07 23:36:24 UTC
Created attachment 1349159 [details]
foreman-debug

Comment 3 Brad Buckingham 2017-12-01 13:45:37 UTC
*** Bug 1514974 has been marked as a duplicate of this bug. ***

Comment 4 jcallaha 2017-12-15 18:28:31 UTC
Jan, Is this something new to 6.3 or can you also reproduce it in 6.2?

Comment 5 Jan Hutař 2017-12-25 20:06:17 UTC
(In reply to jcallaha from comment #4)
> Jan, Is this something new to 6.3 or can you also reproduce it in 6.2?

Hello. Sorry, I do not have similar 6.2 setup and I do not plan to create one, so I can not answer this :-/

Comment 7 Pavel Moravec 2018-06-25 08:00:49 UTC
Isnt this resolved by

https://bugzilla.redhat.com/show_bug.cgi?id=1563002

in Sat 6.3.2 ?

Comment 8 Brad Buckingham 2018-06-25 18:49:04 UTC
This does appear to be a duplicate of bug 1563002; therefore, closing.  If there is any concern, please feel free to re-open.  Thanks!

*** This bug has been marked as a duplicate of bug 1563002 ***

Comment 9 Jan Hutař 2018-06-25 19:31:29 UTC
Yes, it looks like that. Thank you!