Bug 40885 - KeyError: 'subnet' when switching from forward-zone to reverse-zone
KeyError: 'subnet' when switching from forward-zone to reverse-zone
Status: REOPENED
Product: UCS
Classification: Unclassified
Component: UMC - DNS
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 4.1-x
Assigned To: UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-11 08:49 CET by Florian Best
Modified: 2024-01-12 10:17 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.091
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2022052421000599, 2018051921000026, 2018051021000355, 2018031821000595, 2018012421001059, 2018011621000084, 2016100221000168, 2017051221000504, 2017100421000144, 2017110121000577, 2020112221000138
Bug group (optional): Error handling, External feedback
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-03-11 08:49:31 CET
Version:
4.1-1 errata123 (Vahr)

Execution of command 'udm/query dns/dns' has failed:

Traceback (most recent call last):
  File "%PY2.7%/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "%PY2.7%/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 532, in _thread
    result = module.search(container, objectProperty, objectPropertyValue, superordinate, scope=scope, hidden=hidden)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 84, in _decorated
    return method(*args, **kwargs)
  File "%PY2.7%/univention/management/console/ldap.py", line 135, in _decorated
    result = func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 471, in search
    result = self.module.lookup(None, ldap_connection, filter_s, base=container, superordinate=superordinate, scope=scope, sizelimit=sizelimit)
  File "%PY2.7%/univention/admin/handlers/dns/dns.py", line 112, in lookup
    ret+= univention.admin.handlers.dns.ptr_record.lookup(co, lo, filter_s, base, superordinate, scope, unique, required, timeout, sizelimit)
  File "%PY2.7%/univention/admin/handlers/dns/ptr_record.py", line 137, in lookup
    filter.expressions.append(univention.admin.filter.expression('zoneName', superordinate.mapping.mapValue('subnet', superordinate['subnet'])))
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 302, in __getitem__
    elif not key in self.__no_default and self.descriptions[key].editable:
KeyError: 'subnet'
Comment 1 Florian Best univentionstaff 2016-03-11 08:57:24 CET
This happens if the specified superordinate in the request is not a dns/reverse_zone. My guess is that this happens when changing the zone from a reverse-zone to a forward-zone, then a automatic search is triggered but the search form widgets are still not updated so that they search for pointer records underneath of a forward zone. Here is a example request using curl which reproduces the error:

curl 'http://Administrator:univention@xen3.school.local/univention-management-console/command/udm/query' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary '{"options":{"superordinate":"cn=dns,dc=school,dc=local","objectType":"dns/ptr_record","objectProperty":"None","objectPropertyValue":"","hidden":false,"fields":["name","ptr_record","path"]},"flavor":"dns/dns"}'
Comment 2 Florian Best univentionstaff 2016-03-11 08:59:40 CET
Very similar is this one (found by myself) - but not reliable reproducible / during interim version:

Die Ausführung des Kommandos udm/query dns/dns ist fehlgeschlagen:

Traceback (most recent call last):
  File "%PY2.7%/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "%PY2.7%/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 535, in _thread
    result = module.search(container, objectProperty, objectPropertyValue, superordinate, scope=scope, hidden=hidden)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 86, in _decorated
    return method(*args, **kwargs)
  File "%PY2.7%/univention/management/console/ldap.py", line 135, in _decorated
    result = func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 471, in search
    result = self.module.lookup(None, ldap_connection, filter_s, base=container, superordinate=superordinate, scope=scope, sizelimit=sizelimit)
  File "%PY2.7%/univention/admin/handlers/dns/dns.py", line 94, in lookup
    ret+=univention.admin.handlers.dns.host_record.lookup(co, lo, filter_s, base, superordinate, scope, unique, required, timeout, sizelimit)
  File "%PY2.7%/univention/admin/handlers/dns/host_record.py", line 250, in lookup
    for dn, attrs in lo.search(unicode(filter), base, scope, [], unique, required, timeout, sizelimit):
  File "%PY2.7%/univention/admin/uldap.py", line 359, in search
    raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), filter))
ldapError: Bad search filter:
(&(objectClass=dNSZone)(!(relativeDomainName=@))(!(zoneName=*.in-addr.arpa))(!(zoneName=*.ip6.arpa))(!(cNAMERecord=*))(!(sRVRecord=*))(|(aRecord=*)(aAAARecord=*)(mXRecord=*))(zoneName=sc
hool.local)(ptr_record=*))


Remark:
Von Reverse Zone 10. mit Suche nach PTR-Record-Attribut gewechselt auf Forward-Zone school.local, die autosearch hat den Traceback ausgelöst.

curl 'https://Administrator:univention@xen3.school.local/univention-management-co[..]'  -H 'Content-Type: application/json'  -H 'X-Requested-With: XMLHttpRequest' --data-binary
'{"options":{"superordinate":"zoneName=school.local,cn=dns,dc=school,dc=local","objectType":"dns/dns","objectProperty":"ptr_record","objectPropertyValue":"*","hidden":false,"fields":["name",
"ptr_record","$value$","labelObjectType"]},"flavor":"dns/dns"}'

