Update fail due to samba, now samba is down

Hi guys,

Been a while since I’ve posted as I have had a really good run with OSMC (Kudos Sam and the rest of the team).

However, the latest update is giving me issues. It fails to install and seems to indicate samba is the cause. Upon restarting, samba is not working in my original install.

Logs are here (apologies for uploading the lot as I was not sure which would be relevant)

https://paste.osmc.tv/iqutonimax

Thanks for any help you can offer

Well, in this thread it ended with a suggested installation of the Vero from scratch: Can't access Vero 4K/OSMC from Windows

If you like you could try the following and provide the information in hope there is some further finding:

From the logs it looks like the smbd is dying for an unknown reason, so SSH to your OSMC device and

  1. sudo rm /var/log/samba/log.smbd
  2. sudo reboot
  3. wait a while and relogin using SSH
  4. sudo paste-log /var/log/samba/log.smbd … and provide the URL you get here (hope there is a log at all)
  5. maximize your SSH window (possible a putty) and interactively start smbd using sudo /usr/sbin/smbd -i -S -d 3
  6. the output copy’n paste to paste.osmc.tv, hit the save icon on the top right and provide the URL you get in the URL field of the browser
  7. in case you do not get a shell prompt, abort the smbd invoking (ctrl)+c

Thanks for taking the time to attempt a solution.

I tried as you suggested, here are the results:

URL from step 4: https://paste.osmc.tv/dokicupeha

URL of output from step 5: https://paste.osmc.tv/teqapuwumu.hs

doesn’t make sense to me, hopefully you can garner some info from it

cheers

So, I’m not too familiar with samba but it looks like the smbd is not able to create a lock (!!!) file which should reside in /var/cache/samba/lck, could you provide

ls -al / paste-log
ls -al /var | paste-log
ls -al /var/cache | paste-log
ls -al /var/cache/samba | paste-log
ls -al /var/cache/samba/lck | paste -log

to compare it with systems which do not show this issue?

ls -al /var/cache/samba/msg.lock | paste-log

would also be fine.

I’m having the same issue w/ samba after the latest update. If a solution is found, please post.

Post logs, as we have no idea if you are having the same problem.

You can learn more about how to submit a useful support request here.

Here are my various logs:

https://paste.osmc.tv/edarifevas

https://paste.osmc.tv/pugilewihu

https://paste.osmc.tv/juzoxetude

https://paste.osmc.tv/mehadakemi

https://paste.osmc.tv/ayupisodaf

When I attempt to forcible start samba w/ service samba start I get this error:
“Failed to start samba.service: Unit samba.service is masked.”

You should be using systemd commands, so that would be sudo systemctl start samba.service. If it still says it’s masked, you can unmask it with sudo systemctl unmask samba.service. (Mask is a stronger form of disable.)

Edit: fixed typo.

and where is the debug output of this?

I ended up recovering my last clonezilla image backup of my osmc sdcard from last month. After the clonezilla recovery, I ran the first set of osmc updates. That update goes through fine, and samba works normally. From CLI, I stop kodi, run apt-get update, and then run apt-get dist-upgrade. I’ve tried updating via both the onscreen kodi prompt which stops kodi, and proceeds to update, and via manual CLI, and run into the same exact issue on the second round of updates. Both update methods manually stop samba mid-way through which I assume should happen. During the second round of updates (about 360MB) via CLI I get two blue prompts. One, to stop samba, and the second later in the install prompts either to keep maintainer smb.conf or local version. I selected the option for local version. This time the upgrade finishes without error, but after I reboot, samba does not auto start. Manually trying to start it produces:

