Vero 4k+ not loading first file on boot

Hi all,

This is a weird one. I recently got done switching all of my library on a Vero 4k+ from a local USB drive to SMB - I took the same USB drive and moved it to a computer (a mac, if that’s useful, running built-in SMB v3). I went through and bulk updated all the files in my sqlite DB’s to point to the new network share - everything worked, but performance was pretty terrible on bigger files.

I switched to an FSTAB mount, which works kind of - here’s what I’m experiencing along with a log that I created while following these steps:

  1. Reboot the unit.
  2. Navigate to movies, select one.
  3. OSMC appears to be working, UI freezes up.
  4. File does not start playback, UI returns control to me.
  5. If I select the same file, I get “this file is no longer available - do you want to remove it?”
  6. If I select a different file, playback starts, and everything is groovy.

Any ideas? Logs below:
https://paste.osmc.tv/ekatelelah

Hi,

Try adding to noauto to the fstab entry or alternatively have a look at autofs:

Thanks Tom.

Hey Tom - I initially tried noauto with the same results (I actually removed it when I was playing around with troubleshooting this initially). I’ll check out autofs - looks promising.

From the log, /mnt/Galahad is mounting successfully – and well before you try to access a file.

If it always fails on the first file but always works on the second file, could it be due to the server disks needing time to spin up?

@dillthedog that’s exactly what I’m thinking is happening since it’s a USB drive with a rather slow warm-up time.

you might try setting a custom playlist timeout setting. I’ve never used or tested this but I believe this would be the correct method to overcome a slow wakeup of a network drive going through a system mount…
https://kodi.wiki/view/Advancedsettings.xml#playlisttimeout

No dice there. Same behavior, and actually seemed to timeout almost immediately this time.

I also tried autofs. Couple of random questions (not directed at anyone in particular):

  1. When I tried autofs, everything looked good, I saw the mounted dir in my mnt directory, but there’s nothing inside. sudo automount -f -v -d worked totally fine though, no errors. Not sure what’s going on there.
  2. More curiosity, but why do the directories that I’ve mounted up in the past via fstab show up in the mnt directory even after I’ve commented out the whole fstab file and rebooted? There’s nothing in them, but seems like weird behavior.

What’s the outtut of sudo automount -f -v -d? Did you try to access the directory (e.g. in second terminal) when you ran the command?

Because you manually created the directory with mkdir so it will always remain as an empty mountpoint. Only autofs acts differently.

Because you manually created the directory with mkdir so it will always remain as an empty mountpoint. Only autofs acts differently.

Good to know! I don’t recall manually creating the directories outside of the fstab entries, but I suppose I can always rm them. As for the output of automount…

Starting automounter version 5.1.2, master map /etc/auto.master
using kernel protocol version 5.02
lookup_nss_read_master: reading master file /etc/auto.master
do_init: parse(sun): init gathered global options: (null)
lookup_read_master: lookup(file): read entry /-
master_do_mount: mounting /-
automount_path_to_fifo: fifo name /var/run/autofs.fifo--
lookup_nss_read_map: reading map file /etc/auto.smb.shares
do_init: parse(sun): init gathered global options: (null)
mounted direct on /mnt/Galahad/Movies with timeout 15, freq 4 seconds
do_mount_autofs_direct: mounted trigger /mnt/Galahad/Movies
mounted direct on /mnt/Galahad/TV with timeout 15, freq 4 seconds
do_mount_autofs_direct: mounted trigger /mnt/Galahad/TV
st_ready: st_ready(): state = 0 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4096783440 path /-
expire_cleanup: got thid 4096783440 path /- stat 0
expire_cleanup: sigchld: exp 4096783440 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4096783440 path /-
expire_cleanup: got thid 4096783440 path /- stat 0
expire_cleanup: sigchld: exp 4096783440 finished, switching from 2 to 1

(This is truncated, just continues cat’ing out to the terminal. Also I tried to mount separate Movie/TV dirs here instead of just the base HDD). Yes, I tried to ssh into the vero from another terminal window, and while I see /mnt/Galahad/Movies and /mnt/Galahad/TV there’s nothing in them - terminal output below so you can see what I’m seeing:

osmc@osmc:~$ cd /mnt
osmc@osmc:/mnt$ cd Galahad/
osmc@osmc:/mnt/Galahad$ ls
Movies  TV
osmc@osmc:/mnt/Galahad$ cd Movies
-bash: cd: Movies: No such file or directory
osmc@osmc:/mnt/Galahad$ cd TV
-bash: cd: TV: No such file or directory
osmc@osmc:/mnt/Galahad$ ls -la ./Movies
ls: cannot open directory './Movies': No such file or directory
osmc@osmc:/mnt/Galahad$ 

We will need to see the autofs files that you created.

Sure. Thanks for all the help btw, y’all rock!

/etc/auto.master

#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
#/misc	/etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#	"nosuid" and "nodev" options unless the "suid" and "dev"
#	options are explicitly given.
#
#/net	-hosts
#
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
#+dir:/etc/auto.master.d
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
#+auto.master

/- /etc/auto.smb.shares --timeout 15 br

/etc/auto.smb.shares

/mnt/Galahad/Movies -fstype=cifs,rw,vers=3.0,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc ://macbook.local/Galahad/Movies/
/mnt/Galahad/TV -fstype=cifs,rw,vers=3.0,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc ://macbook.local/Galahad/TV/

~/osmc/.smbcredentials

username=<redacted> 
password=<redacted>

That should be:

/- /etc/auto.smb.shares --timeout 15 browse

Unless you just cut off the last bit.

Yup, sorry, copy/paste snafu. It is correctly /- /etc/auto.smb.shares --timeout 15 browse in the file.

Can the Mac share as NFS instead of SMB? NFS would be faster.

Sigh. Looks like nfsd does come natively on OSX but when I tried to rig it up, the external HDD is formatted in exFAT, and it didn’t like this: NFS exporting not supported by fstype "exfat"

How about trying this test. Play a video from the drive on your Mac. Then while it’s still playing on the Mac reboot the Vero and try playing that video from the Vero and see if you have the same problem.

If it works then we know that it’s a problem with the drive waking up.

Good idea, but same problem - I see some activity, then the first video immediately bombs, second video works like a charm (albeit it does start up a lot faster with the disk warm). Logs here: https://paste.osmc.tv/uyinecuzig - you can see it fail, but the error certainly isn’t the most descriptive…2020-01-13 23:35:11.472 T:3483865824 ERROR: CVideoPlayer::OpenInputStream - error opening [<filename>]

Maybe its a DNS problem. What happens if you change the autofs to use the Macs IP?

It’s almost certainly not DNS - can ping the machine from the vero fine, and i’ve had no other issues with using hostnames on my network. I read through the comments in the Wiki Tom linked on autofs, and I noticed someone mentioned that the credentials file didn’t work and they needed to inline username/password. I checked the permissions on the credentials file to rule that out (everything fine, should be readable to all) and then swapped to inlining them just to give it a shot.

…it worked. But the problem still remains! I tried copying over the default OSMC/Vero advancedsettings.xml I saw in the bootlog and bumped the samba timeout, as well as added a very large playlist timeout in case the docs were wrong it was in ms instead of seconds. No joy, exact same behavior, exact same lack of error message.

I’m almost ready to just resign myself to my fate and add a sacrificial file in the directory that I can fail on when I boot so the rest of my library is accessible.

I believe that the credentials file needs to be readable only by root (400) to work properly.

Have you tried using the IP instead of name to be sure?