[PATCH] python indent bugfix in dns_hub.py

Stefan Metzmacher metze at samba.org
Wed Jan 23 18:00:52 UTC 2019


Am 23.01.19 um 17:53 schrieb Jeremy Allison via samba-technical:
> On Wed, Jan 23, 2019 at 11:43:34AM +0200, Isaac Boukris wrote:
>> Hi Tim & Jeremy,
>>
>> On Tue, Jan 22, 2019 at 11:11 PM Tim Beale <timbeale at catalyst.net.nz> wrote:
>>>
>>> Hi Isaac,
>>>
>>> I think what you're seeing is the same essential problem (slowness
>>> responding to the DNS query), it's just manifesting in a different way.
>>> In your case it looks like it's taking longer than 5 seconds, so the
>>> s.recv() times out. In my case, it's taking less than 5 seconds, so the
>>> s.recv() is OK, but the sock.sendto() fails (because the client has
>>> given up).
>>
>> Note that the error I get locally isn't necessarily exactly the same
>> as the one I got on GitLab. I only noticed the same final error:
>> ERROR: Failed to find a writeable DC for domain 'SAMBA.EXAMPLE.COM':
>> The object name is not found.
>>
>> See logs from my local machine on current master (which already
>> includes the increase of DNS_REQUEST_TIMEOUT) in attached
>> current_master.log file.
>>
>>> You could try increasing the timeout dns_hub,py uses (e.g. attached).
>>
>> I tried it anyway, but it didn't make any difference.
>>
>> On Wed, Jan 23, 2019 at 3:07 AM Jeremy Allison <jra at samba.org> wrote:
>>>
>>> Here is my test python-retry patchset. As per Metze's instructions
>>> DO NOT PUSH ! :-).
>>>
>>> I'm running it in gitlab-ci right now, and wondered if you could
>>> see if it fixes Isaac's issues ?
>>
>> I still get the same error on my local machine, with this patch
>> applied. See log in attached with_jras_patch.log file. Sorry. I'll try
>> to take a closer look into my local replica.
> 
> Yeah, this is starting to look like something strange in your
> local environment.
> 
> My latest gitlab-ci test (with my retry patch applied) had
> no trouble finding 'a writeable DC for domain 'SAMBA.EXAMPLE.COM''
> 
> INFO 2019-01-23 01:45:35,280 pid:29201 bin/python/samba/join.py #103: Finding a writeable DC for domain 'SAMBA2000.EXAMPLE.COM'
> dns_hub: sending 127.0.0.25 to address ('127.0.0.39', 39203) for name _ldap._tcp.SAMBA2000.EXAMPLE.COM
> 
> With the increase of DNS_REQUEST_TIMEOUT the gitlab-ci
> builds now seem much more stable (modulo the usual unexplained
> flakeyness :-).

I had the following problem a few times, that
the join itself worked fine, but the 'samba-tool drs replicate' commands
fail after we started the new vampire_dc (more details at the end)

I found a reproducer for this problem:

In provision_vampire_dc() I added:
   $ctx->{samba_dnsupdate} = "/bin/true";
after the call to provision_raw_prepare().

The core problem is that 'samba_dnsupdate' sometimes fails to run
within 20 seconds. I see
"dnsupdate_nameupdate_done: Failed DNS update with exit code 110",
where 110 is ETIMED.

samba-tool drs replicate needs to resolve the
$NTDSGUID._msdcs.$DNSDOMAIN name in order to work, which may fail.

samba-tool domain join already adds that name to the database of the
used server and replicates this back before it finishes.
But we're using the RESOLV_WRAPPER_HOSTS file instead of real dns
and samba_dnsupdate with --use-file.

I think we need to call samba_dnsupdate explicit after the join,
if we make use of --use-file in order to avoid the problem.

In the long run we need to remove the RESOLV_WRAPPER_HOSTS usage.

metze

