SMB failing to start on 11.3-U3.2

jon_2112

Explorer
Joined
Feb 8, 2016
Messages
52
I was having some networking issues I couldn't solve a few days ago, and so I backed up my config from U3.1 and installed U3.2 fresh. I'm having SMB problems. The service doesn't start when I boot the system, and when I start it up, this appears in /var/log/samba4/log.smbd:

smbd version 4.10.13 started. Copyright Andrew Tridgell and the Samba Team 1992-2019 [2020/06/05 16:26:27.458658, 1] ../../lib/util/util.c:205(directory_create_or_exist) directory_create_or_exist: mkdir failed on directory /var/db/samba4/private/msg.sock: No such file or directory

There is no samba4 directory at all in /var/db. If I manually create /var/db/samba4/private/, then I can start the service, however, I cannot authenticate to the server at all. I get this in the log:

[2020/06/05 16:34:28.720787, 3] ../../source3/auth/auth.c:189(auth_check_ntlm_password) check_ntlm_password: Checking password for unmapped user [hostname]\[myusername]@[hostname] with the new password interface [2020/06/05 16:34:28.720794, 3] ../../source3/auth/auth.c:192(auth_check_ntlm_password) check_ntlm_password: mapped user is: [hostname]\[myusername]@[hostname] [2020/06/05 16:34:28.720827, 3] ../../source3/auth/check_samsec.c:399(check_sam_security) check_sam_security: Couldn't find user 'myusername' in passdb. [2020/06/05 16:34:28.720834, 2] ../../source3/auth/auth.c:334(auth_check_ntlm_password) check_ntlm_password: Authentication for user [myusername] -> [myusername] FAILED with error NT_STATUS_NO_SUCH_USER, authoritative=1 [2020/06/05 16:34:28.720895, 2] ../../auth/auth_log.c:647(log_authentication_event_human_readable) Auth: [SMB2,(null)] user [hostname]\[myusername] at [Fri, 05 Jun 2020 16:34:28.720849 CDT] with [NTLMv2] status [NT_STATUS_NO_SUCH_USER] workstation [hostname] remote host [ipv4:192.168.1.10:62035] mapped to [hostname]\[myusername]. local host [ipv4:192.168.1.20:445] {"timestamp": "2020-06-05T16:34:28.721027-0500", "type": "Authentication", "Authentication": {"version": {"major": 1, "minor": 1}, "eventId": 4625, "logonType": 3, "status": "NT_STATUS_NO_SUCH_USER", "localAddress": "ipv4:192.168.1.20:445", "remoteAddress": "ipv4:192.168.1.10:62035", "serviceDescription": "SMB2", "authDescription": null, "clientDomain": "hostname", "clientAccount": "myusername", "workstation": "hostname", "becameAccount": null, "becameDomain": null, "becameSid": null, "mappedAccount": "myusername", "mappedDomain": "hostname", "netlogonComputer": null, "netlogonTrustAccount": null, "netlogonNegotiateFlags": "0x00000000", "netlogonSecureChannelType": 0, "netlogonTrustAccountSid": null, "passwordType": "NTLMv2", "duration": 2099}} [2020/06/05 16:34:28.721130, 3] ../../auth/gensec/spnego.c:1444(gensec_spnego_server_negTokenTarg_step) gensec_spnego_server_negTokenTarg_step: SPNEGO(ntlmssp) login failed: NT_STATUS_NO_SUCH_USER [2020/06/05 16:34:28.721153, 3] ../../source3/smbd/smb2_server.c:3213(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_LOGON_FAILURE] || at ../../source3/smbd/smb2_sesssetup.c:146 [2020/06/05 16:34:28.721943, 3] ../../source3/smbd/server_exit.c:236(exit_server_common) Server exit (NT_STATUS_CONNECTION_RESET)

If I create a new user, it can authenticate. I've verified the original user exists, and I can SSH to the server using that user.

If I reboot, the /var/db/samba4 directory disappears again and I'm back at square one.

Any ideas?


Edit for updates:
Going to the web gui and changing or simply saving the system dataset makes samba start and run correctly. It fails again on next reboot.

I have the following mount point:
Media-pool/.system/samba4 on /var/db/system/samba4 (zfs, local, nfsv4acls)

My smb4.conf has "private dir = /var/db/samba4/private" and the web gui page for the SMB service has this listed as an auxiliary parameter. If I remove the line, it comes back on reboot. There's no way to edit it in the web gui.
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Wild guess: re-select and save your system dataset.
 

jon_2112

