Base system: Ubuntu 12.04.2 Samba4 version: latest git I just tried to add a second DC to an existing Samba4 domain using samba-tool But the join failed, complaining about being unable to find a writeable DC: root at elektron:~# /opt/samba4/bin/samba-tool domain join linex.r00t.la DC Finding a writeable DC for domain 'linex.r00t.la' ERROR(exception): uncaught exception - Failed to find a writeable DC for domain 'linex.r00t.la' File "/opt/samba4/lib/python2.7/site-packages/samba/netcmd/__init__.py", line 175, in _run return self.run(*args, **kwargs) File "/opt/samba4/lib/python2.7/site-packages/samba/netcmd/domain.py", line 552, in run machinepass=machinepass, use_ntvfs=use_ntvfs, dns_backend=dns_backend) File "/opt/samba4/lib/python2.7/site-packages/samba/join.py", line 1082, in join_DC machinepass, use_ntvfs, dns_backend, promote_existing) File "/opt/samba4/lib/python2.7/site-packages/samba/join.py", line 73, in __init__ ctx.server = ctx.find_dc(domain) File "/opt/samba4/lib/python2.7/site-packages/samba/join.py", line 246, in find_dc raise Exception("Failed to find a writeable DC for domain '%s'" % domain) Looking a little closer, I think the problem is IPv4/IPv6 related: The existing DC has both IPv4 and IPv6 address (and both are available via Samba4's internal DNS. Unfortunately even if the client does not own an IPv6 address (see further down below) samba-tool still tries to address the DC's LDAP server via IPv6 - and fails miserably: root at elektron:~# strace -f -e trace=network /opt/samba4/bin/samba-tool domain join linex.r00t.la DC <...> [pid 1640] socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 5 [pid 1640] connect(5, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.6")}, 16) = 0 [pid 1640] send(5, "NQ\1\0\0\1\0\0\0\0\0\0\5venus\5linex\4r00t\2la"..., 37, MSG_NOSIGNAL) = 37 [pid 1640] recvfrom(5, "NQ\205\200\0\1\0\1\0\0\0\0\5venus\5linex\4r00t\2la"..., 1500, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.6")}, [16]) = 53 Process 1635 suspended [pid 1640] +++ killed by SIGKILL +++ Process 1635 resumed --- SIGCHLD (Child exited) @ 0 (0) --- socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = 5 setsockopt(5, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0 connect(5, {sa_family=AF_INET6, sin6_port=htons(389), inet_pton(AF_INET6, "2001:xxxx:xxxx:xxxx::2", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1 ENETUNREACH (Network is unreachable) ERROR(exception): uncaught exception - Failed to find a writeable DC for domain 'linex.r00t.la' File "/opt/samba4/lib/python2.7/site-packages/samba/netcmd/__init__.py", line 175, in _run return self.run(*args, **kwargs) File "/opt/samba4/lib/python2.7/site-packages/samba/netcmd/domain.py", line 552, in run machinepass=machinepass, use_ntvfs=use_ntvfs, dns_backend=dns_backend) File "/opt/samba4/lib/python2.7/site-packages/samba/join.py", line 1082, in join_DC machinepass, use_ntvfs, dns_backend, promote_existing) File "/opt/samba4/lib/python2.7/site-packages/samba/join.py", line 73, in __init__ ctx.server = ctx.find_dc(domain) File "/opt/samba4/lib/python2.7/site-packages/samba/join.py", line 246, in find_dc raise Exception("Failed to find a writeable DC for domain '%s'" % domain) root at elektron:~# ip a s 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 08:00:27:9e:df:48 brd ff:ff:ff:ff:ff:ff inet 192.168.1.10/24 brd 192.168.1.255 scope global eth0
the same error can pop up if the remote site has multiple IPv4 addresses and for the first one we try we have to route. We should add fallback to all registered IPs if we get a "Network is unreachable" error.
Any news on this one?
Is this a showstopper for 4.2.0?
has always been broken in samba 4 and is no blocker. no idea why this was ever maked as a blocker.
An old but still relevant issue. IPv6-only hosts cannot join as DC. After joining, IPv6 seems work fine. Is it just an issue with samba-tool?
*** Bug 15309 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of bug 15325 ***