Bug 750984 - Inconsistency in error message while adding a duplicate netgroup.
Summary: Inconsistency in error message while adding a duplicate netgroup.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ipa
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Rob Crittenden
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks: 756082
TreeView+ depends on / blocked
 
Reported: 2011-11-03 05:44 UTC by Gowrishankar Rajaiyan
Modified: 2013-05-21 12:36 UTC (History)
3 users (show)

Fixed In Version: ipa-2.2.0-1.el6
Doc Type: Bug Fix
Doc Text:
No documentation needed.
Clone Of:
Environment:
Last Closed: 2012-06-20 13:16:08 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0819 0 normal SHIPPED_LIVE ipa bug fix and enhancement update 2012-06-19 20:34:17 UTC

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


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