SORRY to warm up this one again. I have the same error but can’t repair it with these commands due to another error when trying to apply the corrections:
The last command throws
kinit: krb5_get_init_creds: Client (DNS/ucs-001.FRITZ.BOX@FRITZ.BOX) unknown
So I tried to execute the lines starting with
udm users/user delete --dn=uid=dns-$(hostname),cn=users,$(ucr get ldap/base)
After this first command in the S4-log I can see the following:
31.10.2020 13:55:27.322 LDAP (PROCESS): sync from ucs: [ user] [ delete] cn=dns-ucs-001,cn=users,DC=fritz,DC=box
31.10.2020 13:55:27.341 LDAP (PROCESS): sync from ucs: [ group] [ modify] cn=domain users,cn=groups,DC=fritz,DC=box
31.10.2020 13:55:28.365 LDAP (PROCESS): object_from_element: DN of removed object: u'cn=dns-ucs-001,CN=Users,DC=fritz,DC=box'
31.10.2020 13:55:28.370 LDAP (PROCESS): sync to ucs: [ user] [ delete] u'uid=dns-ucs-001,cn=users,dc=fritz,dc=box'
31.10.2020 13:55:28.371 LDAP (WARNING): Object to delete doesn't exists, ignore (u'uid=dns-ucs-001,cn=users,dc=fritz,dc=box')
then:
root@ucs-001:~# ldbdel -H /var/lib/samba/private/secrets.ldb "samAccountName=dns-$(hostname),CN=Principles"
delete of 'samAccountName=dns-ucs-001,CN=Principles' failed - (No such object) ldb_wait from (null) with LDB_WAIT_ALL: No such object (32)
and nothing in the S4-log.
then:
root@ucs-001:~# /usr/share/univention-samba4/scripts/create_spn_account.sh --samaccountname "dns-$(hostname)" --serviceprincipalname "DNS/$(hostname).$(ucr get domainname)" --privatekeytab dns.keytab
Object created: uid=dns-ucs-001,cn=users,dc=fritz,dc=box
looking for spn account "dns-ucs-001" in local samba
looking for spn account "dns-ucs-001" in local samba
Modified 1 records successfully
Modified 1 records successfully
Expiry for user 'dns-ucs-001' disabled.
S4-log:
31.10.2020 13:58:19.947 LDAP (PROCESS): sync from ucs: [ user] [ add] cn=dns-ucs-001,cn=users,DC=fritz,DC=box
31.10.2020 13:58:20.000 LDAP (PROCESS): sync from ucs: [ group] [ modify] cn=domain users,cn=groups,DC=fritz,DC=box
31.10.2020 13:58:21.038 LDAP (PROCESS): sync to ucs: [ user] [ modify] u'uid=dns-ucs-001,cn=users,dc=fritz,dc=box'
31.10.2020 13:58:27.169 LDAP (PROCESS): sync from ucs: [ user] [ modify] cn=dns-ucs-001,cn=users,DC=fritz,DC=box
31.10.2020 13:58:28.186 LDAP (PROCESS): sync to ucs: [ user] [ modify] u'uid=dns-ucs-001,cn=users,dc=fritz,dc=box'
31.10.2020 13:58:34.231 LDAP (PROCESS): sync to ucs: [ user] [ modify] u'uid=dns-ucs-001,cn=users,dc=fritz,dc=box'
then:
root@ucs-001:~# /usr/share/univention-s4-connector/resync_object_from_s4.py "cn=dns-$(hostname),cn=users,$(ucr get samba4/ldap/base)"
resync triggered for cn=dns-ucs-001,cn=users,DC=FRITZ,DC=BOX
Estimated sync in 50 seconds.
S4-log:
31.10.2020 14:02:10.996 LDAP (PROCESS): sync to ucs: Resync rejected dn: cn=dns-ucs-001,cn=users,DC=FRITZ,DC=BOX
31.10.2020 14:02:11.012 LDAP (PROCESS): sync to ucs: [ user] [ modify] u'uid=dns-ucs-001,cn=users,dc=fritz,dc=box'
31.10.2020 14:02:16.110 LDAP (PROCESS): sync from ucs: [ user] [ modify] cn=dns-ucs-001,cn=users,DC=fritz,DC=box
31.10.2020 14:02:17.156 LDAP (PROCESS): sync to ucs: [ user] [ modify] u'uid=dns-ucs-001,cn=users,dc=fritz,dc=box'
The resync-error is probably not what’s expected and at the end the kinit error still exists after applying all the rest.
Any advice to solve the ldap problem?