Bug 208837 - net/samba43: Provisioning of Active Directory Domain Controller fails
Summary: net/samba43: Provisioning of Active Directory Domain Controller fails
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: Timur I. Bakeyev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-16 18:23 UTC by mail
Modified: 2017-12-18 04:28 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (timur)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mail 2016-04-16 18:23:27 UTC
Since the update to 4.3.8 and talloc 2.1.6 provisioning seems broken.
(see also https://bugzilla.samba.org/show_bug.cgi?id=11789)

When running: 

samba-tool domain provision --use-rfc2307 --interactive --use-ntvfs

I get the following error:

ERROR(runtime): uncaught exception - pytalloc_reference_ex() called for object type not based on talloc
  File "/usr/local/lib/python2.7/site-packages/samba/netcmd/__init__.py", line 175, in _run
    return self.run(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/samba/netcmd/domain.py", line 442, in run
    nosync=ldap_backend_nosync, ldap_dryrun_mode=ldap_dryrun_mode)
  File "/usr/local/lib/python2.7/site-packages/samba/provision/__init__.py", line 2172, in provision
    skip_sysvolacl=skip_sysvolacl)
  File "/usr/local/lib/python2.7/site-packages/samba/provision/__init__.py", line 1864, in provision_fill
    attrs=['defaultObjectCategory'])
  File "/usr/local/lib/python2.7/site-packages/samba/dbchecker.py", line 138, in check_database
    error_count += self.check_object(object.dn, attrs=attrs)
  File "/usr/local/lib/python2.7/site-packages/samba/dbchecker.py", line 1358, in check_object
    normalised = self.samdb.dsdb_normalise_attributes(self.samdb_schema, attrname, [val])
  File "/usr/local/lib/python2.7/site-packages/samba/samdb.py", line 672, in dsdb_normalise_attributes
    return dsdb._dsdb_normalise_attributes(ldb, ldap_display_name, ldif_elements)
Comment 1 Timur I. Bakeyev freebsd_committer freebsd_triage 2016-04-16 18:48:11 UTC
Hi!

Can you, please, try patches from this conversation?

http://samba.2283325.n4.nabble.com/samba-4-3-6-and-talloc-2-1-6-td4699515.html#a4699585

I'm wondering, is that work or not...
Comment 2 dasti 2016-04-18 06:50:38 UTC
I confirm the problem with the binary package version of samba 4.3.8 on FreeBSD 10.3
Comment 3 mail 2016-04-19 08:10:45 UTC
I would like to try the patches, but I am not quite sure how to apply them.

I read in the Porters Handbook that the patches lie in the files directory and are 
applied automatically during the build. 
The problem is, the patches in the link are created with "git diff" and not "diff", so I need to run them with "patch -p2". Is there a way to convert the patches or to mark the patches to be run with the "-p2" parameter so they are applied correctly?
Comment 4 Michael Reifenberger freebsd_committer freebsd_triage 2016-04-19 16:48:30 UTC
Hi,
I can confirm the problem with 4.3.8 too.
Unfortunately the referenced patches do not apply any longer...


greetings
---
mike
Comment 5 Timur I. Bakeyev freebsd_committer freebsd_triage 2016-04-19 21:58:46 UTC
(In reply to mail from comment #3)

The easiest solution would be to:

make patch

Apply additional patches manually(with -p2, possibly)

make

to finish the build.

make package / make install

to complete installation.
Comment 6 mail 2016-04-20 09:25:05 UTC
After fixing the newlines in the patches (from CRLF to LF) I was able to apply them with "patch -p1".
Provisioning works again. Thanks for the help!

Just out of curiosity about the ports and patches:
Should these patches be added to the port or do we have to wait until it is fixed in samba43, because apparently the bug affects all OSs?
Comment 7 Timur I. Bakeyev freebsd_committer freebsd_triage 2016-04-20 09:33:54 UTC
(In reply to mail from comment #6)

Thanks for trying the patches!

Now, when there are at least two persons confirming that they work I'm going to add them to the curent 4.3, as it may take a while till next release.
Comment 8 mail 2016-04-20 12:02:18 UTC
If someone else have the same problem and wants a quick fix, I put the files and my steps to patch samba into a gist:

https://gist.github.com/moogle19/ca8050c5bebb6cc4b02dc7d67a7e67de

Hope that helps!
Comment 9 dasti 2016-04-25 14:00:01 UTC
just tried with the 4.3.8_1 binary package
- domain provisioning works without errors
- all tests from the samba wiki works
- But I still have the same problem of workstations that do not register in samba's internal dns https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208353
( still searching where it's coming from )
Comment 10 dasti 2016-06-13 08:14:53 UTC
found out where my problem of windows clients not registering in the dns was coming from

since 4.3, dns secure updates when you use SAMBA_INTERNAL as a dns backend is broken -> https://bugzilla.samba.org/show_bug.cgi?id=11520

a workaround
edit samba configuration file
ee /usr/local/etc/smb4.conf
change/add this option
allow dns updates = nonsecure
Comment 11 dasti 2016-06-13 08:15:27 UTC
for me this bug should be closed