rtorrent icon indicating copy to clipboard operation
rtorrent copied to clipboard

rtorrent crashes when resuming torrent: "received a chunk that has already been finished"

Open richlv opened this issue 8 years ago • 16 comments

i have a stopped torrent. attempting to start it crashes rtorrent every time with :

Caught internal_error: FileList::mark_completed(...) received a chunk that has already been finished. Stack dump not enabled.

happened both with libtorrent 0.12.7 + rtorrent 0.8.7 and libtorrent 0.13.5 + rtorrent 0.9.5

i seem to be unable to resume this torrent in any way now, and would be glad to gather any debugging information needed

richlv avatar Jul 18 '15 19:07 richlv

i have seen this issue in the past many times and was surprised to see very few other people having it - one case was https://www.mail-archive.com/[email protected]/msg02692.html

richlv avatar Jul 18 '15 19:07 richlv

Constantly having this problem too.

AdamHughes avatar Oct 08 '15 11:10 AdamHughes

I have this problem too (rTorrent 0.9.6/0.13.6).

Chaz6 avatar Nov 14 '15 14:11 Chaz6

Same here (rTorrent 0.9.6/0.13.6).

HA4g3n avatar Nov 14 '15 20:11 HA4g3n

Easiest way to fix this is to delete the torrent and make it rehash the download.

I'm assuming this is a compatibility issue with older torrent files, however if you have issues after doing the above then I'll look closer. (when time permits)

rakshasa avatar Nov 16 '15 22:11 rakshasa

in the cases when i was hit by this, readding the torrent wasn't even possible. sometimes removing partially downloaded files helped, by the way.

richlv avatar Nov 17 '15 03:11 richlv

Also seeing this. Think its possible to reproduce by:

  1. Start downloading torrent
  2. Mark some files as "Don't download" (off)
  3. Delete the above files
  4. Stop the torrent (ctrl+k)
  5. Start the torrent (ctrl+s)
  6. It will now say "No such file or directory" on the file deleted
  7. Stop and start the torrent again (ctrl+k, ctrl+s)
  8. Crash
rTorrent 0.9.4/0.13.4
Caught internal_error: FileList::mark_completed(...) received a chunk that has already been finished.
/usr/local/lib/libtorrent.so.18(_ZN7torrent14internal_error10initializeERKSs+0x202) [0x7f199d2eb632]
rtorrent(_ZN7torrent14internal_errorC2EPKc+0x3e) [0x445f4e]
/usr/local/lib/libtorrent.so.18(+0x545dc) [0x7f199d30d5dc]
/usr/local/lib/libtorrent.so.18(+0xb0ccc) [0x7f199d369ccc]
/usr/local/lib/libtorrent.so.18(+0x8560a) [0x7f199d33e60a]
/usr/local/lib/libtorrent.so.18(_ZN7torrent15signal_bitfield4workEv+0x67) [0x7f199d3362d7]
/usr/local/lib/libtorrent.so.18(_ZN7torrent11thread_base10event_loopEPS0_+0x162) [0x7f199d3367b2]
rtorrent() [0x41211d]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f199beb5ec5]
rtorrent() [0x412864]

Jellyfrog avatar Jan 04 '16 14:01 Jellyfrog

Have the same problem on a huge torrent. It happens when the actual files are (or should be created) on the other/remote filesystem. This torrent is basically as large as my entire disk and there is no way I could finish the download because of the lack of space so I had to symlink it's download directory to another remote directory mounted via CIFS or iSCSI (ext4). In both cases there is a crash as soon as I resume it or force-check it.

It's working fine if I'm downloading to the root filesystem but, as said above, it's impossible to finish it there.

1454146402 N rtorrent main: Starting thread. 1454146402 N worker_rtorrent: Starting thread. 1454146496 E E18A7FACD5773DE1C7C4515D1B8C2624389E87D0->file_list: Failed to prepare file '...': Could not open file: No such file or directory 1454146496 E Could not resume download: Could not open file: No such file or directory 1454146737 C Caught internal_error: 'FileList::mark_completed(...) received a chunk that has already been finished.'. ---DUMP--- /usr/local/lib/libtorrent.so.19(_ZN7torrent14internal_error10initializeERKSs+0x202) [0x7f9f217bcc02] rtorrent(_ZN7torrent14internal_errorC2EPKc+0x3e) [0x44d90e] /usr/local/lib/libtorrent.so.19(+0x5586c) [0x7f9f217e286c] /usr/local/lib/libtorrent.so.19(+0xb466c) [0x7f9f2184166c] /usr/local/lib/libtorrent.so.19(+0xb4e53) [0x7f9f21841e53] /usr/local/lib/libtorrent.so.19(+0x8198a) [0x7f9f2180e98a] /usr/local/lib/libtorrent.so.19(_ZN7torrent15signal_bitfield4workEv+0x67) [0x7f9f21806f87] /usr/local/lib/libtorrent.so.19(ZN7torrent11thread_base10event_loopEPS0+0x162) [0x7f9f218074e2] rtorrent() [0x411bbb] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f9f20389ec5] rtorrent() [0x412304] ---END---

discoHR avatar Jan 30 '16 09:01 discoHR

A full state reset includes ctrl-e, i.e. try ^k^e^r^s next time.

pyroscope avatar Jan 30 '16 10:01 pyroscope

I've had this issue and rtorrent would crash before I could find/stop/remove the downloading torrent which is responsible.

I used the sed method mentioned here to stop all torrents and then I was able to identify and remove the problem torrents via rtorrent/rutorrent.

sed -i 's/5:statei1e/5:statei0e/' *.torrent.rtorrent

MollyBe avatar Jun 26 '20 11:06 MollyBe

I have the same crashing problem on the latest rtorrent 0.9.8/rutorrent 3.10.

Jolly-Pirate avatar Aug 19 '22 14:08 Jolly-Pirate

Confirmed.

EvilOlaf avatar Aug 24 '22 15:08 EvilOlaf

Same issue here

Caught internal_error: FileList::mark_completed(...) received a chunk that has already been finished. [#34BF0C062F8728B8A16ED5FF9A925548A6A2B0C8] /lib/x86_64-linux-gnu/libtorrent.so.21(_ZN7torrent14internal_error10initializeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x257) [0x7f666f7f3fd7] /lib/x86_64-linux-gnu/libtorrent.so.21(+0x225d1) [0x7f666f7df5d1] /lib/x86_64-linux-gnu/libtorrent.so.21(+0x22c7a) [0x7f666f7dfc7a] /lib/x86_64-linux-gnu/libtorrent.so.21(+0x81ec8) [0x7f666f83eec8] /lib/x86_64-linux-gnu/libtorrent.so.21(+0x6c1e9) [0x7f666f8291e9] /lib/x86_64-linux-gnu/libtorrent.so.21(_ZN7torrent15signal_bitfield4workEv+0x6d) [0x7f666f82415d] /lib/x86_64-linux-gnu/libtorrent.so.21(ZN7torrent11thread_base10event_loopEPS0+0x15c) [0x7f666f82609c] rtorrent(+0x4459e) [0x55e1abdac59e] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f666f343d90] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f666f343e40] rtorrent(+0x44ebe) [0x55e1abdacebe]

Looks like it might be with the underlying libtorrent ?

beadon avatar Feb 19 '23 00:02 beadon

I had this issue with a 37GB torrent (51 files) on rTorrent 0.9.8 / libtorrent 0.13.8. Deleting and re-adding the torrent solved it for me.

McBibbers avatar Jul 30 '23 05:07 McBibbers

Same here

newadventure079 avatar Jan 15 '24 11:01 newadventure079

Folks, check your file system type. This bug reportedly happens with COW file systems such as BTRFS and ZFS. It's recommended to use EXT4 for the fastest possible session saving. XFS will work too, but it suffers a huge write penalty for rTorrent session files.

stickz avatar Jan 16 '24 05:01 stickz