All this is a moot issue without the big man in the conversation.
Plugin losing permissions intermittently?
-
- OMV 1.0
- theory
-
-
Here's what CP told me in the logs tonight. In this case, a new mkv file was sync'd. CP renamed and copied it into my media library, however it failed to remove the folder & file from the sync library and came back with these errors. This file did not have to be unrar'd. Again this is why I posted this as an intermittent error, in this case the file successfully renamed and copied to my media library but did not delete the source. Other times it un rar's and creates a new folder in my media library but does not move the unrar'd file to the library, and other times it does nothing...
Code
Alles anzeigen07-09 21:25:16 ERROR [tato.core.plugins.renamer] Successfully moved file "/media/87d2d42c-e3f9-40c6-903e-c56d537bb929/Media/Movies/ABC (2014)/ABC(2014).mkv", but something went wrong: Traceback (most recent call last): File "/opt/couchpotato/couchpotato/core/plugins/renamer.py", line 824, in moveFile shutil.move(old, dest) File "/usr/lib/python2.7/shutil.py", line 302, in move os.unlink(src) OSError: [Errno 13] Permission denied: '/media/87d2d42c-e3f9-40c6-903e-c56d537bb929/Sync/ABC.2014.1080p.WEB-DL.x264.AAC-JYK/ABC 2014 1080p WEB-DL x264 AAC-JYK.mkv' 07-09 21:25:16ERROR[tato.core.plugins.renamer] Couldn't move file "/media/87d2d42c-e3f9-40c6-903e-c56d537bb929/Sync/ABC.2014.1080p.WEB-DL.x264.AAC-JYK/ABC 2014 1080p WEB-DL x264 AAC-JYK.mkv" to "/media/87d2d42c-e3f9-40c6-903e-c56d537bb929/Media/Movies/ABC (2014)/ABC(2014).mkv": Traceback (most recent call last): File "/opt/couchpotato/couchpotato/core/plugins/renamer.py", line 829, in moveFile os.unlink(old) OSError: [Errno 13] Permission denied: '/media/87d2d42c-e3f9-40c6-903e-c56d537bb929/Sync/ABC.2014.1080p.WEB-DL.x264.AAC-JYK/ABC 2014 1080p WEB-DL x264 AAC-JYK.mkv' 07-09 21:25:16ERROR[tato.core.plugins.renamer] Failed renaming the file "ABC 2014 1080p WEB-DL x264 AAC-JYK.mkv" : Traceback (most recent call last): File "/opt/couchpotato/couchpotato/core/plugins/renamer.py", line 620, in scan self.moveFile(src, dst, use_default = not is_torrent or self.fileIsAdded(src, group)) File "/opt/couchpotato/couchpotato/core/plugins/renamer.py", line 829, in moveFile os.unlink(old) OSError: [Errno 13] Permission denied: '/media/87d2d42c-e3f9-40c6-903e-c56d537bb929/Sync/ABC.2014.1080p.WEB-DL.x264.AAC-JYK/ABC 2014 1080p WEB-DL x264 AAC-JYK.mkv' 07-09 21:25:16ERROR[hpotato.core.plugins.base] Unable writing to file "/media/87d2d42c-e3f9-40c6-903e-c56d537bb929/Sync/ABC.2014.1080p.WEB-DL.x264.AAC-JYK/ABC 2014 1080p WEB-DL x264 AAC-JYK.failed_rename.ignore": Traceback (most recent call last): File "/opt/couchpotato/couchpotato/core/plugins/base.py", line 143, in createFile f = open(path, write_type) IOError: [Errno 13] Permission denied: '/media/87d2d42c-e3f9-40c6-903e-c56d537bb929/Sync/ABC.2014.1080p.WEB-DL.x264.AAC-JYK/ABC 2014 1080p WEB-DL x264 AAC-JYK.failed_rename.ignore
-
Can you replace your init script with this one?
Code
Alles anzeigen#! /bin/sh ### BEGIN INIT INFO # Provides: couchpotato # Required-Start: $local_fs $network $remote_fs # Required-Stop: $local_fs $network $remote_fs # Should-Start: $NetworkManager # Should-Stop: $NetworkManager # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts instance of CouchPotato # Description: starts instance of CouchPotato using start-stop-daemon ### END INIT INFO ############### EDIT ME ################## # path to app APP_PATH=/opt/couchpotato/ # user RUN_AS=couchpotato # path to python bin DAEMON=/usr/bin/python # Path to store PID file PID_FILE=/var/run/couchpotato/server.pid PID_PATH=$(dirname $PID_FILE) #umask UMASK=002 # script name NAME=couchpotato # app name DESC=CouchPotato # startup args DAEMON_APP="${APP_PATH}CouchPotato.py" DAEMON_OPT="--daemon" DAEMON_FILE="--pid_file=${PID_FILE}" ############### END EDIT ME ################## test -x $DAEMON || exit 0 set -e case "$1" in start) echo "Starting $DESC" rm -rf $PID_PATH || return 1 install -d --mode=0755 -o $RUN_AS $PID_PATH || return 1 start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background -k $UMASK --pidfile $PID_FILE --exec $DAEMON -- $DAEMON_APP $DAEMON_OPT $DAEMON_FILE ;; stop) echo "Stopping $DESC" start-stop-daemon --stop --pidfile $PID_FILE --retry 15 ;; restart|force-reload) echo "Restarting $DESC" start-stop-daemon --stop --pidfile $PID_FILE --retry 15 start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background -k $UMASK --pidfile $PID_FILE --exec $DAEMON -- $DAEMON_APP $DAEMON_OPT $DAEMON_FILE ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0
When you replace it make sure you click on the the right upper corner of the code box here, so no weird characters go in the paste
-
I will try. I'll have to google/teach myself how to do that first, I'm still quite a newb here, I had to look up the definition of daemon and init early
-
Can you replace your init script with this one?
When you replace it make sure you click on the the right upper corner of the code box here, so no weird characters go in the paste
Back from searching....
Do I edit like this: nano /etc/init.d/couchpotato
and entirely replace everything in that file with your config?
-
and entirely replace everything in that file with your config?
yes, but you can do mv /etc/init.d/couchpotato /root/couchpotato.init.original to backup
nano /etc/init.d/couchpotato paste the contents, ctrl+x to save
thenchmod +x /etc/init.d/couchpotato
Start the daemon /etc/init.d/couchpotato start
-
Will do. To be clear, can I do all this via ssh, with web ui running, or do i need to do this from the server itself?
-
yes in ssh. The webui can be running, no problem there.
-
ok I've made the changes and restarted cp, seems to be up and running. I have an MKV file syncing now. I'll report on status in the morning. If that works fine I'll proceed with a rar.
I almost forgot, thank you very much for your support! I hope I can help contribute soon.
-
Can you post your whole tree structure and permissions? you have to install tree apt-get install tree
tree /media/87d2d42c-e3f9-40c6-903e-c56d537bb929/ -L 2 -pug
Also is /media/87d2d42c-e3f9-40c6-903e-c56d537bb929/ a pool? like AUFS, MHDFS or Snapraid?
-
The file finished sooner than expected, the exact same scenario happened again. CP created a folder in my media share, CP copied the file to new folder and renamed it, old file and folder in Sync share could not be deleted, permission denied.
I think I will reset permissions on the Sync folder to 777 and reboot the server. Than I will initiate another mkv file to be downloaded. If that works I'll initiate a rar file.
Posted at same time as you. I will do the above. BRB
media/87d2d42c-e3f9-40c6-903e-c56d537bb929/ is my aufs pool. no raid.
-
Can you post your whole tree structure and permissions? you have to install tree apt-get install tree
tree /media/87d2d42c-e3f9-40c6-903e-c56d537bb929/ -L 2 -pug
Also is /media/87d2d42c-e3f9-40c6-903e-c56d537bb929/ a pool? like AUFS, MHDFS or Snapraid?
I ran the tree command as noted above, the result is a MASSIVE tree structure(25286 directories, 41564 files) with all sorts of plex files. I can't even scroll to the top of the tree... I'm not sure how to show you the whole structure.
Here's the tree structure for my Sync folder that I was fortunate to see at the bottom of the structure, This is the folder which syncs using Syncthing where CP has the most trouble deleting or unrar-ing files.
[drwxrwsr-x root users ] Sync
└── [drwxr-sr-x theory users ] ABC.1080p.BluRay.x264-SECTOR7
└── [-rw-r--r-- theory users ] ABC.1080.mkv -
The problem comes with the permissions from the remote server. Can you print the ls -la /remotesyncfolder in the seedbox. Also
Also who's creating the remote file? rtorrent?
Also the forums is kinda dizzy, you can come to IRC freenode to the channel
-
~/Sync $ ls -la
total 4
drwx------ 3 the0ry the0ry 105 Jul 10 01:41 .
drwxr-x--- 10 the0ry the0ry 4096 Jul 10 01:41 ..
drwxrwx--- 2 the0ry the0ry 47 Jul 10 01:41 ABC.1080p.BluRay.x264-SECTOR7
-rw-r--r-- 1 the0ry the0ry 0 Jul 2 17:17 .stfolderruTorrent is the client on the seedbox.
I'll look to see how I can join the IRC, I've never been in IRC before.
-
drwxrwx--- 2 the0ry the0ry 47 Jul 10 01:41 ABC.1080p.BluRay.x264-SECTOR7
That's the problem, CP can only delete/create where it has permissions. I hate to say it but if you added the users group to user "the0ry" then it should work.I am not sure what permissions your "the0ry" users has but you could run CP as that user, this will work for the above error but my create others.
Zitat# user
RUN_AS=the0ry -
We found the problem. He had an option in the remote syncthing seedbox that was ignore permission turned on.
This prevented rw for group. Syncthing doesn't transfer ownership, but does transfer file mode. So the file should at least be 770 or 660 in the omv server mirroring the permission from the remote server.the ownership you mention there is in the remote server seedbox so it doesnt
matter for couch potato. -
Good to hear he's fixed the problem and well done to you for helping him find the issue.
-
With the permission box unchecked, and the init script changed as per subzero79, 1 mkv file was sync'd, renamed, transferred without issue this morning.
I'm going to proceed with a rar file now and see how that goes.
Subzero did mention I might run into issues deleting files in samba that cp has created but I'll work on this first before testing that.
-
Just watch the unpacking of the file, with the umask setting of CP it should come as 664, that would leave the file to be used deleted or renamed by others, samba, ftp, etc.
-
I just got my notification email from cp and I saw the file was moved out of my Sync folder. That's all I can tell while I'm away from OMV. It appears to have unrar'd and done everything it should have though. Sending another rar through. So far it looks like tgat script did the trick.
When I get home ill check the permissions on the files cp created and report back.
Update: the following rar file seems to have worked as well. I'll confirm when I get home however I think this is up and running now.
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!