Bug 13882 - Unable to run samba-tool on CentOS 6.x
Summary: Unable to run samba-tool on CentOS 6.x
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Python (show other bugs)
Version: 4.9.4
Hardware: All Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-03 19:09 UTC by alex.braunegg
Modified: 2020-12-11 12:29 UTC (History)
3 users (show)

See Also:


Attachments
patch for 4.9 (1.11 KB, patch)
2019-04-03 21:48 UTC, Douglas Bagnall
no flags Details
patch for 4.10 (1.11 KB, patch)
2019-04-03 21:49 UTC, Douglas Bagnall
no flags Details
Samba 4.9.4 Build Logs (96.14 KB, application/x-zip-compressed)
2019-04-03 22:11 UTC, alex.braunegg
no flags Details
python error (429.87 KB, image/jpeg)
2019-04-03 22:17 UTC, alex.braunegg
no flags Details
patch for 4.9 v2 (1.11 KB, patch)
2019-04-04 20:33 UTC, Douglas Bagnall
abartlet: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alex.braunegg 2019-04-03 19:09:34 UTC
Successfully able to build Samba 4.9.x on CentOS 6.x where python 2.6 is default, however when running the following command:

sudo /usr/bin/samba-tool domain provision --domain=asdf --realm=localdomain.net --server-role=dc --adminpass=<redacted> --dns-backend=SAMBA_INTERNAL --use-rfc2307 --quiet 

the command fails and generates the following error:

No IPv6 address will be assigned
Unable to determine the DomainSID, can not enforce uniqueness constraint on local domainSIDs

ERROR(): uncaught exception - zero length field name in format
  File "/usr/lib64/python2.6/site-packages/samba/netcmd/__init__.py", line 177, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/samba/netcmd/domain.py", line 538, in run
    backend_store=backend_store)
  File "/usr/lib64/python2.6/site-packages/samba/provision/__init__.py", line 2316, in provision
    backend_store=backend_store)
  File "/usr/lib64/python2.6/site-packages/samba/provision/__init__.py", line 1921, in provision_fill
    names.domaindn, lp, use_ntvfs)
  File "/usr/lib64/python2.6/site-packages/samba/provision/__init__.py", line 1693, in setsysvolacl
    userdn = ''.format(domainsid, security.DOMAIN_RID_ADMINISTRATOR)
Comment 1 Douglas Bagnall 2019-04-03 20:48:39 UTC
  File "/usr/lib64/python2.6/site-packages/samba/provision/__init__.py", line 1693, in setsysvolacl
    userdn = ''.format(domainsid, security.DOMAIN_RID_ADMINISTRATOR)

I can't find a line like that in the v4-9-{stable,test} branches. Instead there is this:

  userdn = '<SID={}-{}>'.format(domainsid, security.DOMAIN_RID_ADMINISTRATOR)

which should work.

Was this Samba compiled from source or is it from a package?
Comment 2 Douglas Bagnall 2019-04-03 21:48:22 UTC
Created attachment 15042 [details]
patch for 4.9

Andrew Bartlett has pointed out to me that your line 

    userdn = ''.format(domainsid, security.DOMAIN_RID_ADMINISTRATOR)

has probably been mangled by something trying to strip out HTML (the original line had angle brackets).

The attached patch is probably the fix.
Comment 3 Douglas Bagnall 2019-04-03 21:49:10 UTC
Created attachment 15043 [details]
patch for 4.10

Same patch, for 4.10. Just the line numbers change.
Comment 4 alex.braunegg 2019-04-03 22:11:14 UTC
Created attachment 15044 [details]
Samba 4.9.4 Build Logs
Comment 5 alex.braunegg 2019-04-03 22:17:55 UTC
Created attachment 15045 [details]
python error
Comment 6 alex.braunegg 2019-04-03 22:18:34 UTC
RPM's as installed on test system:

