Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 750984

Summary: Inconsistency in error message while adding a duplicate netgroup.
Product: Red Hat Enterprise Linux 6 Reporter: Gowrishankar Rajaiyan <grajaiya>
Component: ipaAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2CC: jgalipea, mkosek, spoore
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-2.2.0-1.el6 Doc Type: Bug Fix
Doc Text:
No documentation needed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:16:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 756082    

Description Gowrishankar Rajaiyan 2011-11-03 05:44:24 UTC
Description of problem:


Version-Release number of selected component (if applicable):
ipa-server-2.1.3-8.el6.x86_64

How reproducible:


Steps to Reproduce:
1. [root@decepticons ~]# ipa netgroup-add test
Description: test
---------------------
Added netgroup "test"
---------------------
  Netgroup name: test
  Description: test
  NIS domain name: lab.eng.pnq.redhat.com
  IPA unique ID: c6354608-05dc-11e1-90bc-525400f56e2e


2. [root@decepticons ~]# ipa hostgroup-add test
Description: test
ipa: ERROR: netgroup with name "test" already exists. Hostgroups and netgroups
share a common namespace
[root@decepticons ~]# 

3. [root@decepticons ~]# ipa hostgroup-add test2
Description: test2
-----------------------
Added hostgroup "test2"
-----------------------
  Host-group: test2
  Description: test2


4. [root@decepticons ~]# ipa netgroup-add test2
  

Actual results:
[root@decepticons ~]# ipa netgroup-add test2
Description: test2
ipa: ERROR: netgroup with name "test2" already exists
[root@decepticons ~]# 


Expected results:
[root@decepticons ~]# ipa netgroup-add test2
Description: test2
ipa: ERROR: netgroup with name "test2" already exists. Hostgroups and netgroups
share a common namespace.
[root@decepticons ~]# 


Additional info:

Comment 2 Rob Crittenden 2011-11-03 12:57:11 UTC
The issue here wasn't adding a conflicting name though. In this case the only problem is that there is a duplicate netgroup so I think the error is accurate. 

Otherwise you could be sent on a wild goose chase looking for a hostgroup named test2.

Comment 3 Gowrishankar Rajaiyan 2011-11-03 16:20:59 UTC
I think the confusion is because I am repeating the same command in "Actual results". Let me put it this way:

[root@decepticons ~]# ipa hostgroup-add test2
Description: test2
-----------------------
Added hostgroup "test2"
-----------------------
  Host-group: test2
  Description: test2

[root@decepticons ~]# ipa netgroup-add test2
Description: test2
ipa: ERROR: netgroup with name "test2" already exists
[root@decepticons ~]# 

so here I expected "ipa: ERROR: netgroup with name "test2" already exists. Hostgroups and netgroups share a common namespace."

Comment 6 Martin Kosek 2011-11-07 08:11:08 UTC
I think you have a point. We could find out if the colliding netgroup was created separately via netgroup-add or as a managed object of a hostgroup and display error message based on this information.

We could check for objectclass: mepManagedEntry to distinguish these situations:

1) foo is a managed entry of a foo hostgroup

# ipa netgroup-show --all --raw foo
  dn: cn=foo,cn=ng,cn=alt,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com
  cn: foo
  description: ipaNetgroup foo
  nisdomainname: idm.lab.bos.redhat.com
  ipauniqueid: 69858e34-0917-11e1-8cce-00163e2d6a08
  memberhost: cn=foo,cn=hostgroups,cn=accounts,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com
  mepmanagedby: cn=foo,cn=hostgroups,cn=accounts,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com
  objectclass: ipanisnetgroup
  objectclass: ipaobject
  objectclass: mepManagedEntry
  objectclass: ipaAssociation
  objectclass: top

2) Bar is a pure netgroup

[root@vm-134 ~]# ipa netgroup-show --all --raw bar
  dn: ipauniqueid=717c04e2-0917-11e1-b2f0-00163e2d6a08,cn=ng,cn=alt,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com
  cn: bar
  description: foo
  nisdomainname: idm.lab.bos.redhat.com
  ipauniqueid: 717c04e2-0917-11e1-b2f0-00163e2d6a08
  objectclass: ipaobject
  objectclass: ipaassociation
  objectclass: ipanisnetgroup

Comment 7 Martin Kosek 2011-11-07 08:13:17 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/2069

Comment 10 Scott Poore 2012-03-16 22:44:07 UTC
Verified.

Version :: ipa-server-2.2.0-4.el6.x86_64

Automated Test Results ::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: netgroup_bz_750984: Inconsistency in error message while adding a duplicate netgroup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'ipa hostgroup-add netgroup_bz_750984 --desc=netgroup_bz_750984'
:: [   PASS   ] :: Running 'ipa netgroup-add netgroup_bz_750984 --desc=netgroup_bz_750984 > /netgroup_bz_750984.28774.out 2>&1'
:: [   PASS   ] :: BZ 750984 not found.
:: [   PASS   ] :: Running 'ipa hostgroup-del netgroup_bz_750984'
:: [   PASS   ] :: Running 'ipa netgroup-add netgroup_bz_750984 --desc=netgroup_bz_750984'
:: [   PASS   ] :: Running 'ipa hostgroup-add netgroup_bz_750984 --desc=netgroup_bz_750984 > /netgroup_bz_750984.28774.out 2>&1'
:: [   PASS   ] :: BZ 750984 not found.
:: [   PASS   ] :: Running 'ipa netgroup-del netgroup_bz_750984'
:: [   LOG    ] :: Duration: 29s
:: [   LOG    ] :: Assertions: 8 good, 0 bad
:: [   PASS   ] :: RESULT: netgroup_bz_750984: Inconsistency in error message while adding a duplicate netgroup

Manual Test Results ::

[root@hp-xw6600-01 ipa-netgroup-cli]# ipa hostgroup-add netgroup_bz_750984 --desc=netgroup_bz_750984
------------------------------------
Added hostgroup "netgroup_bz_750984"
------------------------------------
  Host-group: netgroup_bz_750984
  Description: netgroup_bz_750984

[root@hp-xw6600-01 ipa-netgroup-cli]# ipa netgroup-add netgroup_bz_750984 --desc=netgroup_bz_750984
ipa: ERROR: hostgroup with name "netgroup_bz_750984" already exists. Hostgroups and netgroups share a common namespace

[root@hp-xw6600-01 ipa-netgroup-cli]# ipa netgroup-add netgroup_bz_750984 --desc=netgroup_bz_750984
-----------------------------------
Added netgroup "netgroup_bz_750984"
-----------------------------------
  Netgroup name: netgroup_bz_750984
  Description: netgroup_bz_750984
  NIS domain name: testrelm.com
  IPA unique ID: 5b37b7cc-6fb9-11e1-8903-0019bbea4c2b

[root@hp-xw6600-01 ipa-netgroup-cli]# ipa hostgroup-add netgroup_bz_750984 --desc=netgroup_bz_750984
ipa: ERROR: netgroup with name "netgroup_bz_750984" already exists. Hostgroups and netgroups share a common namespace

Comment 12 Martin Kosek 2012-04-19 11:34:20 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No documentation needed.

Comment 14 errata-xmlrpc 2012-06-20 13:16:08 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.

http://rhn.redhat.com/errata/RHBA-2012-0819.html