Score:0

Failed to join a computer to samba domain (Zentyal) - Couldn't join realm: Insufficient permissions to join the domain

in flag

I'm relatively new Zentyal user (few months), and I love it! But I've ran into a problem I hope someone can help me with.

In my deployment I have two Zentyal servers (zentyal-1.mydomain.com and zentyal-2.mydomain.com), both running "Domain Controller and File Sharing" service. The idea is to have primary and secondary DC controller. I was using this setup successfully for a few months, meaning that I've successfully joined several Ubuntu / Windows 11 machines to it, created several users, etc.

The problem happened today when I've tried to join another Ubuntu machine, by following the same exact steps as earlier. This time I've got an error. Here's the command and the complete output (just domain name edited):

$ sudo realm join -v mydomain.com
 * Resolving: _ldap._tcp.mydomain.com
 * Performing LDAP DSE lookup on: 172.16.0.101
 * Performing LDAP DSE lookup on: 172.16.0.102
 * Successfully discovered: mydomain.com
Password for Administrator: 
 * Unconditionally checking packages
 * Resolving required packages
 * LANG=C /usr/sbin/adcli join --verbose --domain mydomain.com --domain-realm MYDOMAIN.COM --domain-controller 172.16.0.101 --login-type user --login-user Administrator --stdin-password
 * Using domain name: mydomain.com
 * Calculated computer account name from fqdn: GITLAB
 * Using domain realm: mydomain.com
 * Sending NetLogon ping to domain controller: 172.16.0.101
 * Received NetLogon info from: zentyal-1.mydomain.com
 * Wrote out krb5.conf snippet to /var/cache/realmd/adcli-krb5-gKcH27/krb5.d/adcli-krb5-conf-JlLa8m
 * Authenticated as user: [email protected]
 * Using GSS-SPNEGO for SASL bind
 * Looked up short domain name: MYDOMAIN
 * Looked up domain SID: S-1-5-21-2787685195-3023692109-2783229274
 * Using fully qualified name: gitlab.mydomain.com
 * Using domain name: mydomain.com
 * Using computer account name: GITLAB
 * Using domain realm: mydomain.com
 * Calculated computer account name from fqdn: GITLAB
 * Generated 120 character computer password
 * Using keytab: FILE:/etc/krb5.keytab
 * A computer account for GITLAB$ does not exist
 * Found well known computer container at: CN=Computers,DC=mydomain,DC=com
 * Calculated computer account: CN=GITLAB,CN=Computers,DC=mydomain,DC=com
 * Encryption type [3] not permitted.
 * Encryption type [1] not permitted.
 ! Insufficient permissions to modify computer account: CN=GITLAB,CN=Computers,DC=mydomain,DC=com: 0000202F: ../../ldb_key_value/ldb_kv_index.c:3048: Failed to re-index objectSid in CN=GITLAB,CN=Computers,DC=mydomain,DC=com - ../../ldb_key_value/ldb_kv_index.c:2893: unique index violation on objectSid in CN=GITLAB,CN=Computers,DC=mydomain,DC=com
adcli: joining domain mydomain.com failed: Insufficient permissions to modify computer account: CN=GITLAB,CN=Computers,DC=mydomain,DC=com: 0000202F: ../../ldb_key_value/ldb_kv_index.c:3048: Failed to re-index objectSid in CN=GITLAB,CN=Computers,DC=mydomain,DC=com - ../../ldb_key_value/ldb_kv_index.c:2893: unique index violation on objectSid in CN=GITLAB,CN=Computers,DC=mydomain,DC=com
 ! Insufficient permissions to join the domain
realm: Couldn't join realm: Insufficient permissions to join the domain

As you can see I've used the built-in Administrator account, and according to the output it's authenticated successfully. Yet I'm getting "Insufficient permissions to join the domain".

Any help will be appreciated!

Thanks!

cn flag
Try pre-staging the computer account at the desired OU/container.
Aleksandar Pesic avatar
in flag
@GregAskew thanks for trying to help! I've just tried to do so from "Active Directory Users and Computers" in Windows 11 which is already in the domain, but it failed. I've got error "Windows cannot create the object GITLAB because: A constraint violation occurred." There's a similar thing in the output that I've posted above: "unique index violation on objectSid in CN=GITLAB,CN=Computers,DC=mydomain,DC=com". Any idea what it means? Thanks again!
Score:0
in flag

It turned out that the database wasn't consistent. The following fixed my problem:

$ sudo samba-tool dbcheck --fix

I hope it'll help to others.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.