Skip to main content

rTorrent - Find Corrupted Torrents

Take care while deleting files within your torrent session state. We do not take any responsibility for accidental data deletion and cannot restore deleted data. The below procedures are provided for our clients to use at their own risk.

InThis this guide, weguide will cover how to find and remove a corrupted torrent in your torrent client. From time to time,Occasionally, a torrent can become corrupted and cause your torrent client to crash. This can be somewhat complicated to troubleshoot and diagnose, as there are many reasons for why a torrent client might crash.

Before we begin, let's introduce the available torrentstorrent clients, their strengths, and weaknesses. The information below information will help you in making an informed decision when choosingdecide what torrent client to use. Please note,note that the below characteristics are highly subjective and may not align with your specific use case. The amountnumber of torrents listed is are soft limits.

  • Deluge - Unstable and fast downloading, with a limit of 100 torrents for v1 and 2000 torrents for v2
  • qBittorrent - Stable and fast seeding, with a limit of 10K torrents
  • rTorrent - Unstable and slow seeding, with a limit of 2000 torrents
  • Transmission - Slow and featureless, with a limit of 25K torrents

As theseThese torrent clients are running in a shared environment on Ultra.cc. We do not recommend and neither do wenor officially support torrent clients with torrent sessions above these limitations.limits.

rTorrent

To locate a corrupt torrent file in rTorrent, you need to monitor the log output during the crash of rTorrent. By default, rTorrent logging is disabled and needs to be enabled.

Enabling logging of rTorrent should only be done temporarily. Leaving logging enabled for a prolonged time will create very large log files, and could lead to your storage being filled up.

  • Connect to your Ultra.cc service via SSH
  • Stop rTorrent from the UCP, or by executing app-rtorrent stop
  • Create a log directory and backup torrent session by executing the following command:
mkdir ~/.config/rtorrent/logs && cp -r ~/.config/rtorrent/session ~/.config/rtorrent/session.bak
  • Next, to enable logging in rTorrent, open .rtorrent.rc with the nano editor:
nano ~/.rtorrent.rc
  • At the end of the configuration file, paste the following:
log.open_file = "rtorrent", ~/.config/rtorrent/logs/rtorrent.log
log.open_file = "tracker", ~/.config/rtorrent/logs/tracker.log
log.open_file = "storage", ~/.config/rtorrent/logs/storage.log
log.open_file = "network", ~/.config/rtorrent/logs/network.log
log.add_output = "info", "rtorrent"
log.add_output = "critical", "rtorrent"
log.add_output = "error", "rtorrent"
log.add_output = "warn", "rtorrent"
log.add_output = "notice", "rtorrent"
log.add_output = "debug", "rtorrent"
log.add_output = "dht_debug", "tracker"
log.add_output = "tracker_debug", "tracker"
log.add_output = "storage_debug", "storage"
  • Next, restart rTorrent from the UCP, or by executing app-rtorrent restart
  • Now, wait until rTorrent crashes and then check the logs to see what torrent was last logged
  • To output the log in your terminal, execute the following command:
tail ~/.config/rtorrent/logs/storage.log
  • Find the last torrent logged and execute:execute the command in the box below:
    • The TORRENTID will be in the format of 4CC1F979463A4852574E0DE8E111084C19342F83
    • Make sure to include the * at the end of the command, as it will remove all related files.
rm ~/.config/rtorrent/session/TORRENTID*
  • Then, restart rTorrent from the UCP, or by executing app-rtorrent restart
  • Next, if rTorrent crashes again, repeat the process.
    • Stop rTorrent
    • Find the latest torrent ID in the log
    • Remove the files associated with the torrent ID
    • Restart rTorrent

  • Once rTorrent no longer crashes, you can disable logging.
  • Stop rTorrent from the UCP, or by executing app-rtorrent restart
  • Remove the lines that you previously added to the configuration file ~/.rtorrent.rc
  • Restart rTorrent from the UCP, or by executing app-rtorrent restart
  • Done!