Im running DietPi on a Raspberry Pi 3 B+. Running the latest image of DietPi (v6.14).
I have Sonarr, Transmission and Jackett installed. This is all connected to my network (obviously) and I have mounted a shared from a Western Digital MyCloud. This share has my Movies/Series folder and a Transmission folder.
This was all working perfectly until just the other day. What usually happens when the episode has finished downloading is the episode is moved from the Transmission folder to the Series folder (These are both on the same Share).
I can quite work out when it stopped working, but now I get this error:
Couldn't import episode /mnt/samba/transmission/sonarr/[insert name here].mkv: Access to the path is denied.
I have posted on the Sonarr Forums and what I can gather is that Sonarr doesn’t have permission to write/copy/move the downloaded file to the destination. As seen here by one of the replies:
Given
System.UnauthorizedAccessException: Access to the path “/mnt/samba/Series/[series name]/[tvshow.nfo” is denied.
>
> I’d say the issue is writing to the destination.
Now I'm wondering what has changed??? Like I say, this was working perfectly a few days/weeks ago. Has one of the latest DietPi updates changed permissions somewhere??
Please can someone help?
Thanks in advance everyone..
Thanks so much for taking the time to reply and explain.
Im not that great in the terminal. I was looking how to do this the other day, couldn’t work it out. So thanks for explaining.
Unfortunately that doesn’t seem to have worked… See screen shot below:
Screen Shot 2018-09-05 at 19.20.16.png
Did I do the chown command correctly??
I noticed it has root permissions, that sounded correct to me?
I then tied a manual import of the episodes and I still have the same issue:
After playing around some more with this issue, I can see the permissions is the problem. However I cannot change them. I even installed Webmin and tried to use that to change the permissions (as my terminal work isnt great at all). I could still not change the permissions/owner in Webmin.
Something must have changed in the coding in one of the latest DietPi image updates???
I eventually got so frustrated with it that I formatted the SD and did a clean install of Sonarr, Transmission, Jacket and Webmin. Tried changing permissions/owners again in terminal, no joy. Tried again on Webmin, no joy. It seems its resisting the change…
I configured Sonarr with Jackett and Transmission, went to add my Series and got this error:
I tried exactly what you said. Screenshot below shows the commands and then a “ls -lha /directory” so see if anything changed. Unfortunately, nothin did…?
Yip, It is almost like the DietPi software is refusing to change the user/owner or the permissions. I have done it via terminal, via the DietPi explorer in “dietpi-launcher” and also in Webmin. They just cannot be changed.
I sat up the other night with a very experienced software developer and they were boggled by it too…
So please can this be escalated??? It seems the latest DietPi image, v6.14, is not working as it should??
finch_6
Sorry for the late attention. I opened an issue about it on Github to force a solution in v6.15 release, or at least to find a workaround for your case to apply: https://github.com/Fourdee/DietPi/issues/2067
I never really used network drives, so can just guess what could be a reason that your chown/chmod attempts failed:
Can you check if the file system of the Samba server actually supports permissions? E.g. usual Windows file systems NTFS and FAT do not support the POSIX permissions that you apply on Linux systems via chown/chmod. An NTFS drive directly attached to a Linux system at least does not support it. I am now not sure, how this is handled in case of network drives, but it makes sense that it is the same there.
A thinkable solution, that goes hand in hand with the case, that ls -al actually shows root:root and 755 permissions, is that somehow by the mount driver just Samba client side, permissions are applied. Possibly one can change those permissions via some Samba/mount settings. In this case we would need to change the permissions client-side to dietpi:dietpi 775 (or 770), which would allow read/write access for Sonarr and other software.
About what changed with v6.12:
For security and consistency reasons we switched several software titles to run not as root user any more, but as an own user. E.g. Sonarr now runs as user sonarr, with limited access to the /mnt/dietpi_userdata directory and it’s own install, config and data directories of course.
We solved cross access (Media players => downloader directories, downloaders => network share (Server!) dirs and such) via dietpi user group. Sonarr runs as dietpi group (sonarr:dietpi) which allows read/write access to shares, download and media dirs etc.
But to be true, we did not yet think about network mounts, just about cases where the DietPi system is network share server . And if permissions cannot be applied, this is a further difficulty, as above.
i"m having the exact same issue with a mounted Samba share, from the terminal i can create folders etc. but none of the services i installed (sonarr, radarr, sabnzbdplus) are able to create files on the /mnt/share i tried to play with some setting withing the /etc/fstab file but so far no luck , is there a way to change the users these services are running on?
Since this wasn’t resolved in v6.15, is there any way to “roll back” to a version of DietPi that didn’t have this issue??
At least until it is resolved???
Im all for having the latest version of any software (even test builds), but this is one I’d rather go back to an older version until its fixed…
Unfortunately, it is not possible to roll back to a previous DietPi version, unless you have a DietPi-Backup of the system, which can be used to restore.
Failing the above, i’ll give you information in regards to setting the run-level user for those applications to root (which will make some “security” aware users cry )
sed -i 's/,iocharset=utf8,vers=/,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=/g' /etc/fstab
umount /mnt/samba
mount -a
ls -al /mnt/samba
NB: Replace /mnt/samba with the actual mount location.
The above sets user (uid) and group (gid), as well as global file and directory permissions for the whole samba share. dietpi:dietpi 770 should allow r/w access for Sonarr and such, as these software titles run as their own user, but as dietpi group.
umount and remount is needed to apply the changes, then check via ls -al.
Somehow external guides mention that as well Samba server side there need to be changes done, but it worked here to create a totally new user, set it as uid+gid, remount and access + create files with this user within the mount.
Fourdee
I think we should set this as default for samba mounts, to allow access for our download and media software?
I am going to find out how to achieve the same for nfs mounts.