Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
qBittorrent deleting torrent files #12010
qBittorrent version and Operating System
qBittorrent v4.2.1 (64-bit) Windows 10 Pro 64-bit v1903
What is the problem
For the past couple of weeks I've experienced an issue where for a reason I do not yet fully understand, torrent files are being removed at random. I suspect it might be due to how qB handles app exits, crashes and temporary freezes.
Sometimes I would come home, only to discover that a large portion of torrents are at 0% and have the error message "missing files". There will also be torrents that are at 98% or 75%. What I have noticed is that the same torrents tend to have recurring amounts of missing data over multiple episodes of this behaviour. Then the client starts rechecking a majority of the torrents and the result is that I have lost hundreds of GBs of data.
Oftentimes when this occurs, the client is largely unresponsive and I'm forced to kill the process. I know that the client has not fully crashed before I would decide to kill it myself, because I would be getting floods of Windows notifications from qB that torrents are missing files or the client can't find the files in question. This same behaviour also often occurs when I peacefully close down qB (from the right-click system tray menu) and then later run it again. qB again starts complaining about missing files and starts rechecking everything.
Now, I know what anyone's first guess would be in this scenario: a failing drive. I have made a clone of the 4TB WD Red drive in question onto another identical drive. The issue remains. I have also done a full drive scan for bad sectors and read/write errors, but no errors were encountered. The SMART data for the drive had no red flags that I could see: 0 reallocated/pending sectors, 0 uncorrectable errors, 0 seek errors and the other values were passing as well.
All of these symptoms in my mind either point to a drive caching issue or qBittorrent's inability to properly terminate and then for some reason overwriting the existing data with partially (yet to be) downloaded files, even though this should not be possible. Perhaps qB misinterpretes the .fastresume files or there's some other isolated combination of numerous bugs that causes qB to think it has to redownload the whole torrent from scratch. I'm not yet certain what the exact cause is.
I have also looked over the qB logs, but there is no valuable information to be seen. The most common log errors are "system cannot find the file specified", "file sizes mismatch for torrent", "unable to resume torrent" and "[torrentname] restored" (even though all the files are missing). There are no verbatim log entries to explain what is happening under the hood.
Out of curiosity's sake, I also enabled file auditing in Windows for the affected drive to monitor which processes were accessing and/or deleting the files. What I found was that upon client startup, qBittorrent makes WriteData/AddFile requests for the files that go missing. Here is one such log entry:
Steps to reproduce and final thoughts
I don't really have any suggestions to give in terms of reproducing this issue I'm having. Quite clearly this is an isolated case and even though I realise many others have been using qB for a long time without data loss concerns, I do believe this to be a bug inherent to qB, and not caused by outside factors. I've read of similar cases other people have experienced, but there has been no serious attempt made at tracing this bug to the source (assuming it even is one). I've been using qB for probably close to 10 years without ever having had these kinds of issues, and yet, here I am.
I have not yet attempted to reinstall qBittorrent because I first wanted to document the issues I've been facing and in case I need to do follow-up checks I need to maintain my original setup. I'm mainly interested in hearing other people's opinions and possible causes to this problem.