-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Corrupt files when copying #16843
Comments
The screenshots above are identical, no?
Are you seriously sure that this update solves all the problems that existed before? |
My screenshots are NOT identical. Look at the total disk space. Before the copy shows 1.92 and after the copy shows 1.98. And no it does NOT solve the problem at all. I concluded the sentence out by saying "and the problem is still there." |
But the sizes in bytes are the same...
Sorry, your sentence sounds for me like "since the problem wasn't solved by macOS upgrade then it wasn't the problem with macOS". |
Maybe some files aren't completely flushed to disk at the time you encountered this issue. |
Byte sizes are correct yes but the total size on the disk is wrong initially. If I copy that file to an external HDD or a NAS, the file becomes corrupt and the movie won't play correctly or be heavily pixelated. If I proceed to copy the file instead to the SAME HDD, the size on the disk then matches up correctly to the byte sizes and then I can copy the files to an external HDD or a NAS without any issues and the file isn't corrupt and my md5 checksum is the same. I was just stating that the problem wasn't resolved by upgrading to the newest macOS. I don't have another mac to try, so I can't tell. I guess I could downgrade the qBittorrent to see if the problem fixes. |
Could you test how it behaves if you close qBittorrent after downloading of some affected file is done? Also how it behaves if you reboot your Mac after downloading is done and before copying to the external HDD or NAS? |
Yes I will try that out next and let you know. I have a file that should be finishing in the next 30 minutes and will try that. |
somewhat duplicate of #16787 |
I saw that one, but mine isn’t 10x at all and while his is more, mine is less. |
Do you use preallocate disk space? |
I think it is yet another drawback of MMAP based disk IO subsystem of libtorrent 2.0. Most likely the buffers are not explicitly flushed to disk before closing the file, so the OS does not do it immediately. |
This make sense. I am testing out a solution now to see if it fixes it. I will post an update after my next few downloads. |
Also just a note and it looks like this has already been well discussed here on the forum, if I download directly to my NAS, qBittorrent will freeze and eventually hang up my entire mac causing me to hard reboot the machine. |
My test solution didn't work. I tried using a separate path for incomplete torrents, but that didn't fix it. |
just as an update to this post. I reverted back to a really old qbit build and everything works fine. I'll update back when there is a newer build and I will try it. |
I'm having the same issue, what old build did you revert to? I'm thinking of doing the same thing. |
Just the old one that was already downloaded on my drive. It's 4.3.8 |
I believe this is fundamentally caused by a bug in Mac OS. Writing to a memory mapped file is supposed to end up in the same page cache normal file I/O use as disk cache. That said, the most recent libtorrent release attempts to hint the OS to be more aggressive in flushing data to disk, which may mitigate this issue. |
while you are probably right and more advanced than me at this, why is that 4.3.8 doesn't have this issue and everything works correctly? |
I don't believe it's using the new version of libtorrent. the new version of libtorrent uses memory mapped files for disk I/O |
It uses libtorrent-1.2. |
I'm having roughly the same issue. I download torrents directly onto my external hard drive but I have had a lot of corrupted files for the last 2 weeks or so. I'm not even able to install an older version of qBittorrent. I hope this will be fixed soon :) |
How are you not able to install an older version? FYI, if you first copy the file to the same HDD it was downloaded on, it will flush the cache and it should be fine. That's what I resorted to until I installed 4.3.8 |
@ArthurGuez what operating system are you using? |
I dont have any problems with 4.4.5, as far as i remember I was on monterey 12.4 or 12.5 when it came out. Now I'm on ventura 13.0.1(mba m1). Works fine for me. |
@mbbananas you might want to check your RAM |
This problem should be caused by Apple. MacOS has been benchmark cheating in writes by not doing proper fsync. |
Thanks! After months of trying different things, it seems that it is most likely the use of my USB hub. It was working before so it could be a combination of Apple and a USB hub. If I don't have too many externals connected to the same hub or I connect an external directly, everything seems to copy over fine. |
Do we have a verdict on whether this is fixed in the current version, 4.5.2? |
Yes, as long as you use the version with the older libtorrent. |
Thanks. Was that version rolled back in the installer? Or is libtorrent installed independently? I don't remember installing it or where it resides. |
There are two versions for each build. Just make sure you DONT download the version using lt20, because that one uses libtorrent 2.0 with a new file caching algo, which corrupts files on Macos. |
Thanks. Why is that one still up, then? A quick search didn't reveal any issues raised on this in the libtorrent repo, so I posted one. |
the problem people are talking about is still when copying the downloaded file, right? Not when playing/reading the file from the disk it was originally downloaded to. Is that right? If so, I would be interested to know if it makes a difference to first stop the torrent and then copy the file, or maybe even shut down qbittorrent and then copy the file. Also, just to be clear, the copying does not happen by qbittorrent itself, right? (e.g. move-download-location) but it happens via some other copying tool, like drag and drop in finder or |
That's right. The files seem to be fine when they reside where QBittorrent deposited them. It doesn't make a difference if you stop the torrent. I've copied the files using Finder without qBittorrent even running, and they get corrupted. I tried two different drives (thumbdrive and SSD) over USB, and even copied the corrupted file back to the Mac... where it was still bad (showing that playback from the external drive wasn't the problem). |
I have/had this exact issue as well with videos. I went crazy for months trying to sort it out, when it comes down to it, qBittorrent was causing this to happen for me. I would a video download to a folder locally on my mac mini, then copy to an external drive. Every single thing I copied would become corrupt and show these issues. Switched to Transmission and have not had this issue once. |
I am using 4.5.5, and it seems I have now the same problem. Multiple files corrupted after moving to another drive. Is this a regression? I am the only one? I moved the files back and made a recheck and indeed the files were incomplete, and some chunks needed to be downloaded again. I enabled re-check after move and will see if it changes anything. |
Which version of 4.5.5 are you using? The standard or the lt20? As far as I'm aware people don't have problems with the standard version, just with the lt20 one. |
I've found that once a torrent finishes, right-clicking on it and doing a "force recheck" two or three times allows the client to check all the parts and I don't get the playback issues anymore. maybe this'll help? |
Has the lib still not been fixed? |
fyi: My Issue is resolved, it was NOT QBittorrent. After the move, the path was too long and produced a false |
I can confirm that even on a non-Mac system this is very easy to replicate with larger torrents (>10GiB in size). Downloading to an SSD and then moving (via NFS) to a ZFS array regularly causes 99.9% recheck failures which require moving back to the download directory to re-fetch the .1% corruption, move back to the array, and hope for the best. This is present on 4.6.2 so there has been no fix/improvement in this behavior over the 4.5.5 version I was on previously. |
If you still need this info: in my case, i moved the files via "change download location" in qbittorrent like you say, during downloading. The torrent was huge, 200 GB or so, and individual files would be 1-3 GB. That is 100% sure. |
I had this issue on my mac for the last few weeks it seems. Was driving me nuts. I switched to using v4.6.3 NOT THE LT20 VERSION and it seems to have resolved the issue so far. It seems insane that this bug still exists |
+1. I stumbled onto this issue today after I had been backing up downloaded files to a local SMB share on another machine. Recently, I installed Plex on that machine and used those backup drives as media drives for Plex, and noticed that files larger than 10GB or so were glitchy/corrupted and would not play back correctly. After running a bit-by-bit comparison check using FreeFileSync, I noticed it was only the larger torrent files that had been corrupted. This is really frustrating, because now I cannot trust my files to get backed up without corruption. Not sure where the problem lies, but it's only happening to files that were downloaded using qbittorrent and then copied over to the SMB share. I'm on Windows 11 and was using qbittorent 4.4.3. I have since updated to 4.6.3 to see if it alleviates the issue. |
+1 Weird thing is it's consistent, when it's corrupted (doesn't happen all the time), only 1 piece (or the the last piece) gets corrupted and redownloaded, and the rest of the file seems to pass the hash check, so I don't see it being a hardware or ram corruption issue. I have noticed this issue of Libtorrent 2 only, not on Libtorrent 1, using the latest Linux Kernel LTS v6.6.23. As previous users mentioned, mostly occurs when downloading very large files >20gb @glassez Please consider this issue when QBT 5.0 is released, don't think we should rush on sticking with Libtorrent v2, i highly suggest to please keep both the libtorrent v1 and v2 builds. |
@vincejv @wpwentzell @eisenbruch How does qBittorrent 4.6.4 which uses Libtorrent 2.0.11.0 behave? |
if QBT 4.6.4 uses the unreleased 2.0.11.0, then the behavior is the same. I'm using QBT 4.6.4. |
We returned to using libtorrent-1.2 by default a long time ago, when it became clear that the libtorrent-2.0 I/O subsystem was causing serious problems in some (fairly common) use cases. |
@glassez Cool, thanks. So it's safe to let it auto-update? |
If you are referring to the built-in updater, then it just downloads the default installer package for your OS, which is currently based on libtorrent-1.2. |
qBittorrent & operating system versions
MAC OS 12.3.1
qBittorrent 4.4.2 x64
What is the problem?
After downloading a file, there is a size discrepancy upon finishing. I have posted screenshots of the issue. What's odd is that the file will play perfectly fine on the same HDD it is downloaded to, but once I copy the file to an external drive or to my NAS the file becomes corrupt.
HOWEVER, if I copy the file and paste it to the same HDD, the file sizes get corrected and then I can copy the file to my external HDD or to my NAS without any problems.
I initially thought that it was a MAC OS problem, but I upgraded to 12.3.1 and the problem is still there.
Steps to reproduce
No response
Additional context
No response
Log(s) & preferences file(s)
No response
The text was updated successfully, but these errors were encountered: