Bug 53252 - univention-register-network-address returns error if nothing needs to be done
univention-register-network-address returns error if nothing needs to be done
Status: NEW
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-05-12 11:47 CEST by Arvid Requate
Modified: 2023-11-09 08:39 CET (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.051
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
hahn: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2021-05-12 11:47:52 CEST
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'}
Comment 1 Philipp Hahn univentionstaff 2023-05-23 17:35:55 CEST
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.
Comment 2 Philipp Hahn univentionstaff 2023-11-09 08:39:46 CET
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)