Explorer
Joined
Feb 8, 2016
Messages
52
Dang. That looks like it works. I never would have thought of that.

Edit: Just kidding. It didn't survive a reboot.
 
Last edited:

jon_2112

Explorer
Joined
Feb 8, 2016
Messages
52
Didn't actually fix it. If I reboot I'm back to where I started.

For it to work on reboot, I need to again manually create that directory and re-select and save the system dataset.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Weird ...
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
What's the physical media for your boot pool? This sounds like a hardware issue.
 

jon_2112

Explorer
Joined
Feb 8, 2016
Messages
52

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
What's the output of mount | grep /var/db? This should be the system dataset set of mounts, including /var/db/system/samba4.
 

jon_2112

Explorer
Joined
Feb 8, 2016
Messages
52
This is the same before and after a reboot:
Media-pool/.system on /var/db/system (zfs, local, nfsv4acls) Media-pool/.system/cores on /var/db/system/cores (zfs, local, nfsv4acls) Media-pool/.system/samba4 on /var/db/system/samba4 (zfs, local, nfsv4acls) Media-pool/.system/syslog-0dc2ca1e7fa9464d8c4d7c4fd81f6855 on /var/db/system/syslog-0dc2ca1e7fa9464d8c4d7c4fd81f6855 (zfs, local, nfsv4acls) Media-pool/.system/rrd-0dc2ca1e7fa9464d8c4d7c4fd81f6855 on /var/db/system/rrd-0dc2ca1e7fa9464d8c4d7c4fd81f6855 (zfs, local, nfsv4acls) Media-pool/.system/configs-0dc2ca1e7fa9464d8c4d7c4fd81f6855 on /var/db/system/configs-0dc2ca1e7fa9464d8c4d7c4fd81f6855 (zfs, local, nfsv4acls) Media-pool/.system/webui on /var/db/system/webui (zfs, local, nfsv4acls)

I notice that the samba directory here is /var/db/system/samba4 not /var/db/samba

Should I change the "private dir = /var/db/samba4/private" line in smb4.confto /var/db/system/samba4/private? I've never edited the samba config file AFAIK. I don't know which it should be or how anything got changed.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
On my 11.3-U3.2 system, /usr/local/etc/smb4.conf doesn't have a "private dir = ..." nor "smb passwd file = ..." entries pointing to /var/db/samba nor /var/db/system/samba4. Those appear to be added dynamically by the SMB service. Try whacking those lines entirely out of your /usr/local/etc/smb4.conf, and restarting.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Also check your SMB service to see if those are Auxiliary parameters. If so, remove them.
 

jon_2112

Explorer
Joined
Feb 8, 2016
Messages
52
So this is interesting. I removed the "private dir" parameter from the smb4.conf file, but I notice that it's still listed under "auxiliary parameters" in the SMB service properties in the web gui.

It's not editable there.

It persists there. After a reboot, it reappears in the smb4.conf file.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
OK, so this appears to be a corrupt part of the config you imported. The only way I know to fix this is to screenshot the config screens, reinstall fresh, import your pool, and recreate your config from the screenshots, not importing any saved config. Naturally, when you recreate the SMB service, don't create this Aux param.
 

jon_2112

Explorer
Joined
Feb 8, 2016
Messages
52
This does not spark joy.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
The alternative is to create a symlink from /var/db/system/samba4 to /var/db/samba via ln -sf /var/db/system/samba4 /var/db/samba, but this likely won't survive reboots and upgrades either.
 

jon_2112

Explorer
Joined
Feb 8, 2016
Messages
52
I appreciate your help. I'll hold out to see if anyone can think of a fix besides blow it all up and start over, though.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I see a potential code path to get to this situation, but it would require the smb4.conf to fail to be generated entirely. Can you please PM me a debug?
 

jon_2112

Explorer
Joined
Feb 8, 2016
Messages
52
Sent. Thanks.
 

ykhodo

Explorer
Joined
Oct 19, 2017
Messages
52
This seems to be resolved in 11.3-U4.1. I removed `private_dir` from the samba config and cleared out the aux parameters. Samba now starts on reboot w/o issues.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
This seems to be resolved in 11.3-U4.1. I removed `private_dir` from the samba config and cleared out the aux parameters. Samba now starts on reboot w/o issues.
Once auxiliary parameters are added to configuration (especially ones that override samba's default file locations), it's a roll of the dice as to whether the SMB service will work properly.

This is the reason why I'm pushing to get templates for SMB shares if people have specific tasks that they perform (regular parameter combinations) for 12.0. This will allow me to move in the direction of removing auxiliary parameters entirely.
 
Top