binhex / arch-qbittorrentvpn

Docker build script for Arch Linux base with qBittorrent, Privoxy and OpenVPN
GNU General Public License v3.0
397 stars 46 forks source link

qBittorrent doesn't appear to politely exit when the container is stopped #220

Open bland328 opened 4 months ago

bland328 commented 4 months ago

If I use File > Exit qBittorrent before stopping the container, everything is fine when it is restarted.

But if I don't manually exit before stopping the container, dozens of incomplete torrents will be errored (sometimes with missing files reported) on restart.

This doesn't appear to be a new problem.

NostalgicGnome commented 2 months ago

This also happens to me if:

I have a hunch it's related to using Fast Resume instead of .sqlite for the resume data, based purely on that I switched from Fast Resume files to using .sqlite a while ago, and I don't remember this ever happening during that time. But recently (couple of months ago) I had to switch back to Fast Resume files for compatibility with other applications (qbit-manage I think it was?) and this behavior started happening again.

I am on version 4.6.3.

Edit: this actually appears to be an issue with my qbit-manage config, not with qBittorrent itself. qbit-manage doesn't presently have a way to tag original torrents when it finds cross seed torrents referring to them, nor does cross-seed have a way to tag the originals when it injects its cross seed torrents into qbt.

I had some logic set up in qbit-manage that removed torrents based on share limits, excluding torrents being cross seeded...or so I thought. However, my logic was incorrect because the original torrents were never tagged (by qbit-manage or by cross-seed). So when the removal logic executed it would delete files (data and .torrent) from the original torrents, as they lacked the 'cross seed' tag my logic was looking for. The cross seed torrents were then still present, but the files they pointed to were gone. So if they were ever rechecked, or if the pointed-to files were ever polled (e.g., after an application restart), qbt would see the files were gone and mark the torrents as 'Errored.'