Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1510665 - ERROR: insert or update on table "katello_subscription_facet_pools" violates foreign key constraint "katello_sub_facet_pools_sf_id_fk"
Summary: ERROR: insert or update on table "katello_subscription_facet_pools" violates...
Keywords:
Status: CLOSED DUPLICATE of bug 1563002
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Registration
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
low vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
: 1514974 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-07 23:30 UTC by Jan Hutař
Modified: 2018-06-25 19:31 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-25 18:49:04 UTC


Attachments (Terms of Use)
foreman-debug (deleted)
2017-11-07 23:36 UTC, Jan Hutař
no flags Details

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!


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