CP creates read-only folders

CouchPotato is an automatic NZB and torrent downloader.
You can keep a "want to watch"-list and it will search for NZBs/torrents of these items every X hours. Once a correct release is found, matching the correct quality, it will send it to SABnzbd or download the .nzb or .torrent to a specified directory.

Moderator: Lillian.W@AST

Post Reply
jaansson
Posts: 6
youtube meble na wymiar Warszawa
Joined: Thu Apr 17, 2014 9:02 pm

CP creates read-only folders

Post by jaansson »

I've been messing around with this for a while now. When CP has processed any downloaded movies, it (most of the times) makes the folder unaccessible by setting group ownership to root. Sometimes it won't even finish processing everything. For example, one movie yesterday ended up just having an .nfo file in it. Another one had just the movie itself. None of them were accessible for me before I set group ownership of the folders manually to admin. It's getting pretty frustrating. Sometimes it works, though. I guess the reason for it not moving the files everytime would be due to the fact it creates the folder without permission for even CP itself to enter it? The log usually says something about permission.

Code: Select all

04-17 13:09:38 INFO [tato.core.plugins.renamer] Renaming "/volume1/Public/Downloads/movies/Noah.2014.PROPER.DVDRip.XviD-Sup.nfo 0164 - Noah.2014.PROPER.DVDRip.XviD-Sup.nfo yEnc (11).cp(tt1959490)/Noah.2014.PROPER.DVDRip.XviD-Sup/Noah.2014.PROPER.DVDRip.XviD-Sup.avi" to "/volume1/Public/Filmer/Noah (2014)/Noah(2014).avi"

04-17 13:09:56 ERROR [tato.core.plugins.renamer] Successfully moved file "/volume1/Public/Filmer/Noah (2014)/Noah(2014).avi", but something went wrong: Traceback (most recent call last):
  File "/volume1/.@plugins/AppCentral/couchpotato/CouchPotato/couchpotato/core/plugins/renamer/main.py", line 741, in moveFile
    shutil.move(old, dest)
  File "/usr/local/AppCentral/python/lib/python2.7/shutil.py", line 300, in move
    os.unlink(src)
OSError: [Errno 13] Permission denied: '/volume1/Public/Downloads/movies/Noah.2014.PROPER.DVDRip.XviD-Sup.nfo 0164 - Noah.2014.PROPER.DVDRip.XviD-Sup.nfo yEnc (11).cp(tt1959490)/Noah.2014.PROPER.DVDRip.XviD-Sup/Noah.2014.PROPER.DVDRip.XviD-Sup.avi'

04-17 13:09:56 ERROR [tato.core.plugins.renamer] Couldn't move file "/volume1/Public/Downloads/movies/Noah.2014.PROPER.DVDRip.XviD-Sup.nfo 0164 - Noah.2014.PROPER.DVDRip.XviD-Sup.nfo yEnc (11).cp(tt1959490)/Noah.2014.PROPER.DVDRip.XviD-Sup/Noah.2014.PROPER.DVDRip.XviD-Sup.avi" to "/volume1/Public/Filmer/Noah (2014)/Noah(2014).avi": Traceback (most recent call last):
  File "/volume1/.@plugins/AppCentral/couchpotato/CouchPotato/couchpotato/core/plugins/renamer/main.py", line 745, in moveFile
    os.unlink(old)
OSError: [Errno 13] Permission denied: '/volume1/Public/Downloads/movies/Noah.2014.PROPER.DVDRip.XviD-Sup.nfo 0164 - Noah.2014.PROPER.DVDRip.XviD-Sup.nfo yEnc (11).cp(tt1959490)/Noah.2014.PROPER.DVDRip.XviD-Sup/Noah.2014.PROPER.DVDRip.XviD-Sup.avi'

04-17 13:09:56 ERROR [tato.core.plugins.renamer] Failed ranaming the file "Noah.2014.PROPER.DVDRip.XviD-Sup.avi" : Traceback (most recent call last):
  File "/volume1/.@plugins/AppCentral/couchpotato/CouchPotato/couchpotato/core/plugins/renamer/main.py", line 548, in scan
    self.moveFile(src, dst, forcemove = not self.downloadIsTorrent(release_download) or self.fileIsAdded(src, group))
  File "/volume1/.@plugins/AppCentral/couchpotato/CouchPotato/couchpotato/core/plugins/renamer/main.py", line 745, in moveFile
    os.unlink(old)
OSError: [Errno 13] Permission denied: '/volume1/Public/Downloads/movies/Noah.2014.PROPER.DVDRip.XviD-Sup.nfo 0164 - Noah.2014.PROPER.DVDRip.XviD-Sup.nfo yEnc (11).cp(tt1959490)/Noah.2014.PROPER.DVDRip.XviD-Sup/Noah.2014.PROPER.DVDRip.XviD-Sup.avi'

04-17 13:09:56 ERROR [hpotato.core.plugins.base] Unable writing to file "/volume1/Public/Downloads/movies/Noah.2014.PROPER.DVDRip.XviD-Sup.nfo 0164 - Noah.2014.PROPER.DVDRip.XviD-Sup.nfo yEnc (11).cp(tt1959490)/Noah.2014.PROPER.DVDRip.XviD-Sup/Noah.2014.PROPER.DVDRip.XviD-Sup.failed_rename.ignore": Traceback (most recent call last):
  File "/volume1/.@plugins/AppCentral/couchpotato/CouchPotato/couchpotato/core/plugins/base.py", line 109, in createFile
    f = open(path, 'w+' if not binary else 'w+b')
