Strategies to debug cpython modules during provision

William Brown william at
Tue Apr 10 01:05:27 UTC 2018


I'm trying to start on some samba4 development. During the provision
process I have encountered an error:

Setting up sam.ldb users and groups
ERROR(ldb): uncaught exception - operations error at
  File "/usr/local/samba/lib64/python2.7/site-
packages/samba/netcmd/", line 176, in _run
    return*args, **kwargs)
  File "/usr/local/samba/lib64/python2.7/site-
packages/samba/netcmd/", line 501, in run
  File "/usr/local/samba/lib64/python2.7/site-
packages/samba/provision/", line 2267, in provision
  File "/usr/local/samba/lib64/python2.7/site-
packages/samba/provision/", line 1866, in provision_fill
    next_rid=next_rid, dc_rid=dc_rid)
  File "/usr/local/samba/lib64/python2.7/site-
packages/samba/provision/", line 1527, in fill_samdb
    }, controls=["relax:0", "provision:0"])
  File "/usr/local/samba/lib64/python2.7/site-
packages/samba/provision/", line 55, in setup_add_ldif
    ldb.add_ldif(data, controls)
  File "/usr/local/samba/lib64/python2.7/site-
packages/samba/", line 229, in add_ldif
    self.add(msg, controls)

Inspecting the code, I see this is from password_hash.c's call to
smb_krb5_init_context, and reading that code in
source4/auth/kerberos/krb5_init_context.c between smb_krb5_init_context
and smb_krb5_init_context_basic I can see some areas that *could* be
the cause of the issue with regard to the system krb5.conf from MIT vs
embedded heimdal.

However to be 100% sure, I would like to attach a debugger into this
process so that I can observe the error.

As I haven't debugging the samba-tool domain provision process before,
I would like to know if there is any advice on how to go about doing
this that could make my life a bit easier. Additionally, it would be
great to know how to "clean up" after a failed installation like this.

Thank you,

William Brown

More information about the samba-technical mailing list