File corruption in Deluge 1.3.2

General support for problems installing or using Deluge
Post Reply
jeps
Leecher
Leecher
Posts: 81
Joined: Wed May 18, 2011 4:32 pm

File corruption in Deluge 1.3.2

Post by jeps »

I am using "Deluge 1.3.2" on a Ubuntu natty, 64 bit server.

When the download reaches 100% finished (and still seeding) I download the files to my work PC by using a FTP program.
I often get "archive corrupt" warnings when extracting the archives on my home PC.
I then have to have my FTP program "re-download" the bugged files again and hope for success the second time.
The file on the server is OK.

The only bullet proof way is to pause the torrent on the server, download the files and then start the torrent again.
My theory is, that something in the cache is not right.
Is there a way to force Deluge to write-out finished blocks immitiately?

Or is there something else I have to do?
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: File corruption in Deluge 1.3.2

Post by johnnyg »

Do you have move completed enabled?

If you have move completed enabled and your ftp program automatically copies the file when it completes then I'd say what is happening is that the FTP program is transferring the file before it has a chance to be fully moved.
jeps
Leecher
Leecher
Posts: 81
Joined: Wed May 18, 2011 4:32 pm

Re: File corruption in Deluge 1.3.2

Post by jeps »

No, "unfortunately" I don't have move completed set to enable.

Just for the sake of comparison ;) I have used several other bit torrent programs, and none of them show the same behavior.
So I am confident that the server file-system is sound and running.

Anything else I should try?
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: File corruption in Deluge 1.3.2

Post by Cas »

to debug properly you should do md5sum checks to see whether the archive file is corrupted during transfer and also test archive integrity before transfer.
jeps
Leecher
Leecher
Posts: 81
Joined: Wed May 18, 2011 4:32 pm

Re: File corruption in Deluge 1.3.2

Post by jeps »

I have (I think!) got rid of the error. I have set "Cache size = 0".
Thereby forcing Deluge to write out all completed blocks of data at once.

Why does Deluge (and all other bittorrent programs) have a cache of the own instead of using the general cache in the OS?
jeps
Leecher
Leecher
Posts: 81
Joined: Wed May 18, 2011 4:32 pm

Re: File corruption in Deluge 1.3.2

Post by jeps »

Well, I actually didn't get rid of the error.

The only 100% sure way to go is to pause the torrent, download the files and then restart the torrent.
This is a bit annoying.
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: File corruption in Deluge 1.3.2

Post by Cas »

Have you tried using the move complete command as that may ensure that the file is completed. Otherwise have you delayed the transfer by a minute or two to see if that gives it time to write out.
jeps
Leecher
Leecher
Posts: 81
Joined: Wed May 18, 2011 4:32 pm

Re: File corruption in Deluge 1.3.2

Post by jeps »

I am considering trying the "move completed" feature.
Maybe I'll try it this weekend.

The FTP download doesn't start just a split second after bittorrent download says 100%. Normally 5 minutes till several hours pass before the FTP transfer starts.
And still I get the error.
The file on the server hard disk isn't corrupt, since the second FTP download of the file is okay.
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: File corruption in Deluge 1.3.2

Post by johnnyg »

As Cas said, you could use a checksum like md5 or sha1 to determine where the problem is.
  1. When the download finishes, md5sum the file

    Code: Select all

    md5sum file > chksum
  2. Pause, then restart the torrent to force it to write to disk
  3. Verify that the md5sum is the same

    Code: Select all

    md5sum -c chksum
If it's not then you are correct in that the file isn't being written to disk properly and it's a libtorrent bug.

If it is the same then something is going wrong when you transfer it.
You could also try using something other than FTP (like rsync) to see if that's the problem.
Post Reply