Bug 26080 - Traceback "UnboundLocalError" bei Benutzerobjekten
Traceback "UnboundLocalError" bei Benutzerobjekten
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Users
UCS 3.0
Other Linux
: P5 normal (vote)
: UCS 3.0-2
Assigned To: Alexander Kläser
Florian Best
: interim-3
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-10 06:54 CET by Ingo Steuwer
Modified: 2013-02-25 12:23 CET (History)
6 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): Troubleshooting
Max CVSS v3 score:


Attachments
Skript zum Erstellen von Extended-Attributes (1.05 KB, text/plain)
2012-07-11 12:41 CEST, Alexander Kläser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ingo Steuwer univentionstaff 2012-02-10 06:54:51 CET
Aufgefallen im Rahmen von 2012011121004224:

Bei scheinbar allen Benutzerobjekten tritt dieser Traceback beim öffnen von Benutzern über die UMC auf:

Interner Modul-Fehler: Ein Fehler trat während des Ausführens des Befehls auf.

Fehlernachricht des Servers:

File '/usr/lib/pymodules/python2.6/notifier/threads.py', line 81, 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 754, in _thread
return read_syntax_choices( request.options[ 'syntax' ], request.options )
File '/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py', line 130, in wrapper_func
ret = func( *args, **kwargs )
File '/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py', line 1037, in read_syntax_choices
syntax.choices.append( { 'module' : 'udm', 'flavor' : module.flavor, 'objectType' : module.name, 'id' : id, 'label' : label, 'icon' : 'udm-%s' % module.name.replace( '/', '-' ) } )

UnboundLocalError: local variable 'id' referenced before assignment
Comment 1 Stefan Gohmann univentionstaff 2012-02-10 07:11:15 CET
Da scheint es ein Problem mit einer LDAP Search Syntax Definition zu geben. Bitte mal die LDAP Search Syntax Objekte anhängen:

 univention-ldapsearch -x objectClass=univentionSyntax
Comment 2 Ingo Steuwer univentionstaff 2012-02-10 08:30:27 CET
Hier die Extended Attributes mit "neutralisierter" LDAP-Basis. In der Vorbereitung waren die TCS-Attribute noch nicht eingespielt, dort trat das Problem nicht auf.


dn: cn=z4uUserSendAsPrivilege,cn=zarafa,cn=custom attributes,cn=univention,dc=base,dc=de
univentionSyntaxLDAPFilter: (zarafaAccount=1)
univentionSyntaxLDAPAttribute: user/user: username
univentionSyntaxViewOnly: FALSE
univentionSyntaxDescription: Zarafa User for SendAsPrivilege
cn: z4uUserSendAsPrivilege
univentionSyntaxLDAPValue: uidNumber
objectClass: top
objectClass: univentionSyntax
objectClass: univentionObject
univentionObjectType: settings/syntax

dn: cn=thinClientAutostart,cn=Thin Client,cn=custom attributes,cn=univention,dc=base,dc=de
univentionSyntaxLDAPFilter: objectClass=univentionThinClientAutostart
univentionSyntaxLDAPAttribute: univentionThinClientAutostartName
univentionSyntaxViewOnly: FALSE
univentionSyntaxLDAPValue: univentionThinClientAutostartCommand
cn: thinClientAutostart
objectClass: top
objectClass: univentionSyntax
objectClass: univentionObject
univentionObjectType: settings/syntax

dn: cn=thinClientSession,cn=Thin Client,cn=custom attributes,cn=univention,dc=base,dc=de
univentionSyntaxLDAPFilter: objectClass=univentionThinClientSession
univentionSyntaxLDAPAttribute: univentionThinClientSessionName
univentionSyntaxViewOnly: FALSE
univentionSyntaxLDAPValue: univentionThinClientSessionScript
cn: thinClientSession
objectClass: top
objectClass: univentionSyntax
objectClass: univentionObject
univentionObjectType: settings/syntax

