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 798792 - ipa netgroup-find options set to space return internal errors
Summary: ipa netgroup-find options set to space return internal errors
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ipa
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Rob Crittenden
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-29 21:11 UTC by Scott Poore
Modified: 2013-05-20 20:59 UTC (History)
3 users (show)

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


Attachments (Terms of Use)
/var/log/httpd/error_log entries relevant here, (17.52 KB, application/octet-stream)
2012-02-29 21:11 UTC, Scott Poore
no flags Details


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 Scott Poore 2012-02-29 21:11:33 UTC
Created attachment 566655 [details]
/var/log/httpd/error_log entries relevant here,

Description of problem:

Several netgroup-find options return internal error when give as a space (" ").

# ipa netgroup-find --netgroups=" "
ipa: ERROR: an internal error has occurred

# ipa netgroup-find --no-netgroups=" "
ipa: ERROR: an internal error has occurred

# ipa netgroup-find --users=" "
ipa: ERROR: an internal error has occurred

# ipa netgroup-find --no-users=" "
ipa: ERROR: an internal error has occurred

# ipa netgroup-find --groups=" "
ipa: ERROR: an internal error has occurred

# ipa netgroup-find --no-groups=" "
ipa: ERROR: an internal error has occurred

# ipa netgroup-find --hosts=" "
ipa: ERROR: an internal error has occurred

# ipa netgroup-find --no-hosts=" "
ipa: ERROR: an internal error has occurred

# ipa netgroup-find --hostgroups=" "
ipa: ERROR: an internal error has occurred

# ipa netgroup-find --no-hostgroups=" "
ipa: ERROR: an internal error has occurred

# ipa netgroup-find --in-netgroups=" "
ipa: ERROR: an internal error has occurred

# ipa netgroup-find --not-in-netgroups=" "
ipa: ERROR: an internal error has occurred

Version-Release number of selected component (if applicable):
389-ds-base-1.2.10.1-1.el6.x86_64
389-ds-base-libs-1.2.10.1-1.el6.x86_64
ipa-server-2.2.0-102.20120220T2339zgit7fe095c.el6.x86_64


How reproducible:
always

Steps to Reproduce:
1. <setup ipa server>
2. kinit admin
3. <run one or more of the following>:
# ipa netgroup-find --netgroups=" "
# ipa netgroup-find --no-netgroups=" "
# ipa netgroup-find --users=" "
# ipa netgroup-find --no-users=" "
# ipa netgroup-find --groups=" "
# ipa netgroup-find --no-groups=" "
# ipa netgroup-find --hosts=" "
# ipa netgroup-find --no-hosts=" "
# ipa netgroup-find --hostgroups=" "
# ipa netgroup-find --no-hostgroups=" "
# ipa netgroup-find --in-netgroups=" "
# ipa netgroup-find --not-in-netgroups=" "

  
Actual results:

returns:  
ipa: ERROR: an internal error has occurred

Expected results:

something more like the following is what I expected to see (with OPTION replaced with the option from the command line):

ipa: ERROR: invalid '<OPTION>': Leading and trailing spaces are not allowed


Additional info:

/var/log/httpd/error_log entries in attachment

Comment 2 Rob Crittenden 2012-02-29 21:29:56 UTC
The traceback looks something like:

[Wed Feb 29 16:28:53 2012] [error] ipa: DEBUG: WSGI wsgi_dispatch.__call__:
[Wed Feb 29 16:28:53 2012] [error] ipa: DEBUG: WSGI xmlserver.__call__:
[Wed Feb 29 16:28:53 2012] [error] ipa: DEBUG: Created connection context.ldap2
[Wed Feb 29 16:28:53 2012] [error] ipa: DEBUG: WSGI WSGIExecutioner.__call__:
[Wed Feb 29 16:28:53 2012] [error] ipa: DEBUG: raw: netgroup_find(None, private=False, managed=False, all=False, raw=False, version=u'2.27', pkey_only=False, netgroup=None)
[Wed Feb 29 16:28:53 2012] [error] ipa: DEBUG: netgroup_find(None, private=False, managed=False, all=False, raw=False, version=u'2.27', pkey_only=False, netgroup=None)
[Wed Feb 29 16:28:53 2012] [error] ipa: ERROR: non-public: TypeError: 'NoneType' object is not iterable
[Wed Feb 29 16:28:53 2012] [error] Traceback (most recent call last):
[Wed Feb 29 16:28:53 2012] [error]   File "/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line 314, in wsgi_execute
[Wed Feb 29 16:28:53 2012] [error]     result = self.Command[name](*args, **options)
[Wed Feb 29 16:28:53 2012] [error]   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 438, in __call__
[Wed Feb 29 16:28:53 2012] [error]     ret = self.run(*args, **options)
[Wed Feb 29 16:28:53 2012] [error]   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 696, in run
[Wed Feb 29 16:28:53 2012] [error]     return self.execute(*args, **options)
[Wed Feb 29 16:28:53 2012] [error]   File "/usr/lib/python2.7/site-packages/ipalib/plugins/baseldap.py", line 1815, in execute
[Wed Feb 29 16:28:53 2012] [error]     member_filter = self.get_member_filter(ldap, **options)
[Wed Feb 29 16:28:53 2012] [error]   File "/usr/lib/python2.7/site-packages/ipalib/plugins/baseldap.py", line 1747, in get_member_filter
[Wed Feb 29 16:28:53 2012] [error]     for pkey in options[param_name]:
[Wed Feb 29 16:28:53 2012] [error] TypeError: 'NoneType' object is not iterable
[Wed Feb 29 16:28:53 2012] [error] ipa: INFO: admin: netgroup_find(None, private=False, managed=False, all=False, raw=False, version=u'2.27', pkey_only=False, netgroup=None): TypeError
[Wed Feb 29 16:28:53 2012] [error] ipa: DEBUG: response: InternalError: an internal error has occurred
[Wed Feb 29 16:28:53 2012] [error] ipa: DEBUG: Destroyed connection context.ldap2

