Closed codedesperate closed 1 year ago
Unfortunately there's not a lot that rtcontrol can do if the OS decides that you're not allowed to delete the directory. However, keep in mind that when deleting a directory, you actually need write permissions on the parent directory, so if you can't rmdir /home/user/rtorrent/download/rtorrent_sonarr2/
, check the permissions on /home/user/rtorrent/download/
.
Hi @kannibalox , I tried 777 that path too and it didn't work.
But I really don't think it is a permission problem. Because rtcontrol did access the path, and it did delete the file /home/user/rtorrent/download/rtorrent_sonarr2/downloaded_file
So I don't even understand why it is giving a permission error when it successfully deleted the file in that folder. The only thing it did not do, was to remove the torrent file from rtorrent (So it still shows up in rutorrent, but if I click force filecheck, it will also report the file missing as it did delete the file.
So /home/user/rtorrent/download/rtorrent_sonarr2/downloaded_file
was cleaned up fine, but now rtcontrol is trying to clean up /home/user/rtorrent/download/rtorrent_sonarr2/
(the base directory), where it's getting the error. Can you successfully run rmdir /home/user/rtorrent/download/rtorrent_sonarr2/
as the same user as rtcontrol? That's all rtcontrol is trying to do, and it won't continue on to clean the item out of rtorrent until it doesn't encounter any exceptions.
As a silly workaround, rtcontrol will skip over any directories that aren't empty, so if you create an empty file, e.g. (touch /home/user/rtorrent/download/rtorrent_sonarr2/.keep
), it should just continue past it.
Yes, the rmdir command works!
user@user:~/rtorrent/download$ rmdir /home/user/rtorrent/download/rtorrent_sonarr2/
rmdir: failed to remove '/home/user/rtorrent/download/rtorrent_sonarr2/': Directory not empty
user@user:~/rtorrent/download$
So then it's not permission issues right? And it is the same user running that rmdir command as the rtcontrol command. Really everything on this server runs as "user".
The Directory not empty
error will be raised before the permissions check, would it be possible to try and rmdir
that directory while it is empty? That should expose if there's still a permission problem.
Where I'm getting stuck on is that the core error isn't anything pyrosimple-specific, you should be able to replicate it directly with rmdir
or the following command:
python -c "import pathlib; pathlib.Path('/home/user/rtorrent/download/rtorrent_sonarr2').rmdir()"
I see, the core error seems strange indeed. And I appreciate any help you are willing to give!
Running: python -c "import pathlib; pathlib.Path('/home/user/rtorrent/download/rtorrent_sonarr2').rmdir()"
gave the following error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named pathlib
I then tried emptying the library to run rmdir /home/user/rtorrent/download/rtorrent_sonarr2/
on.
I do indeed get rmdir: failed to remove 'rtorrent_sonarr2': Permission denied
and I have absolutely no idea why.
even with the 777 perms on /home/user/rtorrent/download/
and on /home/user/rtorrent/download/rtorrent_sonarr2
I get permission denied.
Just guessing now, but I'm not sure if it has any impact that /home/user/rtorrent/download/
is a mergerfs filesystem. Though rtcontrol works just fine on the library /home/user/rtorrent/download/rtorrent_radarr
.
Thank you for the help once again @kannibalox I figured it out :D
It was indeed mergerfs that tricked me. All path's was owned by correct user, with the exception of one of the SSD's in my mergerfs where the base folder /mnt/ssd2
the disk was mounted on was root:root...
Thank you making me realise this :)
Hi, I am running the following rtcontrol command:
rtcontrol then gives me this error message:
I tried giving permissions 777, but I still got the error.
I then discovered that the file on disk in the path
'/home/user/rtorrent/download/rtorrent_sonarr2/torrent_to_be_deleted'
actually did get deleted, but it just did not get deleted in rtorrent.The user running the rtcontrol command is also the user running the rtorrent process and is the owner of all the paths.
I don't understand why I get the permissions denied error when it does have the permissions, and it also deleted the torrent_file in path, but not in rtorrent which is run by the same user.
I experienced this on v.2.8.0. I just updated to v.2.9.0 and still facing this issue.