Bug 28627 - Traceback bei UCS-ungültigen Benutzern im LDAP
Traceback bei UCS-ungültigen Benutzern im LDAP
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 3.0
All Linux
: P5 normal (vote)
: UCS 3.x
Assigned To: UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-24 10:54 CEST by Philipp Hahn
Modified: 2018-04-13 13:28 CEST (History)
3 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?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Cleanup, Troubleshooting
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2012-09-24 10:54:36 CEST
Traceback (most recent call last):
  File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 233, in doit
    output = univention.admincli.admin.doit(arglist)
  File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 387, in doit
    out=_doit(arglist)
  File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 1107, in _doit
    out.append( 'DN: %s' % _2utf8( univention.admin.objects.dn (object ) ) )
  File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 243, in _2utf8
    return text.decode( 'iso-8859-1' )
AttributeError: 'NoneType' object has no attribute 'decode'


def _2utf8( text ):
        try:
                return text.encode( 'utf-8' )
        except:
                return text.decode( 'iso-8859-1' )
Comment 1 Philipp Hahn univentionstaff 2012-09-24 10:58:54 CEST
/usr/lib/pymodules/python2.6/univention/admin/objects.py:139
def dn(object):
        if hasattr(object, 'dn'):
                return object.dn
        else:
                return None
Comment 2 Philipp Hahn univentionstaff 2012-09-25 07:44:28 CEST
FYI: Das ganze ist im Rahmen von Ticket #2012081021002877 aufgetreten: Dort werden massenhaft Benutzer (inetOrgPerson) direkt im LDAP angelegt, deren UID mehr als einen Großbuchstaben am Anfang enthielten. Der LDAP-Suchfilter von users/user scheint die auch noch zu finden, allerdings geht wohl dann was beim Öffnen schief, so daß die Objekte alle mit DN=None angezeigt werden (bzw. eben besagter Traceback)
Comment 3 Philipp Hahn univentionstaff 2012-09-25 12:28:31 CEST
UMC verschluckt sich auch irgendwo und steigt mit einem Traceback aus:

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 426, in _thread
    if module.module is None:
AttributeError: 'NoneType' object has no attribute 'module'


/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/__init__.py
>      module = get_module( object_type, obj.dn )
>      if module.module is None:
Sollte das nicht besser nur "module" heißen?

>         MODULE.warn( 'Could not identify LDAP object %s (flavor: %s). The object is ignored.' % ( obj.dn, request.flavor ) )
>         continue
Comment 4 Alexander Kläser univentionstaff 2012-09-26 09:57:07 CEST
(In reply to comment #3)
> ...
> Sollte das nicht besser nur "module" heißen?

Nein, das ist wahrscheinlich schon richtig. Es gibt noch eine Klasse, die die UDM-Module wrapt. Insofern greift module.module auf das eigentliche UDM-Modul zu, welches als Eigenschaft "module" an dem Wrapper-Objekt "module" gespeichert ist :) .
Comment 5 Philipp Hahn univentionstaff 2012-09-28 14:07:49 CEST
Siehe Ticket 2012081021002877 für ein (vermutlich) weiteres Problem, das ich auch lokal selber reproduzieren kann:
----------
  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
856, in _thread
    'path' : ldap_dn2path( obj.dn, include_rdn = False ) } )
  File
'/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py', line
827, in ldap_dn2path
    if ldap_base is None or not ldap_dn.endswith( ldap_base ):
            ^^^^                     ^^                ^^^^
AttributeError: 'NoneType' object has no attribute 'endswith'
----------
univention-management-console-frontend 1.0.396-1.366.201207161556 (24595)

Der Code wurde durch Bug #22439 in svn 25026 hinzugefügt.


Auch sehr unglücklich ist folgender Code in admin/handlers/users/user.py#__init__():
>	if uid:
>		try:
...
>		# FIXME: we should NEVER catch all exceptions
>		except Exception, e:
>			# at least write some debuging output..
>			univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'Caught exception: %s' % e )
>			univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'Continuing without dn..')
>			self.dn=None
>			return
Das Problem ist hier, daß die Exception lediglich ab level=INFO geloggt wird. Da standardmäßig das Level niedrigr eingestellt ist, sieht man von dem Problem nichts direkt, sondern danach lediglich die Fehlermeldung, daß dn=None nicht das Attribut endwidth hat.
IMHO sollte das als Error geloggt werden.


(In reply to comment #4)
> (In reply to comment #3)
> > ...
> > Sollte das nicht besser nur "module" heißen?
> 
> Nein, das ist wahrscheinlich schon richtig.

Das sollte es wohl besser
  if module is None or module.module is None:
heißen.
Comment 6 Philipp Hahn univentionstaff 2012-09-28 15:12:02 CEST
(In reply to comment #5)
> Auch sehr unglücklich ist folgender Code in
...
> Das Problem ist hier, daß die Exception lediglich ab level=INFO geloggt wird.
> Da standardmäßig das Level niedrigr eingestellt ist, sieht man von dem Problem
> nichts direkt, sondern danach lediglich die Fehlermeldung, daß dn=None nicht
> das Attribut endwidth hat.
> IMHO sollte das als Error geloggt werden.

Auslöser ist ein vergessenes Aufruf von set_uid_umlaut(), der hier einen AttributeError auslöst; siehe dazu Bug #28671
Comment 7 Stefan Gohmann univentionstaff 2017-06-16 20:38:52 CEST
This issue has been filed against UCS 3. UCS 3 is out of the normal maintenance and many UCS components have vastly changed in UCS 4.

If this issue is still valid, please change the version to a newer UCS version otherwise this issue will be automatically closed in the next weeks.
Comment 8 Florian Best univentionstaff 2017-06-28 14:52:20 CEST
There is a Customer ID set so I set the flag "Enterprise Customer affected".
Comment 9 Stefan Gohmann univentionstaff 2017-08-08 07:07:18 CEST
This issue has been filed against UCS 3.0.

UCS 3.0 is out of maintenance and many UCS components have vastly changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen this issue. In this case please provide detailed information on how this issue is affecting you.