Bug 56568 - Searching for property 'hardware address' of DHCP Hosts results in error using UMC
Searching for property 'hardware address' of DHCP Hosts results in error usin...
Status: RESOLVED DUPLICATE of bug 55604
Product: UCS
Classification: Unclassified
Component: UMC - DHCP
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-09-11 13:34 CEST by Wolfgang Bayrhof
Modified: 2023-09-11 13:51 CEST (History)
1 user (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: 2023082821000333
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bayrhof univentionstaff 2023-09-11 13:34:15 CEST
Customers uses static assignment to defined MAC addresses. Before they create a new DHCP-Host-Record they wanna check for already existing records by using the search functionality in UMC/DHCP.

Follow this to reproduce the error:

Select 'DHCP' -> <network>obj -> Type "DHCP: Host" -> Property "Hardware address" -> Hardware address in format xx:xx:xx:xx:xx:xx -> Press the search button 

results in:

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

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 259, in _run
    result = self._function(*args, **kwargs)  # type: Union[BaseException, _T]
  File "/usr/lib/python3/dist-packages/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 "/usr/lib/python3/dist-packages/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 "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 1800, in lookup
    filter_s = cls.lookup_filter(filter_s, lo)
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 1831, in lookup_filter
    filter_p.append_unmapped_filter_string(filter_s, cls.rewrite_filter, module.mapping)
  File "/usr/lib/python3/dist-packages/univention/admin/filter.py", line 124, in append_unmapped_filter_string
    walk(filter_p, rewrite_function, arg=mapping)
  File "/usr/lib/python3/dist-packages/univention/admin/filter.py", line 316, in walk
    walk(e, expression_walk_function, conjunction_walk_function, arg)
  File "/usr/lib/python3/dist-packages/univention/admin/filter.py", line 321, in walk
    expression_walk_function(filter_p, arg)
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 1904, in rewrite_filter
    filter.value = mapping.mapValueDecoded(key, filter.value, encoding_errors='ignore')
  File "/usr/lib/python3/dist-packages/univention/admin/mapping.py", line 556, in mapValueDecoded
    value = self.mapValue(map_name, value, encoding_errors=errors)
  File "/usr/lib/python3/dist-packages/univention/admin/mapping.py", line 548, in mapValue
    value = map_value(value, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/dhcp/host.py", line 113, in mapHWAddress
    return old.encode(*encoding)
AttributeError: 'list' object has no attribute 'encode'

The same happens searching via UMC/LDAP directory.

in the log management-console-module-udm.log (debug level 5):

08.09.23 19:05:10.501  MODULE      ( PROCESS ) : Received request 'udm/nav/object/query': ('Administrator', 'navigation', None, 'en_US.UTF-8')
08.09.23 19:05:10.501  ADMIN       ( INFO    ) : identify: found module dhcp/service on cn=network,cn=dhcp,dc=musterfirma1,dc=intranet
08.09.23 19:05:10.502  MODULE      ( ALL     ) : Executed handler
08.09.23 19:05:10.502  MODULE      ( INFO    ) : Query defines a superordinate cn=network,cn=dhcp,dc=musterfirma1,dc=intranet
08.09.23 19:05:10.503  MODULE      ( INFO    ) : Found LDAP object cn=network,cn=dhcp,dc=musterfirma1,dc=intranet
08.09.23 19:05:10.503  MODULE      ( INFO    ) : Found UDM module 'dhcp/service' for superordinate cn=network,cn=dhcp,dc=musterfirma1,dc=intranet
08.09.23 19:05:10.503  MODULE      ( INFO    ) : Searching for LDAP objects: container = cn=network,cn=dhcp,dc=musterfirma1,dc=intranet, filter = (|(hwaddress=*38:f3:ab:cd:10:9f*)(hwaddress=38:f3:ab:cd:10:9f)), superordinate = <univention.admin.handlers.dhcp.service.object object at 0x7f6067d2e780>
08.09.23 19:05:10.503  ADMIN       ( INFO    ) : host.py: mapHWAddress: old: ['*38:f3:ab:cd:10:9f*']
08.09.23 19:05:10.503  MODULE      ( PROCESS ) : Internal server error during "udm/nav/object/query (navigation)".
08.09.23 19:05:10       ERROR      (    29863) : 591 POST /univention/command/udm/nav/object/query (0.0.0.0) 7.70ms

Workaround on the shell:
udm dhcp/host list | grep -i xx:xx:xx:xx:xx:xx

example:
root@mf1primary:~# udm dhcp/host list | grep -i -B2 38:F3:ab:cd:10:9f
  fixedaddress: 1.1.1.2
  host: host2
  hwaddress: ethernet 38:f3:ab:cd:10:9f

This bug means less comfort for customers using static IP assignments to devices via DHCP, because checking for existing entries via UMC is not possible.

Tests were done with:
UCS: 5.0-4 errata798
Comment 1 Florian Best univentionstaff 2023-09-11 13:51:03 CEST

*** This bug has been marked as a duplicate of bug 55604 ***