Version:
4.1-1 errata122 (Vahr)
Comment 3 Florian Best univentionstaff 2016-03-18 12:39:45 CET
Reported again, 4.0-3 errata363 (Walle)
Comment 4 Florian Best univentionstaff 2016-07-15 12:27:51 CEST
Reported again, 4.1-2 errata210 (Vahr)
Comment 5 Florian Best univentionstaff 2016-10-04 12:44:36 CEST
Reported again, 4.1-3 errata282 (Vahr)

Remark: unknown
Comment 6 Florian Best univentionstaff 2016-11-04 22:26:59 CET
I think the frontend behavior has been fixed by http://errata.software-univention.de/ucs/4.1/321.html (a request with a container as superordinate is prevented, the form also doesn't have an superordinate widget anymore but uses the selected item from the tree directly). I can't prove because it's not reproducible. The traceback may still occur when doing a request mentioned in comment #1. Therefore leaving open.
Comment 7 Florian Best univentionstaff 2017-05-16 13:19:34 CEST
Version: 4.2-0 errata15 (Lesum)

Remark: ooo

Execution of command 'udm/query dns/dns' has failed:

Traceback (most recent call last):
  File "%PY2.7%/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "%PY2.7%/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 545, in _thread
    result = module.search(container, objectProperty, objectPropertyValue, superordinate, scope=scope, hidden=hidden)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 86, in _decorated
    return method(*args, **kwargs)
  File "%PY2.7%/univention/management/console/ldap.py", line 143, in _decorated
    result = func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 476, in search
    result = self.module.lookup(None, ldap_connection, filter_s, base=container, superordinate=superordinate, scope=scope, sizelimit=sizelimit)
  File "%PY2.7%/univention/admin/handlers/dns/ptr_record.py", line 227, in lookup
    filter.expressions.append(univention.admin.filter.expression('zoneName', superordinate.mapping.mapValue('subnet', superordinate['subnet'])))
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 277, in __getitem__
    elif key not in self.__no_default and self.descriptions[key].editable:
KeyError: 'subnet'
Comment 8 Florian Best univentionstaff 2017-10-12 20:26:59 CEST
Version: 4.2-2 errata189 (Lesum)

Remark: Expanding DNS tree.
Comment 9 Florian Best univentionstaff 2017-11-10 15:00:31 CET
Version: 4.1-0 errata55 (Vahr)

Remark: Host Record für ***.ch erzeugt mit Host-Record @
Comment 10 Johannes Keiser univentionstaff 2018-01-19 16:32:54 CET
Reported again: Version: 4.2-3 errata262 (Lesum)
Comment 11 Johannes Keiser univentionstaff 2018-02-16 12:12:06 CET
Reported again: Version: 4.2-3 errata52 (Lesum)

Remark: record created with @sign
Comment 12 Johannes Keiser univentionstaff 2018-04-27 18:03:17 CEST
Reported again: Version: 4.3-0 errata0 (Neustadt)
Comment 13 Johannes Keiser univentionstaff 2018-05-11 19:04:31 CEST
Reported again: Version: 4.2-3 errata418 (Lesum)

Internal server error during "udm/query (dns/dns)".
Request: udm/query (dns/dns)

Traceback (most recent call last):
  File "%PY2.7%/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "%PY2.7%/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 561, in _thread
    result = module.search(container, objectProperty, objectPropertyValue, superordinate, scope=scope, hidden=hidden)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 82, in _decorated
    return method(*args, **kwargs)
  File "%PY2.7%/univention/management/console/ldap.py", line 143, in _decorated
    result = func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 484, in search
    result = self.module.lookup(None, ldap_connection, filter_s, base=container, superordinate=superordinate, scope=scope, sizelimit=sizelimit)
  File "%PY2.7%/univention/admin/handlers/dns/dns.py", line 105, in lookup
    ret += univention.admin.handlers.dns.ptr_record.lookup(co, lo, ptr_filter, base, superordinate, scope, unique, required, timeout, sizelimit)
  File "%PY2.7%/univention/admin/handlers/dns/ptr_record.py", line 227, in lookup
    filter.expressions.append(univention.admin.filter.expression('zoneName', superordinate.mapping.mapValue('subnet', superordinate['subnet'])))
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 329, in __getitem__
    elif key not in self.__no_default and self.descriptions[key].editable:
KeyError: 'subnet'

Role: domaincontroller_master
Comment 14 Johannes Keiser univentionstaff 2018-05-25 20:21:09 CEST
Reported again:  Version: 4.3-0 errata84 (Neustadt)

Remark: Browsing DNS, no change being made.

Internal server error during "udm/query (dns/dns)".
Request: udm/query (dns/dns)

Traceback (most recent call last):
  File "%PY2.7%/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "%PY2.7%/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 561, in _thread
    result = module.search(container, objectProperty, objectPropertyValue, superordinate, scope=scope, hidden=hidden)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 83, in _decorated
    return method(*args, **kwargs)
  File "%PY2.7%/univention/management/console/ldap.py", line 143, in _decorated
    result = func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 485, in search
    result = self.module.lookup(None, ldap_connection, filter_s, base=container, superordinate=superordinate, scope=scope, sizelimit=sizelimit)
  File "%PY2.7%/univention/admin/handlers/dns/ptr_record.py", line 230, in lookup
    filter.expressions.append(univention.admin.filter.expression('zoneName', superordinate.mapping.mapValue('subnet', superordinate['subnet']), escape=True))
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 429, in __getitem__
    elif key not in self.__no_default and self.descriptions[key].editable:
KeyError: 'subnet'
Comment 15 Stefan Gohmann univentionstaff 2019-01-03 07:17:48 CET
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.
Comment 16 Christian Castens univentionstaff 2021-01-26 13:46:05 CET
reported again:

Version: 4.4-6 errata814 (Blumenthal)

Remark: occurred when selecting dns zone from left panel on DNS module screen

Error:
Internal server error during "udm/query (dns/dns)".
Request: udm/query (dns/dns)

  File "%PY2.7%/notifier/threads.py", line 80, in _run
    result = self._function()
  File "%PY2.7%/notifier/__init__.py", line 104, in __call__
    return self._function(*tmp, **self._kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 605, in _thread
    result = module.search(container, objectProperty, objectPropertyValue, superordinate, scope=scope, hidden=hidden)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 681, in search
    result = self.module.lookup(None, ldap_connection, filter_s, base=container, superordinate=superordinate, scope=scope, sizelimit=sizelimit, **kwargs)
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 1737, in lookup
    filter_s = cls.lookup_filter_superordinate(filter_s, superordinate)
  File "%PY2.7%/univention/admin/handlers/dns/ptr_record.py", line 211, in lookup_filter_superordinate
    filter.expressions.append(univention.admin.filter.expression('zoneName', superordinate.mapping.mapValue('subnet', superordinate['subnet']), escape=True))
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 478, in __getitem__
    elif key not in self.__no_default and self.descriptions[key].editable:
KeyError: 'subnet'
Comment 17 Maximilian Janßen univentionstaff 2022-05-25 18:05:19 CEST
Version: 5.0-1 errata310

Remark: Was trying to write a DynamicDNS application using Univention's LDAP- please feel free to reach out with questions because I'm not sure if I'm doing this properly or not.
Comment 18 Mika Westphal univentionstaff 2023-09-18 12:43:59 CEST
2023081821000165  5.0-2 errata703

Internal server error during "udm/query (dns/dns)".
Request: udm/query (dns/dns)

Traceback (most recent call last):
  File "%PY3%/notifier/threads.py", line 80, in _run
    result = self._function()
  File "%PY3%/notifier/__init__.py", line 105, in __call__
    return self._function(*tmp, **self._kwargs)
  File "%PY3%/univention/management/console/modules/udm/__init__.py", line 612, in _thread
    result = module.search(container, objectProperty, objectPropertyValue, superordinate, scope=scope, hidden=hidden, allow_asterisks=USE_ASTERISKS)
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 677, in search
    result = self.module.lookup(None, ldap_connection, filter_s, base=container, superordinate=superordinate, scope=scope, sizelimit=sizelimit, **kwargs)
  File "%PY3%/univention/admin/handlers/__init__.py", line 1792, in lookup
    filter_s = cls.lookup_filter_superordinate(filter_s, superordinate)
  File "%PY3%/univention/admin/handlers/dns/ptr_record.py", line 221, in lookup_filter_superordinate
    filter.expressions.append(univention.admin.filter.expression('zoneName', superordinate.mapping.mapValueDecoded('subnet', superordinate['subnet']), escape=True))
  File "%PY3%/univention/admin/handlers/__init__.py", line 478, in __getitem__
    elif key not in self.__no_default and self.descriptions[key].editable:
KeyError: 'subnet'
Comment 19 Mika Westphal univentionstaff 2024-01-12 10:17:59 CET
2023122621000231  5.0-6 errata904

Internal server error during "udm/query (dns/dns)".
Request: udm/query (dns/dns)

Traceback (most recent call last):
  File "%PY3%/univention/management/console/modules/decorators.py", line 259, in _run
    result = self._function(*args, **kwargs)  # type: Union[BaseException, _T]
  File "%PY3%/univention/management/console/modules/udm/__init__.py", line 601, in query
    result = module.search(container, objectProperty, objectPropertyValue, superordinate, scope=scope, hidden=hidden, allow_asterisks=USE_ASTERISKS)
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 681, in search
    result = self.module.lookup(None, ldap_connection, filter_s, base=container, superordinate=superordinate, scope=scope, sizelimit=sizelimit, **kwargs)
  File "%PY3%/univention/admin/handlers/__init__.py", line 1802, in lookup
    filter_s = cls.lookup_filter_superordinate(filter_s, superordinate)
  File "%PY3%/univention/admin/handlers/dns/ptr_record.py", line 220, in lookup_filter_superordinate
    filter.expressions.append(univention.admin.filter.expression('zoneName', superordinate.mapping.mapValueDecoded('subnet', superordinate['subnet']), escape=True))
  File "%PY3%/univention/admin/handlers/__init__.py", line 479, in __getitem__
    elif key not in self.__no_default and self.descriptions[key].editable:
KeyError: 'subnet'