Invalid options are ignored, searching for spaces shouldn't be illegal.

Comment 3 Scott Poore 2012-03-01 00:03:02 UTC
I would have expected it to be illegal for the options that do not allow spaces.   I wouldn't have expected that in any of the cases I listed.

Still, if it is legal to search for spaces (even for types that don't allow spaces), shouldn't it have returned a normal message listing 0 entries returned?

Are the traceback errors a result of the types I listed being lists as opposed to more simple strings?

Thanks

Comment 4 Rob Crittenden 2012-03-01 15:35:35 UTC
We purposely do no validation on search strings. Otherwise, for example, to search on hosts you'd always have to search on the fqdn and not a substring.

I'm just guessing but I think the space is being optimized out and being set to None and that is why it is blowing up.

Comment 5 Scott Poore 2012-03-01 18:35:09 UTC
The --desc and --uuid options seem to check for spaces (leading/trailing at least).   Are those special cases?

# ipa netgroup-find --uuid=" "
ipa: ERROR: invalid 'uuid': Leading and trailing spaces are not allowed

# ipa netgroup-find --desc=" "
ipa: ERROR: invalid 'desc': Leading and trailing spaces are not allowed

Blowing up on None makes sense there from the TypeError message (if I understand what it's saying).

However, None seems to work on netgroup-add-member though?

# ipa netgroup-add-member test --netgroups=" "
  Netgroup name: test
  Description: desc
  NIS domain name: testrelm.com
  Member User: admin
-------------------------
Number of members added 0
-------------------------

/var/log/httpd/error_logs:

[Thu Mar 01 12:30:48 2012] [error] ipa: INFO: admin: netgroup_add_member(u'test', all=False, raw=False, version=u'2.26', netgroup=None): SUCCESS

So, is there something here that can be done to fix the internal errors?

Comment 6 Rob Crittenden 2012-03-01 19:10:17 UTC
No validation should be done on find options, that is a separate bug.

Yes, we will address the exception.

Comment 7 Martin Kosek 2012-03-02 07:33:21 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/2479

Comment 8 Rob Crittenden 2012-03-14 20:39:35 UTC
Fixed upstream.

master: e9d68a7b001d23a7bac7cbf52e270c0723f1f69d

ipa-2-2: ea4047ec47130fb4e001896d997085da1ca510c2

Comment 11 Scott Poore 2012-03-22 20:28:05 UTC
Verified.

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

Automated Test Results ::

[root@ibm-x3655-04 ipa-netgroup-cli]# netgroup_bz_798792

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: netgroup_bz_798792_1: ipa netgroup-find options set to space return internal errors (netgroups)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'ipa netgroup-find --netgroups=" " > /tmp/errormsg.out 2>&1'
:: [   PASS   ] :: BZ 798792 not found.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: netgroup_bz_798792_2: ipa netgroup-find options set to space return internal errors (no-netgroups)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'ipa netgroup-find --no-netgroups=" " > /tmp/errormsg.out 2>&1'
:: [   PASS   ] :: BZ 798792 not found.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: netgroup_bz_798792_3: ipa netgroup-find options set to space return internal errors (users)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'ipa netgroup-find --users=" " > /tmp/errormsg.out 2>&1'
:: [   PASS   ] :: BZ 798792 not found.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: netgroup_bz_798792_4: ipa netgroup-find options set to space return internal errors (no-users)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'ipa netgroup-find --no-users=" " > /tmp/errormsg.out 2>&1'
:: [   PASS   ] :: BZ 798792 not found.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: netgroup_bz_798792_5: ipa netgroup-find options set to space return internal errors (groups)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'ipa netgroup-find --groups=" " > /tmp/errormsg.out 2>&1'
:: [   PASS   ] :: BZ 798792 not found.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: netgroup_bz_798792_6: ipa netgroup-find options set to space return internal errors (no-groups)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'ipa netgroup-find --no-groups=" " > /tmp/errormsg.out 2>&1'
:: [   PASS   ] :: BZ 798792 not found.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: netgroup_bz_798792_7: ipa netgroup-find options set to space return internal errors (hosts)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'ipa netgroup-find --hosts=" " > /tmp/errormsg.out 2>&1'
:: [   PASS   ] :: BZ 798792 not found.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: netgroup_bz_798792_8: ipa netgroup-find options set to space return internal errors (no-hosts)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'ipa netgroup-find --no-hosts=" " > /tmp/errormsg.out 2>&1'
:: [   PASS   ] :: BZ 798792 not found.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: netgroup_bz_798792_9: ipa netgroup-find options set to space return internal errors (hostgroups)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'ipa netgroup-find --hostgroups=" " > /tmp/errormsg.out 2>&1'
:: [   PASS   ] :: BZ 798792 not found.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: netgroup_bz_798792_10: ipa netgroup-find options set to space return internal errors (no-hostgroups)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'ipa netgroup-find --no-hostgroups=" " > /tmp/errormsg.out 2>&1'
:: [   PASS   ] :: BZ 798792 not found.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: netgroup_bz_798792_11: ipa netgroup-find options set to space return internal errors (in-netgroups)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'ipa netgroup-find --in-netgroups=" " > /tmp/errormsg.out 2>&1'
:: [   PASS   ] :: BZ 798792 not found.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: netgroup_bz_798792_12: ipa netgroup-find options set to space return internal errors (not-in-netgroups)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'ipa netgroup-find --not-in-netgroups=" " > /tmp/errormsg.out 2>&1'
:: [   PASS   ] :: BZ 798792 not found.


Manual Test Results :: 
[root@ibm-x3655-04 ipa-netgroup-cli]# ipa netgroup-find --netgroups=" "
-------------------
0 netgroups matched
-------------------
----------------------------
Number of entries returned 0
----------------------------
[root@ibm-x3655-04 ipa-netgroup-cli]# ipa netgroup-find --no-netgroups=" "
-------------------
0 netgroups matched
-------------------
----------------------------
Number of entries returned 0
----------------------------
[root@ibm-x3655-04 ipa-netgroup-cli]# ipa netgroup-find --users=" "
-------------------
0 netgroups matched
-------------------
----------------------------
Number of entries returned 0
----------------------------
[root@ibm-x3655-04 ipa-netgroup-cli]# ipa netgroup-find --no-users=" "
-------------------
0 netgroups matched
-------------------
----------------------------
Number of entries returned 0
----------------------------
[root@ibm-x3655-04 ipa-netgroup-cli]# ipa netgroup-find --groups=" "
-------------------
0 netgroups matched
-------------------
----------------------------
Number of entries returned 0
----------------------------
[root@ibm-x3655-04 ipa-netgroup-cli]# ipa netgroup-find --no-groups=" "
-------------------
0 netgroups matched
-------------------
----------------------------
Number of entries returned 0
----------------------------
[root@ibm-x3655-04 ipa-netgroup-cli]# ipa netgroup-find --hosts=" "
-------------------
0 netgroups matched
-------------------
----------------------------
Number of entries returned 0
----------------------------
[root@ibm-x3655-04 ipa-netgroup-cli]# ipa netgroup-find --no-hosts=" "
-------------------
0 netgroups matched
-------------------
----------------------------
Number of entries returned 0
----------------------------
[root@ibm-x3655-04 ipa-netgroup-cli]# ipa netgroup-find --hostgroups=" "
-------------------
0 netgroups matched
-------------------
----------------------------
Number of entries returned 0
----------------------------
[root@ibm-x3655-04 ipa-netgroup-cli]# ipa netgroup-find --no-hostgroups=" "
-------------------
0 netgroups matched
-------------------
----------------------------
Number of entries returned 0
----------------------------
[root@ibm-x3655-04 ipa-netgroup-cli]# ipa netgroup-find --in-netgroups=" "
-------------------
0 netgroups matched
-------------------
----------------------------
Number of entries returned 0
----------------------------
[root@ibm-x3655-04 ipa-netgroup-cli]# ipa netgroup-find --not-in-netgroups=" "
-------------------
0 netgroups matched
-------------------
----------------------------
Number of entries returned 0
----------------------------

Comment 13 Martin Kosek 2012-04-24 13:32:15 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 15 errata-xmlrpc 2012-06-20 13:20:04 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.