IOError: [Errno 13] Permission denied: '/volume1/Public/Downloads/movies/Noah.2014.PROPER.DVDRip.XviD-Sup.nfo 0164 - Noah.2014.PROPER.DVDRip.XviD-Sup.nfo yEnc (11).cp(tt1959490)/Noah.2014.PROPER.DVDRip.XviD-Sup/Noah.2014.PROPER.DVDRip.XviD-Sup.failed_rename.ignore'
I've set file and folder permissions to 0766, just as I read in another thread. Would be nice to have it work properly, as this seem like a really awesome solution :roll:

I'd be very thankful for any help!
User avatar
clinton.hall
Posts: 845
Joined: Thu May 09, 2013 7:01 pm
Location: New Zealand
Contact:

Re: CP creates read-only folders

Post by clinton.hall »

CouchPotato should run as admin user... If it is still running as root group I'll try and update the apkg to fix this.

What should the group be (admin, administrators, users?)
AS-604T
3 x ST4000DM0000 (Seagate 4TB) in Raid5
2 GB RAM expansion
AS-302T

Apps (user)
NZBGet - CouchPotato - SickBeard - Git - Python

Apps (maintainer):
NZBGet - BitTorrent Sync - Mylar - LazyLibrarian - Gamez
-Maintenance of Apps acquired from JohhnyFive since ADM2.0:
SABnzbd - CouchPotato - SickBeard - HeadPhones - Subsonic

About Me: http://fockwulf.wix.com/index
jaansson
Posts: 6
Joined: Thu Apr 17, 2014 9:02 pm

Re: CP creates read-only folders

Post by jaansson »

Administrator group seem to be what's working.

Thanks for your reply!
User avatar
clinton.hall
Posts: 845
Joined: Thu May 09, 2013 7:01 pm
Location: New Zealand
Contact:

Re: CP creates read-only folders

Post by clinton.hall »

I had assumed setting a user in start-stop-daemon actually used the group for that user... apparently not.

I'll try and update soon.
AS-604T
3 x ST4000DM0000 (Seagate 4TB) in Raid5
2 GB RAM expansion
AS-302T

Apps (user)
NZBGet - CouchPotato - SickBeard - Git - Python

Apps (maintainer):
NZBGet - BitTorrent Sync - Mylar - LazyLibrarian - Gamez
-Maintenance of Apps acquired from JohhnyFive since ADM2.0:
SABnzbd - CouchPotato - SickBeard - HeadPhones - Subsonic

About Me: http://fockwulf.wix.com/index
jaansson
Posts: 6
Joined: Thu Apr 17, 2014 9:02 pm

Re: CP creates read-only folders

Post by jaansson »

That's great, thanks for taking yourself time to help!
User avatar
clinton.hall
Posts: 845
Joined: Thu May 09, 2013 7:01 pm
Location: New Zealand
Contact:

Re: CP creates read-only folders

Post by clinton.hall »

I have updated, but AppCentral isn't letting me upload right now.

if you want, you can edit /usr/local/AppCentral/couchpotato/CONTROL/start-stop.sh

change

Code: Select all

RUN_AS="admin"
to

Code: Select all

RUN_AS="admin:administrators"
This is the same for SABnzbdplus, SickBeard etc... I will submit them all once the issue with AppCentral is resolved.
AS-604T
3 x ST4000DM0000 (Seagate 4TB) in Raid5
2 GB RAM expansion
AS-302T

Apps (user)
NZBGet - CouchPotato - SickBeard - Git - Python

Apps (maintainer):
NZBGet - BitTorrent Sync - Mylar - LazyLibrarian - Gamez
-Maintenance of Apps acquired from JohhnyFive since ADM2.0:
SABnzbd - CouchPotato - SickBeard - HeadPhones - Subsonic

About Me: http://fockwulf.wix.com/index
keagy
Posts: 28
Joined: Sat May 24, 2014 1:30 pm

Re: CP creates read-only folders

Post by keagy »

clinton.hall wrote:CouchPotato should run as admin user... If it is still running as root group I'll try and update the apkg to fix this.

What should the group be (admin, administrators, users?)
I have the latest CouchPotato installed and it is running as admin user. The renamer is still creating a "default folder where the movie are moved to" where owner has read only access, and all other users have no access. I verified that the default user is admin, and the folder CHMOD is set to 777. Any ideas on how to fix?
User avatar
clinton.hall
Posts: 845
Joined: Thu May 09, 2013 7:01 pm
Location: New Zealand
Contact:

Re: CP creates read-only folders

Post by clinton.hall »

Change the Folder CHMOD to 0777
I think that leading 0 being left of causes the first 7 to be applying the system bit...
AS-604T
3 x ST4000DM0000 (Seagate 4TB) in Raid5
2 GB RAM expansion
AS-302T

Apps (user)
NZBGet - CouchPotato - SickBeard - Git - Python

Apps (maintainer):
NZBGet - BitTorrent Sync - Mylar - LazyLibrarian - Gamez
-Maintenance of Apps acquired from JohhnyFive since ADM2.0:
SABnzbd - CouchPotato - SickBeard - HeadPhones - Subsonic

About Me: http://fockwulf.wix.com/index
keagy
Posts: 28
Joined: Sat May 24, 2014 1:30 pm

Re: CP creates read-only folders

Post by keagy »

clinton.hall wrote:Change the Folder CHMOD to 0777
I think that leading 0 being left of causes the first 7 to be applying the system bit...
Thanks, that fixed the problem. I don't why the standard install didn't include the leading zero.
Post Reply

Return to “CouchPotato”