CouchPotato corrupts movies when copying them

Status
Not open for further replies.

Jrjy3

Dabbler
Joined
Jan 3, 2015
Messages
23
I've been having this problem for a while, but it hasn't ever bothered me enough to ask for help. It still doesn't bother me too much, but it is annoying.

I've occasionally had problems when playing back a movie that CouchPotato has processed. In the middle of playback, the video would just stop and refuse to play anything past that point. This happens in all the players I've tried (VLC, streaming via Plex, Windows Media Player). While this isn't every video processed by CouchPotato, it happens about 30-40% of the time.

Right now, I have the processing method set to copy and rename the files from /media/downloads to /media/movies (both of which are shares in the jail). I have ensured that CouchPotato is able to read/write to both locations using user and group ID 816.

When I play the original file in the downloads folder, I have no issues with playback. This only happens with the files processed by CouchPotato.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I've been having this problem for a while, but it hasn't ever bothered me enough to ask for help. It still doesn't bother me too much, but it is annoying.

I've occasionally had problems when playing back a movie that CouchPotato has processed. In the middle of playback, the video would just stop and refuse to play anything past that point. This happens in all the players I've tried (VLC, streaming via Plex, Windows Media Player). While this isn't every video processed by CouchPotato, it happens about 30-40% of the time.

Right now, I have the processing method set to copy and rename the files from /media/downloads to /media/movies (both of which are shares in the jail). I have ensured that CouchPotato is able to read/write to both locations using user and group ID 816.

When I play the original file in the downloads folder, I have no issues with playback. This only happens with the files processed by CouchPotato.
If you use the 'move' method instead, and have the download folder and final media location on the same dataset/mountpoint, then CP's move will just be a rename. The file wouldn't even be touched in this case, just a pointer would be changed.

But, this sounds strange to me, as far as I know there's nothing about CP that works different then any other program when moving files.
 

Jrjy3

Dabbler
Joined
Jan 3, 2015
Messages
23
If you use the 'move' method instead, and have the download folder and final media location on the same dataset/mountpoint, then CP's move will just be a rename. The file wouldn't even be touched in this case, just a pointer would be changed.

But, this sounds strange to me, as far as I know there's nothing about CP that works different then any other program when moving files.

Do you mean have it move and rename from the downloads folder right back to the downloads folder?

That does seem like it would work, though with my current system, I see two possible problems with that. I prefer to keep seeding things after they're downloaded so I can keep my ratio up on private trackers, although I could manually relocate the files to keep seeding. Additionally, would Plex be able to differentiate between movies and TV shows to separate them out into separate libraries? If anything, I would want them at least into separate TV/Movies folders for my own organizational purposes.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
No that's not what I meant. I meant still having separate video and download locations, but both of them being on the same dataset mounted into the jail.
The 'copy' method actually writes a file (which should be corrupted but for some strange reason is being corrupted in your case).
The 'move' method does write the file at all, just changes some filesystem metadata so there's no chance of the video file being corrupted.

Since you want to keep seeding, a possible solution is to use the 'Link' method. I'm not sure if this uses hard-links or symbolic-links. hard-links would require the same dataset as I mentioned earlier, but also take no extra space. Symbolic links would work regardless, depending on if they are absolute or relative links might not work when using the link from a different perspective as the jail (like the freenas host)
 

Jrjy3

Dabbler
Joined
Jan 3, 2015
Messages
23
No that's not what I meant. I meant still having separate video and download locations, but both of them being on the same dataset mounted into the jail.
The 'copy' method actually writes a file (which should be corrupted but for some strange reason is being corrupted in your case).
The 'move' method does write the file at all, just changes some filesystem metadata so there's no chance of the video file being corrupted.

Since you want to keep seeding, a possible solution is to use the 'Link' method. I'm not sure if this uses hard-links or symbolic-links. hard-links would require the same dataset as I mentioned earlier, but also take no extra space. Symbolic links would work regardless, depending on if they are absolute or relative links might not work when using the link from a different perspective as the jail (like the freenas host)

Adding /media/ as it's own mount point (not /media/downloads and /media/movies separately) didn't seem to fix the problem.

I don't remember the specific problem I had with using links, but I tried it when I first set up CouchPotato and it didn't work. I'll give it another go as it now says in the tooltip that it tries a hard link, then tries a symbolic link, then falls back to copy if neither of those work.

EDIT: Link seems to be working just fine. I'm no longer having problems with the movies after the processing by CouchPotato, but it still seems very odd that the Copy method is somehow changing the actual data of the videos. Thanks for your help!
 

tstorm

Explorer
Joined
Jan 5, 2015
Messages
69
I've had this happen to me, notice it happens with larger movies than it does smaller movies (1080 vs 720). Usually it's somewhere around the middle or near the end it just stops and is corrupted. File size is also smaller than it should be once the video is copied.
 

Jrjy3

Dabbler
Joined
Jan 3, 2015
Messages
23
I've had this happen to me, notice it happens with larger movies than it does smaller movies (1080 vs 720). Usually it's somewhere around the middle or near the end it just stops and is corrupted. File size is also smaller than it should be once the video is copied.
It was the same with me. If, for example, the corrupted part of the movie is at 30 minutes into the movie, I'm able to play everything before that just fine, but once it reaches the corrupted portion, it can't play anything past it. Even if I scrub directly past it (ex. scrub to 1 hour in the movie), it won't play anything at all.
 

tstorm

Explorer
Joined
Jan 5, 2015
Messages
69
yup, same same. Got to the point where I check to confirm the file transferred and is working properly all the way through before I remove the torrent. I usually end up transferring the file manually. Kind of defeats the purpose of Couch Potato.
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
this issue must be a torrent thing, because I have never seen it using newsgroups.
 

Jrjy3

Dabbler
Joined
Jan 3, 2015
Messages
23
yup, same same. Got to the point where I check to confirm the file transferred and is working properly all the way through before I remove the torrent. I usually end up transferring the file manually. Kind of defeats the purpose of Couch Potato.
As I said above, linking seems to have worked for me. I don't see a downside to using linking now that it works for me, so if you give it a shot, hopefully that'll work too.

this issue must be a torrent thing, because I have never seen it using newsgroups.

After the file is completely downloaded, it can play back just fine if I play the original file. It's only the file that has been processed by CouchPotato that has an issue.
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
After the file is completely downloaded, it can play back just fine if I play the original file. It's only the file that has been processed by CouchPotato that has an issue.

Right. Which still makes me think it is an issue with the way torrents are handled in the system. Couch Potato handles my Usenet files just fine. I've never seen a corrupt file before.
 

tstorm

Explorer
Joined
Jan 5, 2015
Messages
69
@pirateghost , what kind of videos are you grabbing? 720? 1080? How large are they usually? I noticed this happens mostly when videos are over 9 GBs or so.
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
@pirateghost , what kind of videos are you grabbing? 720? 1080? How large are they usually? I noticed this happens mostly when videos are over 9 GBs or so.
They vary. I have some that are nearly 18gb, some as low as 2gb.

My minimum is 720p with a preference for 1080
 

UF8FF

Dabbler
Joined
Jan 16, 2016
Messages
29
I am here to basically add a +1 comment. https://github.com/CouchPotato/CouchPotatoServer/issues/6091 I filled out this bug report in hopes that it gets some love.

I have tried using 'link' instead of copy but it just corrupts the file to the point that i have to re-download the entire file (not good when it isn't free leech!)

I'm wondering; has anyone tried making their own cron_job to handle the renaming? I don't even want the files renamed, to be honest. I just want them automatically pulled to the Movies folder. I'm sick of the corrupt files! If I can have a script that just goes
'cp /media/downloads/movie.mkv /media/movies/movie.mkv' I would be sooooo happy. But I'm not sure how I would handle duplicates and stuff. Anyway, hopefully we can get to the bottom of this! It's frustrating!
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I am here to basically add a +1 comment. https://github.com/CouchPotato/CouchPotatoServer/issues/6091 I filled out this bug report in hopes that it gets some love.

I have tried using 'link' instead of copy but it just corrupts the file to the point that i have to re-download the entire file (not good when it isn't free leech!)

I'm wondering; has anyone tried making their own cron_job to handle the renaming? I don't even want the files renamed, to be honest. I just want them automatically pulled to the Movies folder. I'm sick of the corrupt files! If I can have a script that just goes
'cp /media/downloads/movie.mkv /media/movies/movie.mkv' I would be sooooo happy. But I'm not sure how I would handle duplicates and stuff. Anyway, hopefully we can get to the bottom of this! It's frustrating!
link wouldn't be rewriting the file (unless the new location is on a different dataset) so I doubt the corruption is happening during the move. but maybe during the download process?

I recently was having this problem on a system with bad RAM (as verified by memtest) and changing the RAM solved it for me.
 

UF8FF

Dabbler
Joined
Jan 16, 2016
Messages
29
link wouldn't be rewriting the file (unless the new location is on a different dataset) so I doubt the corruption is happening during the move. but maybe during the download process?

I recently was having this problem on a system with bad RAM (as verified by memtest) and changing the RAM solved it for me.
That's what I thought. Memtest passed. My downloads go from incomplete then transmission moves them to downloaded then couch potato moves to movies. All the MKV files work 100% and are valid according to mkvalidator in the /downloaded folder. But as soon as they are in /movies mkvalidator reports bad segments. It has to be couch potato. Otherwise there would be corruption going from incomplete to downloaded or in other areas.


Also worth noting: scrubs are fine and I even trashed the jail and set it up fresh.
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
That's what I thought. Memtest passed. My downloads go from incomplete then transmission moves them to downloaded then couch potato moves to movies. All the MKV files work 100% and are valid according to mkvalidator in the /downloaded folder. But as soon as they are in /movies mkvalidator reports bad segments. It has to be couch potato. Otherwise there would be corruption going from incomplete to downloaded or in other areas.


Also worth noting: scrubs are fine and I even trashed the jail and set it up fresh.
ahh, yeah must be CP then.
are your movies folders and downloads folder on the same dataset? maybe if you did that, and use move/link then CP wouldn't be rewriting the file, it would just change the pointer
 

UF8FF

Dabbler
Joined
Jan 16, 2016
Messages
29
ahh, yeah must be CP then.
are your movies folders and downloads folder on the same dataset? maybe if you did that, and use move/link then CP wouldn't be rewriting the file, it would just change the pointer
No they're not but that's a good idea. I'll put a downloads folder on the movies dataset and see if it helps.
 

fenix-silver

Cadet
Joined
Sep 11, 2017
Messages
1
UF8FF, did you ever get this figured out? Did moving your downloads folder to the same dataset as your movies folder help? Thanks!
 

farmerpling2

Patron
Joined
Mar 20, 2017
Messages
224
Do an MD5 BEFORE you copy and then one after you copy. If they are different, then copy is at fault. If they are the same, then download is the problem...
 
Status
Not open for further replies.
Top