Univention Bugzilla – Bug 53252
univention-register-network-address returns error if nothing needs to be done
Last modified: 2023-11-09 08:39:46 CET
univention-register-network-address returns an error in case the IP address is already registered to the host. IMHO the UMC call should show idempotent behavior. If for some reason the UMC call cannot do this, then the script should properly handle it, confirming that the task is actually done and return without error. Current behavior: root@replica:~# /usr/sbin/univention-register-network-address --verbose BadRequest: 400 on master50.ucs50pt1.dev (command/ip/change): {'status': 400, 'message': 'The IP address is already in use by host record(s) for: replica', 'traceback': None, 'location': 'https://master50.ucs50pt1.dev/univention/command'}
the service is always in an unclean state when DHCP is used, which is a nuisance when looking for (other) errors: # systemctl status univention-network-common.service ● univention-network-common.service - Register current IP addresses in LDAP directory Loaded: loaded (/lib/systemd/system/univention-network-common.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2023-05-23 13:43:01 CEST; 3h 51min ago Process: 2892 ExecStart=/usr/sbin/univention-register-network-address (code=exited, status=1/FAILURE) Main PID: 2892 (code=exited, status=1/FAILURE) Mai 23 13:43:00 os0-136 systemd[1]: Starting Register current IP addresses in LDAP directory... Mai 23 13:43:01 os0-136 systemd[1]: univention-network-common.service: Main process exited, code=exited, status=1/FAILURE Mai 23 13:43:01 os0-136 systemd[1]: univention-network-common.service: Failed with result 'exit-code'. Mai 23 13:43:01 os0-136 systemd[1]: Failed to start Register current IP addresses in LDAP directory.
A variant where the hosts fails with its S4 SRV record: # /usr/sbin/univention-register-network-address --verbose BadRequest: 400 on master095.autotest095.test (command/ip/change): { 'status': 400, 'message': 'The IP address is already in use by host record(s) for: gc._msdcs, DomainDnsZones, ForestDnsZones, slave095', 'traceback': None, 'location': 'https://master095.autotest095.test/univention/command/ip' } # samba-tool dns query localhost "$(dnsdomainname)" @ ALL -U Administrator%univention Name=, Records=7, Children=0 NS: master095.autotest095.test. (flags=600000f0, serial=1, ttl=900) NS: slave095.autotest095.test. (flags=600000f0, serial=1, ttl=900) SOA: serial=87, refresh=28800, retry=7200, expire=604800, minttl=3600, ns=master095.autotest095.test., email=root.autotest095.test. (flags=600000f0, serial=87, ttl=10800) A: 10.201.0.223 (flags=600000f0, serial=1, ttl=900) A: 10.201.2.108 (flags=600000f0, serial=1, ttl=900) AAAA: fda1:dead:beef:0000:f816:3eff:fe9f:8820 (flags=600000f0, serial=1, ttl=900) AAAA: fda1:dead:beef:0000:f816:3eff:fee9:a276 (flags=600000f0, serial=1, ttl=900) Name=_kerberos, Records=1, Children=0 TXT: "AUTOTEST095.TEST" (flags=f0, serial=1, ttl=900) Name=_msdcs, Records=1, Children=0 NS: master095.autotest095.test. (flags=f0, serial=1, ttl=900) Name=_sites, Records=0, Children=1 Name=_tcp, Records=0, Children=7 Name=_udp, Records=0, Children=2 Name=DomainDnsZones, Records=0, Children=2 Name=ForestDnsZones, Records=0, Children=2 Name=master095, Records=2, Children=0 A: 10.201.0.223 (flags=f0, serial=1, ttl=900) AAAA: fda1:dead:beef:0000:f816:3eff:fe9f:8820 (flags=f0, serial=1, ttl=900) Name=SLAVE095, Records=2, Children=0 A: 10.201.2.108 (flags=f0, serial=1, ttl=900) AAAA: fda1:dead:beef:0000:f816:3eff:fee9:a276 (flags=f0, serial=1, ttl=900) Name=ucs-sso, Records=1, Children=0 A: 10.201.0.223 (flags=f0, serial=1, ttl=900)