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 2180915 - Sequence processing failures for group_add using server context
Summary: Sequence processing failures for group_add using server context
Keywords:
Status: CLOSED DUPLICATE of bug 2180914
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: ipa
Version: 9.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Florence Blanc-Renaud
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-22 15:58 UTC by Antonio Torres
Modified: 2023-03-22 16:01 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-03-22 16:01:22 UTC
Type: ---
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-9584 0 None None None 2023-03-22 16:00:36 UTC
Red Hat Issue Tracker RHELPLAN-152766 0 None None None 2023-03-22 16:00:40 UTC

Description Antonio Torres 2023-03-22 15:58:58 UTC
Cloned from upstream: https://pagure.io/freeipa/issue/9349

### Issue
Issues have been found for group_add sequence processing with server context with the work on https://github.com/freeipa/ansible-freeipa/pull/1001

1) Using group_add in sequence processing to create several groups where one is external, all groups have objectclass ipaexternalgroup, even if external is set to False for the group_add command.
2) After creating a nonposix group, all following group_add calls to add posix groups calls are failing with `missing attribute "gidNumber" required by object class "posixGroup"`

#### Reproducer 1 (external)

    from ipalib import api, errors

    api.bootstrap_with_global_options(context='server')
    api.finalize()
    if api.env.in_server:
        api.Backend.ldap2.connect()
    else:
        api.Backend.rpcclient.connect()

    print("Remove 'testgroup1'")
    try:
        api.Command["group_del"]("testgroup1")
    except errors.NotFound:
        pass

    print("Remove 'testgroup2'")
    try:
        api.Command["group_del"]("testgroup2")
    except errors.NotFound:
        pass

    print("Create 'testgroup1' with external=True")
    api.Command["group_add"]("testgroup1", external=True)

    print("Create 'testgroup2' with external=False")
    api.Command["group_add"]("testgroup2", external=False)

    result1 = api.Command["group_show"]("testgroup1", all=True)["result"]
    print("'testgroup1' userclass: %s" % repr(result1["objectclass"]))

    result2 = api.Command["group_show"]("testgroup2", all=True)["result"]
    print("'testgroup2' userclass: %s" % repr(result2["objectclass"]))


#### Reproducer 2 (nonposix)

    from ipalib import api, errors

    api.bootstrap_with_global_options(context='server')
    api.finalize()
    if api.env.in_server:
        api.Backend.ldap2.connect()
    else:
        api.Backend.rpcclient.connect()

    print("Remove 'testgroup1'")
    try:
        api.Command["group_del"]("testgroup1")
    except errors.NotFound:
        pass

    print("Remove 'testgroup2'")
    try:
        api.Command["group_del"]("testgroup2")
    except errors.NotFound:
        pass

    print("Remove 'testgroup3'")
    try:
        api.Command["group_del"]("testgroup3")
    except errors.NotFound:
        pass

    print("Create 'testgroup1' with nonposix=False")
    api.Command["group_add"]("testgroup1", nonposix=False)

    try:
        print("Create 'testgroup2' with nonposix=True")
        api.Command["group_add"]("testgroup2", nonposix=True)
    except Exception as e:
        print(str(e))

    try:
        print("Create 'testgroup3' with external=True")
        api.Command["group_add"]("testgroup3", external=True)
    except Exception as e:
        print(str(e))

#### Actual behavior
1) With reproducer 1 all groups are external.

    $ python3 external_test.py 
    Remove 'testgroup1'
    Remove 'testgroup2'
    Create 'testgroup1' with external=True
    Create 'testgroup2' with external=False
    'testgroup1' userclass: ['top', 'groupofnames', 'nestedgroup', 'ipausergroup', 'ipaobject', 'ipaexternalgroup']
    'testgroup2' userclass: ['top', 'groupofnames', 'nestedgroup', 'ipausergroup', 'ipaobject', 'ipaexternalgroup', 'posixgroup', 'ipantgroupattrs']


2) Reproducer 2 fails to create posix groups after nonposix group has been created.

    $ python3 nonposix_test.py 
    Remove 'testgroup1'
    Remove 'testgroup2'
    Remove 'testgroup3'
    Create 'testgroup1' with nonposix=False
    Create 'testgroup2' with nonposix=True
    missing attribute "gidNumber" required by object class "posixGroup"
    Create 'testgroup3' with external=True
    missing attribute "gidNumber" required by object class "posixGroup"

2) Reproducer 2 fails to create posix groups after nonposix group has been created.

#### Expected behavior
No issues.

#### Version/Release/Distribution

    $ rpm -q freeipa-server freeipa-client ipa-server ipa-client 389-ds-base pki-ca krb5-server
    freeipa-server-4.9.9-1.fc36.x86_64
    freeipa-client-4.9.9-1.fc36.x86_64
    package ipa-server is not installed
    package ipa-client is not installed
    389-ds-base-2.1.1-2.fc36.x86_64
    package pki-ca is not installed
    krb5-server-1.19.2-6.fc36.x86_64

### Addititional Information
The reproducers are passing using client context.


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