Bug 35099 - LDAP inconsistency/UDM traceback if network object gets removed
LDAP inconsistency/UDM traceback if network object gets removed
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Networks
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 4.0-0-errata
Assigned To: Florian Best
Arvid Requate
:
Depends on:
Blocks: 37377 37668 37769
  Show dependency treegraph
 
Reported: 2014-06-11 09:35 CEST by Florian Best
Modified: 2015-02-11 09:31 CET (History)
8 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:
Ticket number:
Bug group (optional): Error handling, External feedback
Max CVSS v3 score:


Attachments
dirty patch (1.34 KB, patch)
2014-12-02 00:38 CET, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2014-06-11 09:35:41 CEST
We received the following traceback on a UCS@school 3.2R2 UCS 3.2-2 errata121 (Borgfeld).
We had similar tracebacks before due to missing objects/containers in the OU structure.

Traceback:
Die Ausführung des Kommandos schoolwizards/computers/query ist fehlgeschlagen:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py",
line 204, in execute
    func( request )
  File "/usr/lib/pymodules/python2.6/ucsschool/lib/schoolldap.py", line 204, in
wrapper_func
    return func( *args, **kwargs )
  File
"/usr/lib/pymodules/python2.6/univention/management/console/modules/schoolwizards/__init__.py",
line 118, in _decorated
    ret = func(self, request, *a, **kw)
  File
"/usr/lib/pymodules/python2.6/univention/management/console/modules/schoolwizards/__init__.py",
line 269, in get_computers
    return self._get_all(computer_class, school, request.options.get('filter'),
ldap_user_read)
  File
"/usr/lib/pymodules/python2.6/univention/management/console/modules/schoolwizards/__init__.py",
line 246, in _get_all
    objs.extend(klass.get_all(lo, school.name, filter_str=filter_str, easy_filter=True))
  File "/usr/lib/pymodules/python2.6/ucsschool/lib/models/base.py", line 652, in get_all
    obj = cls.from_udm_obj(udm_obj, school, lo)
  File "/usr/lib/pymodules/python2.6/ucsschool/lib/models/computer.py", line 258, in
from_udm_obj
    obj = super(SchoolComputer, cls).from_udm_obj(udm_obj, school, lo)
  File "/usr/lib/pymodules/python2.6/ucsschool/lib/models/base.py", line 682, in
from_udm_obj
    return klass.from_udm_obj(udm_obj, school, lo)
  File "/usr/lib/pymodules/python2.6/ucsschool/lib/models/computer.py", line 270, in
from_udm_obj
    netmask = Network.get_netmask(network_dn, school, lo)
  File "/usr/lib/pymodules/python2.6/ucsschool/lib/models/network.py", line 108, in
get_netmask
    network = cls.from_dn(dn, school, lo)
  File "/usr/lib/pymodules/python2.6/ucsschool/lib/models/base.py", line 735, in from_dn
    udm_obj = udm_modules.lookup(cls._meta.udm_module, None, lo,
filter=cls._meta.udm_filter, base=dn, scope='base', superordinate=superordinate)[0]
  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/networks/network.py", line
332, 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 347, in search
    raise univention.admin.uexceptions.noObject, _err2str(msg)
noObject: No such object
Comment 1 Dirk Wiesenthal univentionstaff 2014-06-11 09:48:59 CEST
Happens when (auto) assigning a network object to a computer and then manually deleting this network.

Seems that the DN is still present in the computer object and points to nowhere, hence the error message.

Could be handled in the school lib, should be handled in UDM
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2014-06-11 12:25:19 CEST
(In reply to Dirk Wiesenthal from comment #1)
> Happens when (auto) assigning a network object to a computer and then
> manually deleting this network.
> 
> Seems that the DN is still present in the computer object and points to
> nowhere, hence the error message.

ACK
Removed network object in UDM and the host object still contains the following attribute:

univentionNetworkLink: \
  cn=gsmitte-10.200.98.0,cn=networks,ou=gsmitte,dc=example,dc=com
 
> Could be handled in the school lib, should be handled in UDM

→ moved bug to UCS/UDM
Comment 3 Dirk Wiesenthal univentionstaff 2014-07-22 14:18:52 CEST
Reported again
Comment 4 Dirk Wiesenthal univentionstaff 2014-08-13 14:42:27 CEST
And again...
Comment 5 Tim Petersen univentionstaff 2014-08-28 08:03:26 CEST
Reported at 2014082721000487
Comment 6 Florian Best univentionstaff 2014-12-02 00:38:43 CET
Created attachment 6490 [details]
dirty patch

attached is a starting point for a patch. Please replace the computer.open()…computer.modify() thing with another fast LDAP thing.
Does removing the network influences MAC-Adress or DNS settings?
Comment 7 Alexander Kläser univentionstaff 2014-12-17 11:10:38 CET
Please also back port the solution to 3.2 (cf. Bug 37377).
Comment 8 Florian Best univentionstaff 2015-01-14 16:54:04 CET
Comment on attachment 6490 [details]
dirty patch

svn r57320 contains a clean patch (which does not use computer.open()).
Comment 9 Florian Best univentionstaff 2015-01-19 14:50:08 CET
Merged changed to UCS 4.0-0: svn r57366
Package: univention-directory-manager-modules
Version: 10.0.29-13.1276.201501191442
Branch: ucs_4.0-0
Scope: errata4.0-0
YAML: 2014-11-28-univention-directory-manager-modules.yaml
Comment 10 Arvid Requate univentionstaff 2015-01-20 14:20:59 CET
Works and advisory is ok.
Comment 11 Florian Best univentionstaff 2015-01-20 17:17:40 CET
Reported again, 4.0-0 errata31 (Walle)

Remark:
einfacher Aufruf dieses Moduls führte zu dieser Fehlersituation
Comment 12 Janek Walkenhorst univentionstaff 2015-01-22 11:56:30 CET
<http://errata.univention.de/ucs/4.0/43.html>