Attempting to autogenerate TLS self-signed keys for https for hostname
'VAMPIRE2000DC.samba2000.example.com'
TLS self-signed keys generated OK
/tmp/samba-testbase/b17/samba-ad-dc-2/bin/winbindd: mkdir failed on
directory /tmp/samba-testbase/b17/prefix/samba-ad-dc-2/var/cores: No
such file or directory
/tmp/samba-testbase/b17/samba-ad-dc-2/bin/winbindd: Failed to create
/tmp/samba-testbase/b17/prefix/samba-ad-dc-2/var/cores for user 0 with
mode 0700
/tmp/samba-testbase/b17/samba-ad-dc-2/bin/winbindd: Unable to setup
corepath for winbindd: No such file or directory
/tmp/samba-testbase/b17/samba-ad-dc-2/bin/winbindd: mkdir failed on
directory /tmp/samba-testbase/b17/prefix/samba-ad-dc-2/var/cores: No
such file or directory
/tmp/samba-testbase/b17/samba-ad-dc-2/bin/winbindd: Failed to create
/tmp/samba-testbase/b17/prefix/samba-ad-dc-2/var/cores for user 0 with
mode 0700
/tmp/samba-testbase/b17/samba-ad-dc-2/bin/winbindd: Unable to setup
corepath for winbindd: No such file or directory
/tmp/samba-testbase/b17/samba-ad-dc-2/bin/winbindd: winbindd version
4.11.0pre1-DEVELOPERBUILD started.
/tmp/samba-testbase/b17/samba-ad-dc-2/bin/winbindd: Copyright Andrew
Tridgell and the Samba Team 1992-2019
/tmp/samba-testbase/b17/samba-ad-dc-2/bin/winbindd:
initialize_winbindd_cache: clearing cache and re-creating with version
number 2
/tmp/samba-testbase/b17/samba-ad-dc-2/bin/winbindd: daemon_ready: daemon
'winbindd' finished starting up and ready to serve connections
../../source4/rpc_server/drsuapi/getncchanges.c:2933: DsGetNCChanges 2nd
replication on DN DC=samba2000,DC=example,DC=com older highwatermark
(last_dn CN=test_anon
ymous\0ADEL:439c494b-f33e-42ce-8176-1776a3b16e11,CN=Deleted
Objects,DC=samba2000,DC=example,DC=com)
Doing a full scan on DC=samba2000,DC=example,DC=com and looking for
deleted objects
Doing a full scan on CN=Configuration,DC=samba2000,DC=example,DC=com and
looking for deleted objects
dnsupdate_nameupdate_done: Failed DNS update with exit code 110
ERROR(<class 'samba.drs_utils.drsException'>): DsReplicaSync failed -
drsException: DsReplicaSync failed (2, 'WERR_FILE_NOT_FOUND')
  File "bin/python/samba/netcmd/drs.py", line 574, in run
    drs_utils.sendDsReplicaSync(server_bind, server_bind_handle,
source_dsa_guid, NC, req_options)
  File "bin/python/samba/drs_utils.py", line 92, in sendDsReplicaSync
    raise drsException("DsReplicaSync failed %s" % estr)
Failed to replicate
NSS_WRAPPER_HOSTS='/tmp/samba-testbase/b17/samba-ad-dc-2/bin/ab/hosts'
SOCKET_WRAPPER_DEFAULT_IFACE="39"
RESOLV_WRAPPER_HOSTS="/tmp/samba-testbase/b17/samba-ad-dc-
2/bin/ab/dns_host_file"
KRB5_CONFIG="/tmp/samba-testbase/b17/samba-ad-dc-2/bin/ab/vampire_2000_dc/etc/krb5.conf"KRB5CCNAME="/tmp/samba-testbase/b17/samba-ad-dc-2/
bin/ab/vampire_2000_dc/krb5_ccache"
RESOLV_CONF="/tmp/samba-testbase/b17/samba-ad-dc-2/bin/ab/dns_hub/rootdnsforwarder/resolv.conf"
 python3 ./bin/samba-tool drs r
eplicate dc5 vampire2000dc
--configfile=/tmp/samba-testbase/b17/samba-ad-dc-2/bin/ab/fl2000dc/etc/smb.conf
-UAdministrator%locDCpass5
"CN=Configuration,DC=SAMBA2000,DC=EXAMPLE,DC=COM" at
/tmp/samba-testbase/b17/samba-ad-dc-2/selftest/target/Samba4.pm line 2530.
failed to start up environment 'vampire_2000_dc' at
/tmp/samba-testbase/b17/samba-ad-dc-2/selftest/target/Samba.pm line 83.
samba can't start up known environment 'vampire_2000_dc' at
/tmp/samba-testbase/b17/samba-ad-dc-2/selftest/selftest.pl line 983.
server_stdin_handler: samba: EOF on stdin - PID 29249 terminating



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190123/10a12f64/signature.sig>


More information about the samba-technical mailing list