Bug 33928 - Bad search filter: Improve traceback
Bad search filter: Improve traceback
Status: CLOSED DUPLICATE of bug 30088
Product: UCS
Classification: Unclassified
Component: UMC - Domain management (Generic)
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 4.0-0-errata
Assigned To: Florian Best
Dirk Wiesenthal
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-14 23:06 CET by Dirk Wiesenthal
Modified: 2015-01-16 12:04 CET (History)
4 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling, Troubleshooting, Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2014-01-14 23:06:28 CET
We have multiple feedbacks like this one:

 Traceback:
  File "/usr/lib/pymodules/python2.6/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "/usr/lib/pymodules/python2.6/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File
"/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/__init__.py", line
487, in _thread
    result = module.search( request.options.get( 'container' ), request.options[
'objectProperty' ], request.options[ 'objectPropertyValue' ], superordinate, scope =
request.options.get( 'scope', 'sub' ), hidden=request.options.get('hidden') )
  File
"/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line
182, in wrapper_func
    raise LDAP_ConnectionError( str( e ) )

LDAP_ConnectionError: Bad search filter

The exception provides no information whatsoever. I have no clue how to provoke that error even if I wanted to.

The exact search filter should not be sent as it may contain confidential data. But these should work:

def udm.query():
  try:
    return module.search()
  except BadSearchFilter: # does not exist like that. get creative!
    raise UMC_OptionTypeError(module_name, container_given?, objectProperty, objectPropertyValue_given?, superordinate_given?, scope, hidden)

When this gets fixed and installed, the tracebacks won't disappear but at least we know why they happen (hopefully).
Comment 1 Alexander Kläser univentionstaff 2014-01-15 08:15:54 CET
If that could be solved deeper in LDAP itself (propagated as "info" attribute), it would be written accordingly in the final error message. Here a provoked error via UDM in python:

> Traceback (most recent call last):
>   File "udm.py", line 10, in <module>
>     result = udm_modules.lookup('users/user', None, lo, base=c['ldap/base'], scope='sub', filter='(uid=foo')
>   File "/usr/lib/pymodules/python2.6/univention/admin/modules.py", line 801, in lookup
>     tmpres=module.lookup(co, lo, filter, base=base, superordinate=superordinate, scope=scope, unique=unique, required=required, timeout=timeout, sizelimit=sizelimit)
>   File "/usr/lib/pymodules/python2.6/univention/admin/handlers/users/user.py", line 2702, in lookup
>     for dn, attrs in lo.search(unicode(filter), base, scope, [], unique, required, timeout, sizelimit):
>   File "/usr/lib/pymodules/python2.6/univention/admin/uldap.py", line 356, in search
>     raise univention.admin.uexceptions.ldapError, _err2str(msg)
> univention.admin.uexceptions.ldapError: Bad search filter
Comment 2 Florian Best univentionstaff 2014-06-10 09:19:50 CEST
reported again (twice)
Comment 3 Florian Best univentionstaff 2014-06-11 09:48:42 CEST
Remark:
Using UCS 3.2 RC 1 fresh install. System has been updated to the latest, correct
credentials used in LDB. Simply opening the OX mail settings will produce this error.
Comment 4 Florian Best univentionstaff 2014-06-11 09:51:01 CEST
(In reply to Florian Best from comment #3)
> Remark:
> Using UCS 3.2 RC 1 fresh install. System has been updated to the latest,
> correct
> credentials used in LDB. Simply opening the OX mail settings will produce
> this error.
Sorry, quote from wrong ticket.
Comment 5 Florian Best univentionstaff 2014-07-14 09:19:21 CEST
reported again.
Comment 6 Florian Best univentionstaff 2014-08-18 13:21:09 CEST
again
Comment 7 Florian Best univentionstaff 2014-10-06 10:19:20 CEST
reported again
Comment 8 Florian Best univentionstaff 2014-12-01 23:50:47 CET
One was fixed in Bug #35953
Comment 9 Florian Best univentionstaff 2014-12-04 16:47:51 CET
The approach from comment #1 has been implemented in Bug #30088.
Bug #32979 also improved error handling.
The underlying bug that this error can happen is Bug #28383.

*** This bug has been marked as a duplicate of bug 30088 ***
Comment 10 Dirk Wiesenthal univentionstaff 2015-01-07 18:01:35 CET
OK, should not be a problem anymore.