See "systemctl status samba.service" and "journalctl -xe" for details.
root@osmc:/etc/samba# journalctl -xe
Jan 20 13:06:16 osmc sudo[1496]: pam_unix(sudo:session): session closed for user root
Jan 20 13:09:21 osmc systemd[1]: Starting Samba Server...
-- Subject: Unit samba.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit samba.service has begun starting up.
Jan 20 13:09:21 osmc systemd[1]: Starting Samba NMB Daemon...
-- Subject: Unit nmbd.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit nmbd.service has begun starting up.
Jan 20 13:09:21 osmc systemd[1]: nmbd.service: Supervising process 1592 which is not our child. We'll most likely not notice when it exits.
Jan 20 13:09:21 osmc nmbd[1592]: [2018/01/20 13:09:21.939413,  0] ../source3/lib/util.c:478(reinit_after_fork)
Jan 20 13:09:21 osmc nmbd[1592]:   messaging_reinit() failed: NT_STATUS_OBJECT_NAME_NOT_FOUND
Jan 20 13:09:21 osmc nmbd[1592]: [2018/01/20 13:09:21.940478,  0] ../lib/util/become_daemon.c:111(exit_daemon)
Jan 20 13:09:21 osmc nmbd[1592]:   STATUS=daemon failed to start: reinit_after_fork() failed, error code 2
Jan 20 13:09:21 osmc systemd[1]: nmbd.service: Main process exited, code=exited, status=1/FAILURE
Jan 20 13:09:21 osmc systemd[1]: Failed to start Samba NMB Daemon.
-- Subject: Unit nmbd.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit nmbd.service has failed.
--
-- The result is failed.
Jan 20 13:09:21 osmc systemd[1]: nmbd.service: Unit entered failed state.
Jan 20 13:09:21 osmc systemd[1]: nmbd.service: Failed with result 'exit-code'.
Jan 20 13:09:21 osmc samba.distributed[1582]: Starting nmbd (via systemctl): nmbd.serviceJob for nmbd.service failed because the control process exited with error code.
Jan 20 13:09:21 osmc samba.distributed[1582]: See "systemctl status nmbd.service" and "journalctl -xe" for details.
Jan 20 13:09:21 osmc samba.distributed[1582]:  failed!
Jan 20 13:09:21 osmc systemd[1]: samba.service: Main process exited, code=exited, status=1/FAILURE
Jan 20 13:09:21 osmc systemd[1]: Failed to start Samba Server.
-- Subject: Unit samba.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit samba.service has failed.
--

root@osmc:/etc/samba# sudo /usr/sbin/smbd -i -S -d 3
smbd version 4.5.12-Debian started.
Copyright Andrew Tridgell and the Samba Team 1992-2016
uid=0 gid=0 euid=0 egid=0
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section “[global]”
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section “[/home/osmc]”
Processing section “[32GB]”
Processing section “[Tera]”
adding IPC service
added interface eth0 ip=192.168.2.15 bcast=192.168.2.255 netmask=255.255.255.0
loaded services
INFO: Profiling support unavailable in this build.
messaging_dgm_lockfile_create: open failed: No such file or directory
messaging_dgm_init: messaging_dgm_create_lockfile failed: No such file or directory
messaging_dgm_ref failed: No such file or directory
messaging_reinit() failed: NT_STATUS_OBJECT_NAME_NOT_FOUND
STATUS=daemon failed to start: reinit_after_fork() failed, error code 2

Oh dear, that looks weird even the NetBios daemon nmbd is dying. If I would be in this situation, I would try

  1. clean the samba cache
  • sudo systemctl stop samba (just to be sure)
  • sudo mv /var/cache/samba /var/cache/samba.old
  • sudo mkdir /var/cache/samba
  • reboot
  1. if that doesn’t work, try a virgin smb.conf
  • sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.old
  • if /etc/samba/smb-local.conf exists sudo mv /etc/samba/smb-local.conf /etc/samba/smb-local.conf.old
  • if /etc/samba/smb-shares.conf exists sudo mv /etc/samba/smb-shares.conf /etc/samba/smb-shares.conf.old
  • place a virgin /etc/samba/smb.conf, mine wasn’t hopefully changed in the past: https://paste.osmc.tv/xesicuweca
  • reboot

if this should work, the issue is related to your specific smb.conf and or related files.

  1. if that does not help, I see the only chance to get most debug details out of nmbd and smbd
  • sudo systemctl stop samba (just to be sure)
  • sudo nmbd -i -S -d 10 > mynmbd.debug.log
  • (if you do not get back a shell prompt, the nmbd is NOT dying, (ctrl)+c)
  • sudo paste-log mynmbd.debug.log
  • sudo smbd -i -S -d 10 > mysmbd.debug.log
  • (if you do not get back a shell prompt, the smbd is NOT dying, (ctrl)+c)
  • sudo paste-log mysmbd.debug.log

Others ideas are welcome.

Well, I did the upgrade again. Picked the option for maintainer’s version, and after reboot had the same issue.

I went through your above suggestions, and I’m glad to report that the second set of directions worked (replacing configs, and starting w/ fresh dir’s). Thanks very much!

Thanks, new smb.comf appears to have samba working again.
will try update osmc again now.

Edit: yep update worked this time.
Cheers for the help