SOLVED Samba problems with fresh 11.2-U2, Performing sanity check on Samba configuration: FAILED

FakeMoth

Cadet
Joined
Aug 18, 2013
Messages
7
I just installed a fresh FreeNAS 11.2U2 on a newish/oldish server (new components from another era like SM X8ST3-F and Xeon 5540 from a crashed IBM), waiting for weeks to rebuild my old one. Imported pool, moved system dataset to my 2x250GB boot mirror, so forth - went fine, but when I got to Samba I get a simple error in the UI "SMB service failed to start.". I mean like right from the start.

When I issue:
# service samba_server start
Performing sanity check on Samba configuration: FAILED

# service samba_server onestart
Performing sanity check on Samba configuration: FAILED

It is clear to me now: Samba is insane :)

Don't know exactly what this does, found it here on the forums, so willing to start anything at all I tried:
# service ix-pre-samba start
Unable to initialize messaging context!
Unable to set SID to S-1-5-21-1007353696-1553662160-1240030374

Deleted the shares, recreated them, deleted them again, checked every single options - damn Samba should be fine. Even tried the old interface. Also moved the system dataset back to vol1 from boot. The errors should be logged to /var/log/samba4 dir (mine is still empty)? And /var/db/samba4/private permissions are 700, as I read they should be. Clearly something is wrong:

[/var/db/samba4/private]# testparm
Unable to initialize messaging context!

I even compared /usr/local/etc/smb4.conf to my other working FreeNAS but still on 11.1, pretty much the same except IPs and these lines on 11.2:

max open files = 706349
server min protocol = SMB2_02

Modified the minimum protocol to SMB2 as in 11.1 = no effect
Modified the number of files to 939638 as in 11.1 = no effect
No more backups, movies, music, pictures and stuff for me, for way too long = :(

The smbd -i -d 5 command ends with the same last invalid ownership line for me too, like for @Kanky here https://forums.freenas.org/threads/warning-failed-to-start-nmbd.74170/ should we be worried, what are the correct permissions (needs root, trying that now?), and how did those go there?

doing parameter security = user
doing parameter create mask = 0666
doing parameter directory mask = 0777
doing parameter client ntlmv2 auth = yes
doing parameter dos charset = CP437
doing parameter unix charset = UTF-8
doing parameter log level = 1
pm_process() returned Yes
get_current_groups: user is in 1 groups: 0
directory_create_or_exist_strict: invalid ownership on directory /var/db/samba4/private/msg.sock

[/var/db/samba4/private]# ls -lsha
total 66
2 drwx------ 4 fakemoth fakemoth 13B May 8 2016 .
3 drwxr-xr-x 4 fakemoth fakemoth 29B Dec 16 2017 ..
11 drwxrwx--- 2 fakemoth fakemoth 532B Dec 17 2017 msg.sock

That date seems... way back. But still: I carry this pool after me since like FreeNAS 7-8 days :D

Any idea what is wrong here and how can I solve this?
 
Last edited:

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Try using the hammer of Thor.
Code:
service samba_server onestop
tar -cvzf /var/log/samba4_backup.tgz /var/db/samba4/
rm -rf /var/db/samba4/*
service ix-pre-samba start
service samba_server onestart
 

FakeMoth

Cadet
Joined
Aug 18, 2013
Messages
7
Used the spear of Odin in the meantime :) as all those files were owned by my user... Maybe this happened when I moved the dataset as I don't have another explanation. Chowned them to root and it starts, but doesn't register in the interface as running.

So used Thor's hammer to iron some sense into Samba.

Now it is fine, tested after a reboot too, at least it starts; didn't think to delete all that stuff, even if it is in var. Thanks a bunch!
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Used the spear of Odin in the meantime :) as all those files were owned by my user... Maybe this happened when I moved the dataset as I don't have another explanation. Chowned them to root and it starts, but doesn't register in the interface as running.

So used Thor's hammer to iron some sense into Samba.

Now it is fine, tested after a reboot too, at least it starts; didn't think to delete all that stuff, even if it is in var. Thanks a bunch!
It looks like our sanity checks only look at the permissions bits themselves, not the owner of files. I'll think a bit about how to avoid this in the future. I can't just shotgun root:wheel across /var/db/samba4 because that's also where the sysvol share resides on a DC.
 

FakeMoth

Cadet
Joined
Aug 18, 2013
Messages
7
I can mount and do all the operations both from my workstation and a LibreELEC Cubox. Everything seems in order.
Thank you again.
 

NASOD6572

Dabbler
Joined
Sep 12, 2019
Messages
20
Try using the hammer of Thor.
Code:
service samba_server onestop
tar -cvzf /var/log/samba4_backup.tgz /var/db/samba4/
rm -rf /var/db/samba4/*
service ix-pre-samba start
service samba_server onestart

What Fakemoth described is what happened to me. Unfortuantly, I am far too inexperencice, to known who to do what was recommended above without some additional direction. Is there anyway you could help me out????
 

NASOD6572

Dabbler
Joined
Sep 12, 2019
Messages
20
What Fakemoth described is what happened to me. Unfortuantly, I am far too inexperencice, to known who to do what was recommended above without some additional direction. Is there anyway you could help me out????

I did try and run
service samba_server onestop
and got the below response:

winbindd not running? (check /var/run/samba4/winbindd.pid).
smbd not running? (check /var/run/samba4/smbd.pid).
nmbd not running? (check /var/run/samba4/nmbd.pid).
 
Top