RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 1594141 - Replication races in DogtagInstance.setup_admin
Summary: Replication races in DogtagInstance.setup_admin
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa
Version: 7.4
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: IPA Maintainers
QA Contact: Michal Reznik
URL:
Whiteboard:
Depends On:
Blocks: 1623676
TreeView+ depends on / blocked
 
Reported: 2018-06-22 08:49 UTC by Petr Vobornik
Modified: 2021-09-09 14:42 UTC (History)
9 users (show)

Fixed In Version: ipa-4.6.4-7.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1623676 (view as bug list)
Environment:
Last Closed: 2018-10-30 10:58:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3187 0 None None None 2018-10-30 10:59:43 UTC

Description Petr Vobornik 2018-06-22 08:49:04 UTC
Cloned from upstream: https://pagure.io/freeipa/issue/7593

``DogtagInstance.setup_admin`` and related methods have multiple LDAP replication race conditions. The bugs can cause parallel ``ipa-replica-install`` to fail. The issue typically manifests itself as:

``com.netscape.certsrv.base.PKIException: Failed to obtain installation token from security domain: com.netscape.certsrv.base.UnauthorizedException: User admin-replica1.ipa.example is not a member of Enterprise CA Administrators group.``

## _add_admin_to_group

The ``_add_admin_to_group`` method https://pagure.io/freeipa/blob/84ae625fe2c3786f7c5430f23a55c171ff54e110/f/ipaserver/install/dogtaginstance.py#_397-407 uses an LDAP search + ``MOD_REPLACE`` to add the host admin to the admin group. This is subject to race conditions. In case an other thread, process, or replica modifies the group between read and mod, the previous modification is lost. The method must use ``MOD_ADD`` to add the user to the group.

## setup_admin

The ``setup_admin`` waits until the new admin user has been replicated to the replication source. But that is not sufficient. Since the admin is first created and then appended to the groups, the method must wait until the group membership addition have been replicated, too.

https://pagure.io/freeipa/blob/84ae625fe2c3786f7c5430f23a55c171ff54e110/f/ipaserver/install/dogtaginstance.py#_439-444

Comment 2 Petr Vobornik 2018-06-22 08:49:16 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/7593

Comment 3 Petr Vobornik 2018-06-22 08:49:51 UTC
https://github.com/freeipa/freeipa/pull/2051

Comment 5 Christian Heimes 2018-06-22 16:14:32 UTC
ipa-4-5:

* 7e9648736185734fc39752df875321558f4464e4 Improve and fix timeout bug in wait_for_entry()
* d129cb2ab70f658e4b07e1fbb7f16905c66895e9 Use common replication wait timeout of 5min
* b763b62069040f3efafc65197063a84411bd4d10 Fix replication races in Dogtag admin code

Comment 15 Michal Reznik 2018-08-31 10:17:15 UTC
Sanity Verified on ipa-server-4.6.4-7.el7.x86_64.
Installed 3x replica simultaneously in 15 runs and all installations were successful.

Comment 18 errata-xmlrpc 2018-10-30 10:58:44 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/RHBA-2018:3187


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