Some subfolders on a mounted share inaccessible

Hi everyone,

First-time OSMC user currently trying to set up my brand new Vero 4K. A weird issue has me stumped.

I have mounted a share from my NAS and am able to scan/view the contents from some folders on it, but not all. Try as I might, I just cannot get access to some of the subfolders on the share.

My Vero is running OSMC 2020-11-1, Kodi 18.9. My media is hosted on a QNAP NAS in a shared folder called “Multimedia”. All of its content has the same permission rights from the NAS. From the Vero I can access some of the subfolders in “Multimedia” (TV Adults, TV Kids), but not others (TV Teens, TV Documentaries). I am therefore unable to scan the content from the problematic subfolders into my Kodi library.

There have never been any issues accessing this same content from my other machine (a NUC running LibreElec), which continues to work fine. This suggests to me the issue is not related to folder permissions, or the NAS, or the network.

Given that the “Multimedia” share from the QNAP is mounted successfully, why do I get the “Couldn’t connect to network server” error message when trying to access certain subfolders such as TV Teens?

I edited manually “sources.xml” to make sure the problematic subfolders are all listed as sources, and I also followed the autofs setup steps as described here. “Multimedia” appears to be mounted correctly and all subfolders show in Kodi’s File Manager, but some of them simply cannot be accessed.

Has anyone come across similar behavior? Isn’t it the case that mounting “Multimedia” should automatically provide access to all of its content and subfolders? Or does each individual source (i.e. each subfolder in Multimedia) get mounted separately, and in my case some fail to do so? If it’s the latter, why is that process failing?

Any help would be greatly appreciated.

Many thanks,

Ivan

PS. Not sure if a log would help here, but happy to provide one if needed.

Logs always help to get an overall picture of your system. So using grablogs -A and share the URL is always helpful.

As you problem is already on the OS level I think checking on that level is what we should do.
How are you sharing from your Qnap, NFS or SMB?
How are you connected to the QNAP?
Can you run ls -lah /mnt/Multimedia (if Multimedia is your mount point) and then execute that command also on the subfolders not working

Many thanks for your reply fzinken. Here is the log, hope it helps.

Sorry, forgot to provide these details. 1) I’ve been using NFS. 2) The Vero is connected to the QNAP with a wired network connection through an access point and a managed switch.

I can execute the command on ‘Multimedia’ and the subfolder ‘TV Shows’, but not on the troublesome subfolder ‘TV Teens’, as per the attached screenshot.

Then I assume could be a permission or version issue. Whch NFS version have you enabled? And which squash option have you chosen?

While error “No such device” surprises me.

On the QNAP, the v2/v3 service and v4 service are all enabled. Not sure about the squash options tbh, can’t see anything like that in the QNAP GUI.

I still can’t get my head around why: 1) the same content is fully accessible from a LibreElec machine on the same network, and 2) two identically structured folders on the same mounted share display opposite behavior, where one is accessible and the other is not.

Frustrating!

Check this guide

Maybe you want to try SMB if you don’t want to spent time on the NFS user permission issue.

Also maybe check on the QNAP the directories how they are “different”

First, most of your NFS shares are Kodi-based (ie not kernel-based). This includes “TV Teens”:


        <source>
            <name>TV Teens</name>
            <path pathversion="1">nfs://192.168.50.190/Multimedia/TV Shows/TV Teens/</path>
            <allowsharing>true</allowsharing>
        </source>

Second, you also have one fstab entry for “TV Teens” that is incorrectly specified:

192.168.50.190:/nfs /mnt/Multimedia/TV\040Shows/TV\040Teens        nfs     noauto,x-systemd.automount  0  0

Assuming that the Kodi entry is correct, the fstab entry should be:

192.168.50.190:/Multimedia/TV\040Shows/TV\040Teens /mnt/Multimedia/TV\040Shows/TV\040Teens nfs noauto,x-systemd.automount 0 0

Ideally, you should choose either Kodi- or kernel-based shares and stick with one method.

Edit: I see you’ve also installed and configured autofs, so it’s unclear to me what you’re aiming to do:

/etc/auto.nfs.shares /mnt/QNAP-873-SOF2/Multimedia\0402 autofs rw,relatime,fd=6,pgrp=408,timeout=15,minproto=5,maxproto=5,direct 0 0
/etc/auto.nfs.shares /mnt/QNAP-873-SOF1/TV\040Teens autofs rw,relatime,fd=6,pgrp=408,timeout=15,minproto=5,maxproto=5,direct 0 0
/etc/auto.nfs.shares /mnt/QNAP-873-SOF1/Multimedia autofs rw,relatime,fd=6,pgrp=408,timeout=15,minproto=5,maxproto=5,direct 0 0

@dillthedog thanks for checking the mount point info in the logs, totally forgot about that.

@aff13 besides the multitude of access methods you now have configured. It looks like that TV Teens is not a subfolder but a separate NFS share on the QNAP.

Can you run showmount -e 192.168.50.190 and showmount -e 192.168.50.199 and show the output (best copy&paste) so that we understand your setup?

Ah, I see now - thanks for this. The squash option was at the default level of “squash no users”. I subsequently experimented with the other two available options (“squash all users” and “squash root user only”) but it made no difference unfortunately.

I have been looking in great detail into this and there isn’t anything different between the directories. They are all subfolders on the “Multimedia” network share with the exact same properties. NFS access rights are set on the network share itself (i.e. on “Multimedia”), so everything in it should automatically inherit the same access rights. Which indeed seems to be the case from my Windows and LibreElec machines on the network - but for some reason, OSMC just can’t access it.

If they are all subfolders than just mount Multimedia and remove all the other mounts you created

