Univention Bugzilla – Bug 54967
Join fails if system has multiple MAC addresses
Last modified: 2022-08-31 12:19:35 CEST
Notably occurs on the dpx-Hetzner Setup, if the system has two MACs. The Univention-Join Script fails at: /usr/lib/python3/dist-packages/univention/admin/uldap.py:57: ..with: ValueError: Malformed DN syntax: 'WARNING: multiple values for mac given via --set. Use --append instead!' ..when trying to parse the DN. This value comes from: /usr/share/univention-join/univention-server-join:323 ..where a univention-directory-manager command is execute, which contains multiple "--set mac=MAC_ADDRESS" generate in the code right above (L318). This causes the output passed to sed in L344 in the same file to contain a warning: [...] WARNING: multiple values for mac given via --set. Use --append instead! ..and this value later can obviously not be parsed by uldap.py and causes the join script to fail. Replacing the "set" with "append" seems to make things work as expected. The same "--set" code is repeated in L367 and presumably has the same problem, but this was not tested. Internal Links: Phoenix DevOps Issue: https://git.knut.univention.de/univention/customers/dataport/various-issues/-/issues/203 (PXGU-583) Affected Job: https://git.knut.univention.de/univention/customers/dataport/dps/ansible/playbooks/run-dphoenix/-/jobs/492902
Fixed in: commit 6c86c8c7ed047c44d3e9977de28968bff76c41c6 Bug #54967: fix univention-server-join with multiple MAC addresses using "--set" on a multivalue property prints a warning since Bug #54644 / Bug #38762 git:42c76995c60ff77196a84f08a3040c39aa9b216a git:dd9ac1745eb18052dd4dfed3bf808e47155d91f0. This disturbs the later parsing via `sed`. A real solution would be to print warnings and errors in UDM CLI to stderr (Bug #4498)!
The first commit has been reverted as `--append` only appends values but the existing values should be removed. Prior and now only 1 MAC address/IP/etc. wins and is set, even if there are multiple. Since Bug #4498 error messages are written on stderr. This fixes the initial problem. But nevertheless we need to filter out WARNINGs as the stdout/stderr output of UDM CLI is also printed by univention-server-join as error message to the user. univention-join (12.0.4-3) 785be0be7d24 | Bug #54967: filter out UDM warnings in univention-server-join b47f7d28ff57 | Revert "Bug #54967: fix univention-server-join with multiple MAC addresses" ucs-test (10.0.7-11) 4fa22575a407 | Bug #54967: migrate to pytest
Verified: * Code review * Package update * Jenkins tests show no regression * Documentation changes not required * No interoperability issues expected with non-updated systems * Test case works * Advisory
[FAIL] changes.valid: Mismatching binary package version: 12.0.4-2A~5.0.0.202207131159 != univention-join-dev 12.0.4-3A~5.0.0.202208111350 from univention-join 12.0.4-3A~5.0.0.202208111350 1 univention-join (12.0.4-3) unstable; urgency=medium 2 3 * Bug #54967: filter out UDM warnings in univention-server-join 4 5 -- Florian Best <best@univention.de> Thu, 11 Aug 2022 13:40:59 +0200
9c6d51c3d5 YAML Bug #54967
<https://errata.software-univention.de/#/?erratum=5.0x399>