[root@mynas-iso-test ~]# rpm -qa | grep samba
samba-winbind-clients-4.9.4-3.el6.x86_64
samba-dc-libs-4.9.4-3.el6.x86_64
samba-client-4.9.4-3.el6.x86_64
samba-winbind-modules-4.9.4-3.el6.x86_64
samba-winbind-4.9.4-3.el6.x86_64
samba-dc-4.9.4-3.el6.x86_64
samba-libs-4.9.4-3.el6.x86_64
samba-common-4.9.4-3.el6.noarch
samba-client-libs-4.9.4-3.el6.x86_64
samba-4.9.4-3.el6.x86_64
samba-python-4.9.4-3.el6.x86_64
samba-common-tools-4.9.4-3.el6.x86_64
samba-common-libs-4.9.4-3.el6.x86_64
[root@mynas-iso-test ~]# rpm -qa | grep python
python-urlgrabber-3.9.1-11.el6.noarch
python-2.6.6-66.el6_8.x86_64
python26-crcmod-1.7-1.el6.x86_64
python-argparse-1.2.1-2.1.el6.noarch
python-six-1.9.0-2.el6.noarch
python-IPy-0.75-1.el6.noarch
python35-3.5.1-3.el6.x86_64
python35-setuptools-20.2.2-1.el6.noarch
python35-funcsigs-1.0.2-1.el6.noarch
setools-libs-python-3.3.7-6.el6.x86_64
python-pycurl-7.19.0-17.el6.x86_64
libsemanage-python-2.0.43-5.1.el6.x86_64
python-libs-2.6.6-66.el6_8.x86_64
python-crypto-2.0.1-22.el6.x86_64
python-tevent-0.9.37-2.el6.x86_64
python-iniparse-0.3.1-2.1.el6.noarch
dbus-python-0.83.0-6.1.el6.x86_64
python-dateutil-1.4.1-7.el6.noarch
audit-libs-python-2.4.5-6.el6.x86_64
libselinux-python-2.0.94-7.el6.x86_64
python35-libs-3.5.1-3.el6.x86_64
python35-six-1.10.0-1.el6.noarch
python35-requests-2.9.2-1.el6.noarch
python35-arrow-0.12.1-1.el6.noarch
python35-logfury-0.1.2-1.el6.noarch
policycoreutils-python-2.0.85-30.3.el6.x86_64
rpm-python-4.8.0-59.el6.x86_64
samba-python-4.9.4-3.el6.x86_64
python-tdb-1.3.16-1.el6.x86_64
python-lxml-2.2.3-1.1.el6.x86_64
python-magic-5.04-30.el6.x86_64
python35-tqdm-4.5.0-1.el6.noarch
python35-python-dateutil-2.6.1-1.el6.noarch
[root@mynas-iso-test ~]#
Comment 7 alex.braunegg 2019-04-04 17:39:03 UTC
With Samba 4.9.5 + proposed patch, this still fails:


ERROR(<type 'exceptions.IndexError'>): uncaught exception - tuple index out of range
  File "/usr/lib64/python2.6/site-packages/samba/netcmd/__init__.py", line 177, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/samba/netcmd/domain.py", line 538, in run
    backend_store=backend_store)
  File "/usr/lib64/python2.6/site-packages/samba/provision/__init__.py", line 2316, in provision
    backend_store=backend_store)
  File "/usr/lib64/python2.6/site-packages/samba/provision/__init__.py", line 1921, in provision_fill
    names.domaindn, lp, use_ntvfs)
  File "/usr/lib64/python2.6/site-packages/samba/provision/__init__.py", line 1693, in setsysvolacl
    userdn = '<SID={1}-{2}>'.format(domainsid, security.DOMAIN_RID_ADMINISTRATOR)
Comment 8 Douglas Bagnall 2019-04-04 20:33:41 UTC
Created attachment 15046 [details]
patch for 4.9 v2

Oops. Try this patch.
Comment 9 alex.braunegg 2019-04-05 00:03:16 UTC
Updated patch resolves issue
Comment 10 Andrew Bartlett 2019-04-05 00:08:07 UTC
Comment on attachment 15046 [details]
patch for 4.9 v2

Thanks Douglas.  I'll be very glad when we stop having to support 2.6 or any 2.x for that matter, but this is good for the old releases.
Comment 11 Andrew Bartlett 2019-04-05 00:10:37 UTC
Karolin,

Please select for 4.9.next and 4.10.next!
Comment 12 Karolin Seeger 2019-04-09 09:49:05 UTC
(In reply to Andrew Bartlett from comment #11)
Pushed to autobuild-v4-{10,9}-test.
Comment 13 Karolin Seeger 2019-04-11 11:32:56 UTC
(In reply to Karolin Seeger from comment #12)
Pushed to both branches.
Closing out bug report.

Thanks!