Sure, here is a snapshot of the output (hope it helps?)
snapshot

“TV Teens” is definitely a subdirectory (subfolder) in the “Multimedia” NFS share. There are only three NFS shares on the QNAP (Public, Downloads, and Multimedia).

In any case though, it’s not possible at all to browse into “TV Teens” from OSMC, which shouldn’t be the case irrespective of whether it’s an NFS share or subfolder - as long as the QNAP has set the correct permissions (which is the case, as confirmed with all other non-OSMC systems on the network). Right?

Another thing to mention is that there are no such NFS accessing issues with the “Multimedia 2” share on my second QNAP unit, which has identical settings and access privileges.

Thanks dillthedog for looking into this, appreciate it.

Tbh, I have no idea how I ended up with Kodi-based and kernel-based NFS shares!

This was me experimenting with various NFS solutions proposed on the forum; I tried to read all I could find on the topic and follow the instructions.

In any case, to avoid potential program conflicts and making a mess, I just reinstalled OSMC from scratch.

Unfortunately, the problem remains :frowning:

Even starting from a clean install, I cannot browse into certain subfolders on “Multimedia”.

I am attaching a new log, in case it helps to identify the issue.

Thanks again for your insights.

That would explain the issues you had earlier as you where mounting the parent and subfolder at the same time. AS you now have a clean system I suggest you install autofs and just create a single autofs entry for /mnt/Multimedia with 192.168.50.190:/Multimedia and let’s check the results from there.

So I installed autofs on the clean system and created a single entry for “Multimedia”. Still getting the same problem, with “TV Teens” inaccessible from the OSMC machine :frowning:

I noticed a couple of things that may or may not be relevant. First, the “TV Shows” folder is the only one that comes up in quotation marks. Second, two other folders (Kodi and TEMP) which are inaccessible from the Vero appear in a different colour to all other folders, as per the attached snapshot. These folders remain fully accessible from the LibreElec and Windows machines.

Does either of these things bear any significance?

The quotes are there because “TV Shows” contains a space.

Please upload fresh logs so we can see what’s on the box.

Please on your QNAP Webinterface go into File Manager and show the content of Multimedia something must be different with TV Teens.

They are in different colour and not accessible because of the permission they have. You see that on the left drwxrwx--- the last three --- indicated that world has no access to this folders. So this indicate that there is a user permission issue.

But that would be a different issue as TV Teens which seems to even not show up in the Folder listing.

For the topic access you could try change the share to squash_all_users on the QNAP that should normally mean that all users are mapped to nogroup/nouser but I would really be interested in how the users look like if you check it directly on the QNAP.

Sure, here is the updated log

Thanks

The log is showing errors for more than just “TV Shows/TV Teens”. Here’s one example that’s repeatedly occurring in the Movies section:

2021-08-09 09:04:10.618 T:3736047840    INFO: CNFSFile::Open: Unable to open file : 'Multimedia/Movies/Movies Kids/Movies Kids Animation/BG Movies Collection/Рибката Пи (2006).mkv'  error : 'open call failed with "NFS: ACCESS denied. Required access r--. Allowed access ---"'
2021-08-09 09:04:10.619 T:3736047840   ERROR: Open - failed to open source <nfs://192.168.50.190/Multimedia/Movies/Movies Kids/Movies Kids Animation/BG Movies Collection/Рибката Пи (2006).mkv>
2021-08-09 09:04:10.619 T:3736047840   DEBUG: DoWork - trying to extract filestream details from video file nfs://192.168.50.190/Multimedia/Movies/Movies Kids/Movies Kids Animation/BG Movies Collection/Тайната на горските пазители (2013).mkv

The first line is indicating that it’s a permission problem:

open call failed with "NFS: ACCESS denied. Required access r--. Allowed access ---

@fzinken
@dillthedog

Thanks both for your continued guidance. Having done a lot of additional digging, I think I am finally getting to the bottom of this. I don’t have a solution, but I might have come up with a workaround. I will describe everything below, for the benefit of anyone using the Vero +QNAP combo, who might find themselves in a similar situation.

It seems the issues might be related to the user/owner of the folder in question. I came across this post on the QNAP forums, where another frustrated users claims that “a NAS folder owned by root can never be accessed via NFS”. Therefore, “shared folders and subfolders should NOT belong to root” for NFS access to work.

If the above is true, in my specific case it would imply some folders (e.g. TV Kids) do not belong to root, while others (TV Teens) do, and are therefore inaccessible via NFS.

I still don’t understand:

  1. how different subfolders on the same share ended up with different owners, given that they were all created by the same admin user at approximately the same time?

  2. why there are no NFS access issues whatsoever from the LibreElec machine, but the Vero runs into this problem?

In any case, to test the theory, I created a new subfolder “TV Teens TEST” and copied over some files into it from the original problematic “TV Teens” subfolder. Sure enough, the new “TV Teens TEST” folder appears green in Terminal, has the correct drwxrwxrwx permissions and I was to browse into it.

The bizarre thing is that all subfolders (TV Kids, the new TV Teens TEST and the original problematic TV Teens) have the same permissions and the same owner, as per the attached screenshots. Yet, the first two folders are accessible, and the last one is not.



Anyway, the workaround would be to move all files from “TV Teens” to “TV Teens TEST” and rename the latter folder. That would destroy the Kodi libraries on my other machines (LibreElec and Windows) and would require a lot of additional rescanning, which is far from ideal, but as of now I don’t have any other ideas…

Did you tried squash_all_users and restarting NAS and Vero?

Alternative you could try to add -fstype=nfs4,uid=1000,gid=1000 in your autofs file between the mountpoint and the server IP.