Rtorrent: Download registered as completed, but hash check returned unfinished chunks.

Created on 1 Aug 2017  路  11Comments  路  Source: rakshasa/rtorrent

I am trying to move finished torrents to directories based on their watch directory.
The wiki contains an entry for just this exact usecase.

schedule2 = watch_directory_1, 10, 10,"load.start=~/.rtorrent/watch/foo_watch/*.torrent,d.custom1.set=~/.rtorrent/download/foo_dl"
schedule2 = watch_directory_2, 10, 10,"load.start=~/.rtorrent/watch/bar_watch/*.torrent,d.custom1.set=~/.rtorrent/download/bar_dl"
method.insert = d.get_data_full_path, simple, "branch=((d.is_multi_file)),((cat,(d.directory))),((cat,(d.directory),/,(d.name)))"
method.set_key =event.download.finished,move_complete,"d.directory.set=~/.rtorrent/download ;execute=mv,-u,$d.get_data_full_path=,$d.custom1="

Based on the wiki entry here

This will move the file to the right location but leave a 0 byte file in the original location. In rtorrent itself the error message "Download registered as completed, but hash check returned unfinished chunks." will be displayed.

Most helpful comment

@jewsh can you either update the wiki with what you did, or post it here to have someone else update the wiki?

All 11 comments

Well, the last line isn't from that page :)
The problem is, you don't update the d.directory property properly: it should be d.custom1
So, the whole line should look like this:

method.set_key = event.download.finished,move_complete,"d.directory.set=$d.custom1= ;execute=mv,-u,$d.get_data_full_path=,$d.custom1="

Applying that line results in the same error plus new errors.
Now when the download finishes the log in rtorrent displays : Event 'event.download.finished' failed: Bad return code.

Additionally the logfile displays:

```^@mv -u /home/user/.rtorrent/download/foo_dl/debian-9.1.0-amd64-netinst.iso /home/user/.rtorrent/download/foo_dl

^@mv: cannot stat 芒/home/user/.rtorrent/download/foo_dl/debian-9.1.0-amd64-netinst.iso芒: No such file or directory
```

/home/user/.rtorrent/download/foo_dl/

Do you have this directory?

Yes, all the directories exist and have appropriate permissions set.

This will move the file to the right location but leave a 0 byte file in the original location.

Err... Can you try out adding this at the end of the last line of your original version?
;d.stop=;d.start=

Stopping and restarting the download is necessary to get its 'base path' updated.
So:

method.set_key =event.download.finished,move_complete,"d.directory.set=~/.rtorrent/download ;execute=mv,-u,$d.get_data_full_path=,$d.custom1=;d.stop=;d.start="

If this works, then try to add back the previously mentioned d.custom1 variable.

And if all works, can you also update the wiki page? :)

method.set_key =event.download.finished,move_complete,"d.directory.set=~/.rtorrent/download ;execute=mv,-u,$d.get_data_full_path=,$d.custom1=;d.stop=;d.start="

Has the same effect as the original, e.g. moves the file but a 0 byte file remains in the original location and rtorrent reports missing chunks.

method.set_key = event.download.finished,move_complete,"d.directory.set=$d.custom1= ;execute=mv,-u,$d.get_data_full_path=,$d.custom1=;d.stop=;d.start="

Results in Event 'event.download.finished' failed: Bad return code. and the missing chunks error, also does not move the file properly as before.

This is again using the wrong dir AFTER the change. And again, put the handler into its own method, call that and pass the path as an argument, use "$argument.0=" which is frozen.

@pyroscope which handler should be put into its own method and how? Can you either elaborate your answer or tell us where you get your info from?

In #625 that you duped.

someone fix the damn wiki.

After some testing i think i made it work.
Proper documentation would be nice though.

@jewsh can you either update the wiki with what you did, or post it here to have someone else update the wiki?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iamfreaky picture iamfreaky  路  6Comments

dirtycajunrice picture dirtycajunrice  路  6Comments

ghost picture ghost  路  5Comments

MrSorcus picture MrSorcus  路  5Comments

troykelly picture troykelly  路  6Comments