Mopidy Discourse

Problems accessing files via NFS

Hi,

I am new to mopidy and have limited linux experience. I managed to get most of mopidy running without too much difficulty. Now I am trying to browse/play music from a network folder. The folder is on a Synology NAS. I did not manage to mount the folder using SMB, but it works with NFS. After putting it into fstab, it is mounted at startup and I can access it manually using ssh on the Raspberry Pi that runs mopidy.

My config-file has a single line in the [file] section:

<
media_dirs = /music/Network/flac/ | NAS
/>

“/music/Network/flac/” is the folder that the network folder is mounted in.

I am using musicbox webclient, mopidy mobile (android) and remotedy (android) for testing.

I know that mopidy uses the “mopidy” user profile and guess that it may have something to do with access rights to the shared folder. Hence, I created a user group “music” on the raspberry pi that has the users “pi” and “mopidy”. Then I changed ownership of the /music/Network/flac/ directory to this group using chown. Still, I am not sure, if that worked properly. How do I check, if mopidy has the required access rights?

What else could be the problem?

Thank you!

You could check by running:

sudo -u mopidy bash -c 'ls /music/Network/flac/'

Thank you for the hint.

When entering the line you suggested, I get a list of folders in /music/Network/flac. I tried

sudo -u mopidy bash -c ‘ls -la /music/Network/flac’

for more information on access rights. The result is as an example:

drwxrwxrwx 3 1026 users 4096

It appears that user 1026 owns these folders.

I tried

sudo chown :music /music/Network/flac

The result is (translated from German):

“chown: the group of ‘/music/Network/flac’ is changed: the operation is not allowed”

I do not recall seing this line before, but obviously I cannot change ownership of this folder.

Here are some other things I just tried:

On the Synology NAS I configured “map all users to admin” for the NFS shared folder.

On the Raspberry Pi, I added mopidy to the group “users”.

Unfortunately, this did not work. I still do not see the /music/Network/flac folder on the clients I used for testing. I do see my spotify account, which works fine.

I did some further reading on user rights. I checked the folders and files under /music/Network/flac/. All of them have “-rwxrwxrwx”. Obviously, every user has full access rights, including mopidy. It appears that rights are not the issue. Still I do not see any music files.

What else can I try?

Can you try and access the files and then have a look in the Mopidy log for any errors: sudo journalctl -u mopidy --boot. Can you also ensure you have edited the correct log file by displaying the effective config with sudo mopidyctl config.

There seems to be an error in the config file. I received the following output in the log:

Jan 09 00:04:27 raspberrypi mopidy[686]: WARNING [MainThread] mopidy.file.library /music/Network/flac/ is not a directory. Please create the directory or update the file/media_dirs config value.

My mopidy.conf says

[file]
media_dirs = /music/Network/flac/ | NAS

I mounted the shared folder in /etc/fstab as follows:

DiskStation:/volume1/music /music/Network nfs rsize=8192,wsize=8192,timeo=14,intr

When I navigate to the folder on the Pi, I can see the folder and the files. It is mounted. Is there a mistake in the mopidy.conf?

I had a play around, seems we really don’t like those spaces you added. It should be:

[file]
media_dirs = /music/Network/flac/|NAS

This is a bug, we should either silently handle this or provide a more helpful error message. Even adding some quotes around the path would have made the problem obvious.

Note that if you only have one entry for this list you won’t get an extra directory level containing a folder named “NAS” as for a single directory it’s not necessary. But if you had multiple entries e.g.

[file]
media_dirs = 
    /music/Network/flac/|NAS
    /some/other/path|My Other Music

Then you’d find the browsing directory for Files has an extra level:

- Browse
    - Files
        - NAS
            - <contents of directory /music/Network/flac>
        - My Other Music
            - <contents of directory /some/other/path>

I created a new issue for this: Extra spaces in File backend's media_dirs setting are not ignored · Issue #1965 · mopidy/mopidy · GitHub

Thank you very much! It works now.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.