Bug 54967 - Join fails if system has multiple MAC addresses
Join fails if system has multiple MAC addresses
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Join (univention-join)
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-2-errata
Assigned To: Florian Best
Arvid Requate
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-07-11 06:44 CEST by Yannik Schmidt
Modified: 2022-08-31 12:19 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Development Internal
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): bitesize, Regression
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yannik Schmidt univentionstaff 2022-07-11 06:44:01 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
Comment 1 Florian Best univentionstaff 2022-07-13 12:00:09 CEST
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)!
Comment 3 Florian Best univentionstaff 2022-08-11 14:03:36 CEST
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
Comment 4 Arvid Requate univentionstaff 2022-08-24 21:05:06 CEST
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
Comment 5 Philipp Hahn univentionstaff 2022-08-30 09:39:28 CEST
[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
Comment 6 Florian Best univentionstaff 2022-08-30 09:50:35 CEST
9c6d51c3d5 YAML Bug #54967