samba-tool tries to use IPv6 for Secondary DC, even if host doesn't have it, but Primary DC have IPv6 (Dual-Stacked).

Bug #1344400 reported by Thiago Martins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
New
Undecided
Unassigned

Bug Description

Guys,

I'm facing this problem too:
https://lists.samba.org/archive/samba/2013-March/172230.html

NOTE: I just posted this message on Samba maillist but, this seems to be a BUG, so, I'm opening it here too.

---
The problem is:

* samba-tool must use IPv6 ONLY IF the machine have IPv6.
* samba-tool must be able to join a IPv4-Only Secondary DC, into a Dual-Stacked "Samba4 AC DC".
---

I have two Samba4 AC DC, in both located in my office, dual-stacked, working like a charm.

Now, I need to deploy a third DC, located within Amazon EC2, which does NOT have IPv6.

But, samba-tool fails to join.

How can I workaround this, without enabling a tunneled IPv6 within my EC2 ?

Exemplifying:

1- ubuntu-ad-1 - Master - ok - office LAN1 - IPv4 / IPv6
2- ubuntu-ad-2 - Slave - ok - office LAN2 - IPv4 / IPv6

3- ubuntu-ad-3 - Slave can't join - AWS - IPv4-Only

---
root@ubuntu-ad-3:~# kinit administrator
Password for <email address hidden>:
Warning: Your password will expire in 40 days on Thu 28 Aug 2014 05:56:10 PM UTC
---

---
root@ubuntu-ad-3:~# samba-tool domain join central.domain.com.br DC -Uadministrator --realm=CENTRAL.DOMAIN.COM.BR --dns-backend=BIND9_DLZ
Finding a writeable DC for domain 'central.domain.com.br'
ERROR(exception): uncaught exception - Failed to find a writeable DC for domain 'central.domain.com.br'
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py", line 175, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/domain.py", line 552, in run
    machinepass=machinepass, use_ntvfs=use_ntvfs, dns_backend=dns_backend)
  File "/usr/lib/python2.7/dist-packages/samba/join.py", line 1150, in join_DC
    machinepass, use_ntvfs, dns_backend, promote_existing)
  File "/usr/lib/python2.7/dist-packages/samba/join.py", line 76, in __init__
    ctx.server = ctx.find_dc(domain)
  File "/usr/lib/python2.7/dist-packages/samba/join.py", line 262, in find_dc
    raise Exception("Failed to find a writeable DC for domain '%s'" % domain)
---

Debugging it with `strace`, I'm seeing:

---
strace -f -e trace=network samba-tool domain join CENTRAL.DOMAIN.COM.BR DC -Uadministrator --realm=CENTRAL.DOMAIN.COM.BR --dns-backend=BIND9_DLZ
.....
[pid 1533] +++ killed by SIGKILL +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=1533, si_status=SIGKILL, si_utime=0, si_stime=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:1291:XXX:85Xa::66XX", &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 'CENTRAL.DOMAIN.COM.BR'
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py", line 175, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/domain.py", line 552, in run
    machinepass=machinepass, use_ntvfs=use_ntvfs, dns_backend=dns_backend)
  File "/usr/lib/python2.7/dist-packages/samba/join.py", line 1150, in join_DC
    machinepass, use_ntvfs, dns_backend, promote_existing)
  File "/usr/lib/python2.7/dist-packages/samba/join.py", line 76, in __init__
    ctx.server = ctx.find_dc(domain)
  File "/usr/lib/python2.7/dist-packages/samba/join.py", line 262, in find_dc
    raise Exception("Failed to find a writeable DC for domain '%s'" % domain)
+++ exited with 255 +++
---

So, how can I force samba-tool to use IPv4? Since ubuntu-ad-3 doesn't have IPv6...

Thanks!
Thiago

Thiago Martins (martinx)
summary: - samba-tool tries to use IPv6, even if host doesn't have it
+ samba-tool tries to use IPv6 for Secondary DC, even if host doesn't have
+ it, but Primary DC have IPv6 (Dual-Stacked).
Thiago Martins (martinx)
description: updated
Revision history for this message
Thiago Martins (martinx) wrote :

BUG filled at Samba bugzilla:

https://bugzilla.samba.org/show_bug.cgi?id=10729

Closing it here, since it seems to be a upstream problem...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.