dn: cn=ManagementServer,cn=UVMM,cn=custom attributes,cn=univention,dc=base,dc=de
univentionSyntaxLDAPFilter: univentionService=Virtual Machine Manager
objectClass: top
objectClass: univentionSyntax
objectClass: univentionObject
univentionObjectType: settings/syntax
univentionSyntaxLDAPAttribute: computers/computer: fqdn
univentionSyntaxViewOnly: FALSE
univentionSyntaxLDAPValue: computers/computer: fqdn
cn: ManagementServer

search: 3
result: 0 Success
Comment 3 Stefan Gohmann univentionstaff 2012-02-10 08:39:44 CET
(In reply to comment #2)
> Hier die Extended Attributes mit "neutralisierter" LDAP-Basis. In der
> Vorbereitung waren die TCS-Attribute noch nicht eingespielt, dort trat das
> Problem nicht auf.

Kannst du auch noch die Extended Attributes der Benutzer anhängen?
Comment 4 Ingo Steuwer univentionstaff 2012-02-10 11:14:37 CET
Schuld ist z4uUserSendAsPrivilege: Die Suche nach (zarafaAccount=1) kann auch Gruppen als Ergebnis liefern, die Gruppen haben dann das geforderte Attribut UIDNumber nicht.

Workaround: Ändern des Filter auf (&(zarafaAccount=1)(uidNumber=*)):

dn: cn=SendAsPrivilege,cn=zarafa,cn=custom attributes,cn=univention,dc=base,dc=de
univentionUDMPropertyValueMayChange: 1
cn: SendAsPrivilege
univentionUDMPropertyShortDescription: Send as privilege
univentionUDMPropertyModule: users/user
univentionUDMPropertyLayoutTabName: Zarafa
univentionUDMPropertySyntax: z4uUserSendAsPrivilege
univentionUDMPropertyLongDescription: Users may directly send email as this us
 er
univentionUDMPropertyVersion: 2
univentionUDMPropertyMultivalue: 1
univentionUDMPropertyObjectClass: zarafa-user
univentionUDMPropertyCLIName: SendAsPrivilege
univentionUDMPropertyLayoutPosition: 3
univentionUDMPropertyValueNotEditable: 0
univentionUDMPropertyLdapMapping: zarafaSendAsPrivilege
objectClass: top
objectClass: univentionUDMProperty
objectClass: univentionObject
univentionObjectType: settings/extended_attribute
Comment 5 Andreas Büsching univentionstaff 2012-02-13 15:08:12 CET
Als Lösung würde ich jetzt denken, dass Objekte, die nicht den "Anforderungen" entsprechend ignoriert werden und im Log (ERROR oder WARN) vermerkt werden.
Comment 6 Alexander Kläser univentionstaff 2012-07-11 12:41:13 CEST
Created attachment 4528 [details]
Skript zum Erstellen von Extended-Attributes

Das angehängte Skript provoziert diesen Fehler, wenn man im UMC einen Benutzer anzeigt. Der Traceback wird jetzt verhindert, die entsprechenden Objekt ignoriert und mit einer Fehlermeldung im Log-File quittiert.


 univention-management-console-module-udm (1.0.285-1) unstable; urgency=low
 .
   * LDAP objects that do not have the attributes specified by LDAP search
     syntaxes are ignored and acknowledged with an warning in the log files;
     Bug #26080
Comment 7 Florian Best univentionstaff 2012-07-13 14:13:37 CEST
(In reply to comment #6)
> Created an attachment (id=4528) [details]
> Skript zum Erstellen von Extended-Attributes
> 
> Das angehängte Skript provoziert diesen Fehler, wenn man im UMC einen Benutzer
> anzeigt. Der Traceback wird jetzt verhindert, die entsprechenden Objekt
> ignoriert und mit einer Fehlermeldung im Log-File quittiert.
Ja, Verhalten nachgestellt. Traceback erscheint nicht mehr, im Log ist ein Warning.

Changelog vorhanden.
Comment 8 Stefan Gohmann univentionstaff 2012-07-20 15:24:25 CEST
UCS 3.0-2 has been released: 
  http://forum.univention.de/viewtopic.php?f=54&t=1905

If this error occurs again, please use "Clone This Bug".