Re: samba-tool group addmembers error - string_to_sid: SID <groupname> is not in a valid format

Rowland Penny via samba <[email protected]> Sat, 18 Apr 2026 12:36:58 +0100
Newsgroups gmane.network.samba.general
Message-ID <[email protected]>
On Fri, 17 Apr 2026 13:02:54 +0200
Marco Gaiarin via samba <[email protected]> wrote:

> Mandi! Rowland Penny via samba
>   In chel di` si favelave...
> 
> > I think this is all down to you seemingly having
> > /etc/samba/smb.conf.%M instead of /etc/samba/smb.conf . The %M is
> > used internally by smb.conf as a substitute for the clients
> > hostname, so why try and use it externally ?
> 
> I use in smb.conf:
> 
> 	log file = /var/log/samba/log.%M
> 
> to be able to enable debugging (or other options) per-machive; i've
> ever used this on my smb.conf and never hit a trouble (apart the
> warning, indeed).

Yes the '%' substitutions work inside a smb.conf file, but I doubt
whether they will work outside in the way you were using.

> 
> 
> > What I think is happening is, the samba-tool command tries to read
> > the smb.conf file and fails, this leads to winbind being unable to
> > map the SID to an ID, so you get 'SID_ALIAS' (something I can never
> > remember seeing). Try removing the '.%M' from
> > /etc/samba/smb.conf.%M and see if that cures your problem.
> 
> I've commented out and retry, same result:
> 
> [root@ppfs1 ~]# samba-tool group addmembers fvg_sir marco.gaiarin
> --URL=ldap://ppdc1.fvg.ad.lnf.it -U adminmgaiarin -d 3 lpcfg_load:
> refreshing parameters from /etc/samba/smb.conf Tried to load
> /etc/samba/smb.conf.%M but variable substitution in filename,

It looks like it is still trying to load the 'smb.conf.%M' file, did
you restart Samba after making the change ?

If I create a test smb.conf and call it testconf.%M and then run:

testparm -s testconf.%M

I get:

Load smb config files from testconf.%M
Error loading services.

Rowland


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba