[Samba] samba-tool python error

Andrew Bartlett abartlet at samba.org
Thu Jan 16 20:04:57 UTC 2020

On Thu, 2020-01-16 at 16:53 +0000, Pablo Sanz Fernández via samba
> Hi,
> We have some weird Python errors.
> Our deplyment has the following attributes:
> -          CentOS 6.10
> -          Python 2.6.6
> -          Samba 4.9.13 installed from source code with AD role
> And the problem is that some subcommands of the samba-tool utility throws different Python errors like this:

As Rowland has said in a different way, Python 2.6 was supported in
Samba only only an exceptions basis.  OK, that was a bit of a bad joke,
but the serious truth is that we have never had any CI that ran on
Python 2.6 nor do any developers develop with it, so things like this
have kept coming up.  

In the past, we would fix such things, one at a time, when raised here
or on bugzilla.

However, at this point any such fix would only be for Samba 4.10,
because for Samba 4.11 we now require python 3.4 and Samba 4.12 will
require Python 3.5.

The latter point is quite important, as that is the minimum Python in
our multi-distribution CI and so we won't be promising support for
something we just don't test.

But while the above is true, I think your problem may be simpler.  You
say you have installed from source code.  If you have been running
'make install' into the same spot for a number of years, you may have a
stray 'time.py' file that we no longer install, as
samba/netcmd/time.py.  Cleaning out the install tree (keep your data!)
and re-installing Samba might just fix this.

Otherwise, are you able to move to either Python 2.7 or better Python
3.5 with Samba 4.10 or 4.11?

Andrew Bartlett

> [root at mercurio2 oper]# samba-tool user syncpasswords --cache-ldb-initialize --decrypt-samba-gpg --attributes=sAMAccountName,mail,virtualClearTextUTF8
> Connecting to 'ldapi:///usr/local/samba/private/ldap_priv/ldapi'
> ERROR(<type 'exceptions.AttributeError'>): uncaught exception - 'module' object has no attribute 'time'
>   File "/usr/local/samba/lib64/python2.6/site-packages/samba/netcmd/__init__.py", line 178, in _run
>     return self.run(*args, **kwargs)
>   File "/usr/local/samba/lib64/python2.6/site-packages/samba/netcmd/user.py", line 2277, in run
>     load_cache()
>   File "/usr/local/samba/lib64/python2.6/site-packages/samba/netcmd/user.py", line 1939, in load_cache
>     add_ldif += "currentTime: %s\n" % ldb.timestring(int(time.time()))
> [root at mercurio2 oper]#
> Do you know how to solve this?
> Pablo Sanz Fernández
> Empresarios Agrupados AIE
> Departamento de TI y Apoyo Operativo
> Magallanes 3 28015   Madrid
> Tel : 91-3098000 (ext: 8206), email:psanz at empre.es
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba

More information about the samba mailing list