rTorrent crashing when disk full

Hello,

I’m working with Quickbox script for several months now and had some problems with rTorrent crashing at times.
I think the issue is due to a full, or near full disk.
I tested a lot of possibilities (several VPS of differents HDD size, reinstall QuickBox, w/without quotas, torrents and size of torrents) and apparently rtorrent is not pausing torrents when disk full.
I saw a post about rTorrent crash because of corrupt torrents but I am pretty sure I don’t have any bad torrent that is corrupting my session, cause any of those torrents works fine in another QuickBox VPS.

I first get rutorrent message about disk being full then about 5 seconds later I get
Bad response from server: (500 [error,list]) Link to XMLRPC failed. May be, rTorrent is down?.

I even tried adding in my .rtorrent.rc file:
schedule = low_diskspace,5,60,close_low_diskspace=2000M

but doesn’t seem to be working either, as rutorrent “disk full” message appear only when size available is zero or < 100Ko and not when size available < 2Go.

It’s weird that I didn’t find any or really few informations about full disk problems with rtorrent. IMO it should be a really common problem.

I’m on a Kimsufi server, Ubuntu 16.04.2 LTS, /home quotas

cat /etc/fstab:

/dev/sda2 / ext4 usrjquota=aquota.user,jqfmt=vfsv1,errors=remount-ro,relatime 0 1
/dev/sda1 /boot ext4 usrjquota=aquota.user,jqfmt=vfsv1,errors=remount-ro,relatime 0 1
/dev/sda3 /home ext4 usrjquota=aquota.user,jqfmt=vfsv1,defaults,relatime 1 2
/dev/sda4 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devtmpfs /dev devtmpfs rw 0 0

systemctl status [email protected] before crash:

[email protected] - rTorrent
   Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-01-12 12:49:30 CET; 5min ago
  Process: 25105 ExecStop=/usr/bin/killall -w -s 2 /usr/bin/rtorrent (code=exited, status=1/FAILURE)
  Process: 28137 ExecStart=/usr/bin/screen -d -m -fa -S rtorrent /usr/bin/rtorrent (code=exited, status=0/SUCCESS)
  Process: 28134 ExecStartPre=/bin/rm -f /home/%I/.sessions/rtorrent.lock (code=exited, status=0/SUCCESS)
 Main PID: 28139 (screen)
   CGroup: /system.slice/system-rtorrent.slice/[email protected]
           ├─28139 /usr/bin/SCREEN -d -m -fa -S rtorrent /usr/bin/rtorrent
           └─28144 /usr/bin/rtorrent

Jan 12 12:49:30 ns376118 systemd[1]: Starting rTorrent...
Jan 12 12:49:30 ns376118 systemd[1]: Started rTorrent.

systemctl status [email protected] right after crash:

[email protected] - rTorrent
   Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2018-01-12 12:55:00 CET; 7s ago
  Process: 21584 ExecStop=/usr/bin/killall -w -s 2 /usr/bin/rtorrent (code=exited, status=1/FAILURE)
  Process: 28137 ExecStart=/usr/bin/screen -d -m -fa -S rtorrent /usr/bin/rtorrent (code=exited, status=0/SUCCESS)
  Process: 28134 ExecStartPre=/bin/rm -f /home/%I/.sessions/rtorrent.lock (code=exited, status=0/SUCCESS)
 Main PID: 28139 (code=exited, status=0/SUCCESS)

Jan 12 12:49:30 ns376118 systemd[1]: Starting rTorrent...
Jan 12 12:49:30 ns376118 systemd[1]: Started rTorrent.
Jan 12 12:55:00 ns376118 systemd[1]: [email protected]: Control process exited, code=exited status=1
Jan 12 12:55:00 ns376118 systemd[1]: [email protected]: Unit entered failed state.
Jan 12 12:55:00 ns376118 systemd[1]: [email protected]: Failed with result 'exit-code'.

Ps: I saw somewhere it coud be caused by the ext4 filesystem. Supposedly in ext3 filesystem rtorrent would effectively pause torrents when threshold reached.

Thanks a lot for any insight.

Paul

Hi,

sorry, I noticed your post only now…probably I have the same problem: Rtorrent keep crashing

Anyway I think that the problem is not the disk full. I also think of corrupt torrents but I use only top level private tracker (HDB, PTP, BTN, RED, CHD); so if the torrents were corrupted the tracker would have immediately deleted them.

Do you solve the problem??

Hi,
Thanks to join me here and for your input.
I’m sorry to say that I’m certain that in my case it is not a problem of corrupt file but disk (or quota) full/nearly full.

It’s been 2 month since I first experienced this problem and since then I kept another VPS dedicated for extensive testing of this crash. I made around 10 fresh install, with/without quotas, and tested quite a lot of use case of disk/quotas full/near full, and a lot of different torrent sizes and sources.

I’m also only using top private trackers PTP and BTN and I agree that we can’t have any corrupt file there.

And for your question, no I did not solved this problem.

Paul

I’ve noticed this too. Deleting unwanted torrents via ssh or ftp and restarting server afterwards is a band-aid fix so long as you watch HDD space in future.

Yes I confirm, that how I do it each time that crashes.

But I can’t let my seedbox unattended for too long, with my RSS feeds filling my HDD. I’d like the piece of mind of my new torrents just pausing and rutorrent keeping the others seeding.

And I’m not event talking about the practicality of this fix: delete some torrents via FTP to free space, restart rtorrent service, then quickly remove those torrent from rutorrent before they are restarted, files re-created and rtorrent crashes again.

Hmm, apparently there was a feature request some time ago to implement a sanity check on the drive.

I noticed some are modding their .rtorrent.rc files to have a check in them. If anyone would like to adjust this according to their needs and test it, I can try to implement this into our default template. Just maybe this would help.

# Close torrents when diskspace is low.
schedule = low_diskspace,5,60,close_low_diskspace=2000M

However, I think this is by design in rtorrent.

Yes I already tried this in my numerous testing.
I just tried it again to be sure but no success. Still crashing.
It’s weird because I just bought today an UltraSeedbox and this line was already implemented there by their script:

# If there's less than 256MB of disk space, it will stop torrents from
# downloading.  Keep in mind that we receive alerts about low disk space, so
# it shouldn't actually get this low.  However, if the server runs out of space,
# all of the rTorrents will lock up, eating all of the CPU and spiking loads.
schedule = low_diskspace,5,60,close_low_diskspace=256M

but isn’t working too.

Thanks

I’d say open an issue report at the rakshasa rtorrent repo. There is already a similar report that has yet to be addressed here:

I will test a few variables once I have time, however, keep in mind that I am not necessarily into trying to address other dev/apps pitfalls as QuickBox has plenty of its own that I am working to resolve. I will try to find a solution to this, although, this is something in which the server admin/user should practice diligence.

I will ! Thanks for your help.
And thanks a lot for QuickBox.
Really amazing job !

Paul