[Bugs] Revert File Location (s) (Copy) Error & File Write Errors (when files are linked across 2 torrent)
- BiglyBT 2.0.0.1_B11 on Windows 10 Pro
- While attempting to Revert (Copy) a file within a torrent I'm often (estimate 40% of the time) getting "The operation failed, probably due to invalid target selection" the link is then sometimes reverted but the file is not copied leading to bigly then marking the file/blocks as incomplete and attempting to download them again. :(
This error also produces a "Failed to rename" pop-up error (strange as its not renaming, its copying). Usually the link isn't reverted but the folder is created (if it wasn't present), attempting to revert the same file again then works!
Initially I thought it was something to do with the destination folder not existing, but after examples of this error to folders both pre-existing and not it doesn't appear to be the cause (atleast not all the time). Also stopping the source (link to) torrent doesn't seem to help (thought bigly was maybe locking a source file or something).
- Another bug I'm seeing with regard to torrents which have files shared and linked across them. Say I have 2 torrent A and B, A is complete (no linked files or anything) and is seeding normally. I then start up torrent B and because I know 90%+ of the data is already in A I perform search for existing files to include the files in A, it searches and links them fine. Now B starts to download the rest of the data but will suddenly come up with an write access error not to the incomplete file in torrent B but to the source file linked in A! Why is Bigly trying to write to an already complete file (I'm guessing its something to do with multiple starts/ends of files in a single block perhaps) in an already complete torrent (A) to complete a uncompleted file in torrent B? This data should NEVER be or even need to be written to (as doing so risks file corruption of an already completed file in A). Yes, you can mitigate this problem by turning off "Enforce exclusive file write access locking across torrents" in Options/Files, but I'd rather have Bigly not trying to write to complete linked files in the first place.
--
Sorry for all the edits (its the result of a slightly befuddled mind) ;-)
Hmm!
1.
I fiddled around but couldn't reproduce with my feeble testing :( I'll add something to ensure that the target directory hierarchy is at least established and add some diagnostics so we know what the 'invalid target selection' message is actually being caused by.
2.
This is most likely being caused by the piece/file alignment issue - in general a file's start/end won't be aligned with a piece boundary. Say in torrents A and B you have files
A1 A2 A3 B1 B2 B3 B4
and A2 is the same as B3.
The piece in A spanning the end of A1 and start of A2 (call it AP) will start with some of A1 and end with some of A2
Likewise the piece in B spanning the end of B2 and the start of B3 (which is A2) will start with some of B2 end with some of B3 (A2)
When you point A2 at B3 and recheck the torrent the piece AP will be marked as incomplete (if A1 is yet to be completed). So, even though part of AP is already present and correct on disk BiglyBT will see AP as incomplete and download it. Whenever the piece is complete it will be written to the end of A2 and the start of B3 - hence your problem.
A possible solution would be to trap the write error and, before flagging it upwards, check to see if the data on disk matches that being attempted to be written. Not fantastic as it still can result in writes to the completed file :(
oh, can you check that nothing was written to the debug_1.log / debug_2.log files or any alerts raised with an error message?
B12's out with the parent folder fix and some extra diagnostics in the 'copy failed' window
OK, not on B12 yet (I'm waiting on Bigly to finish a very large data file move between 2 slow HDDs) :-/ . The debug files as far as I can tell show nothing (but I think any messages may have been rotated out of the log so I'll try again soon and get back to you).
Is there anything particular in the log I should be looking for? (or maybe I should just post those 2 logs?)
Some of the existing code raises alerts which should end up in the alert_1/2.log files, can you take a look at them?
In alert 2.log (on B11 here) theres a bunch of errors like this (where files on E: are the downloading torrents, I: is the source linked files ). >>
00:15:19] Alert:3:Disk read error: File 'I:\Emulation Downloads\MAME\MAME 0.207 CHDs (merged)\rblaster\rblaster.chd' is in use by '5DE80416A24C4341684F66AA5C0ABE5577C9482C[22230] [read],19F0C069F6DC990766866D7E95AFF2A7FE3D7585[174791] [write]'
followed by many errors like ...
[00:15:19] Alert:3:File close fails: flush fails, File 'I:\Emulation Downloads\MAME\MAME 0.207 CHDs (merged)\area51mx\area51mx.chd' is in use by '5DE80416A24C4341684F66AA5C0ABE5577C9482C[21655] [read],19F0C069F6DC990766866D7E95AFF2A7FE3D7585[174212] [write]'
and many like ...
[01:14:37] Alert:3:Disk write error: flush fails, File 'I:\Emulation Downloads\MAME\MAME 0.209 ROMs (merged)\fg_120af.zip' is in use by 'C5419FCD8B6E4CDAE8AB2EAD67BE8A0D3D0DD636[6714] [read],EC3872ADBBF5C9ABFD5FFCFD0F6D12DDA1423A9B[83212] [write]'
then ...
[01:27:08] Alert:3:Failed to rename 'I:\Emulation Downloads\MAME\MAME 0.210 CHDs (merged)\wswe\c18jaa03.chd'
I'll try B12 soon and report back. Thanks.
OK, well the changes in B12 seem to have worked on the torrents I tested (no more "operation failed" errors) so far (I'll keep you updated if problems occur again). :-)
As for the file overwriting, it would be nice to fixed, but as turning off file access locking sort of fixes it for now (still makes me a little uneasy) and I haven't yet seen any problems so far, its perhaps not worth immediate attention (unless you want to of course ;-) ) for such an near "edge case".
Thanks for the continued good work as ever! :-D