Page 1 of 1

CP creates read-only folders

Posted: Thu Apr 17, 2014 9:14 pm
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!

Re: CP creates read-only folders

Posted: Fri Apr 18, 2014 6:10 am
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?)

Re: CP creates read-only folders

Posted: Fri Apr 18, 2014 6:47 am
by jaansson
Administrator group seem to be what's working.

Thanks for your reply!

Re: CP creates read-only folders

Posted: Fri Apr 18, 2014 11:05 am
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.

Re: CP creates read-only folders

Posted: Sat Apr 19, 2014 10:16 pm
by jaansson
That's great, thanks for taking yourself time to help!

Re: CP creates read-only folders

Posted: Mon Apr 21, 2014 11:51 am
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.

Re: CP creates read-only folders

Posted: Mon Jun 02, 2014 1:15 pm
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?

Re: CP creates read-only folders

Posted: Mon Jun 02, 2014 4:10 pm
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...

Re: CP creates read-only folders

Posted: Mon Jun 02, 2014 8:12 pm
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.