View Issue Details

IDProjectCategoryView StatusLast Update
0004002Far ManagerCopy/Movepublic2023-08-31 20:02
Reporteralexfbg Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Platformx64OSWindowsOS Version2012
Product Version3.0 
Summary0004002: When Copy operation is broken due to "Unexpected network error" (0x3B), [Retry] button will restart to copy the file from begin
DescriptionWhen Copy operation is broken due to "An unexpected network error occured" (0x0000003B), [Retry] button will restart to copy the file from beginning! Not from the offset, where file is stopped to copy.
Steps To ReproduceSteps to reproduce:
1) Let's place a big file (to understand why this is important) like 500 GB binary.dat to a network disk that is mounted to some drive letter like V:
2) Start to copy V:\binary.dat to a local drive for example, D:\TEMP
3) Wait until 20-30 or 50% is already copied.
4) Produce a network error (0x3B) or deattach lan cable (probably, not tested)
5) You will get an error like "Cannot copy "binary.dat" to "D:\TEMP\binary.dat"" and selection:
[Retry] [ Skip ] [ Skip All ] [ Cancel ]
6) Fix network error and/or reattach lan cable
7) Select [Retry] button to continue copying the file

Current behavior:
All copy progress will be back to zero and file will be copied from the very beginning, zero offset (!). Arghhh!!!

Expected behavior:
1) FAR know offset where it is stopped to write to the destination path (last written block to destination, i.e. you may use even filesize()).
2) FAR seeks to the same offset on the source path and continue to read block from this offset doing seek to this offset
3) FAR will continue at the unexpected break location, NOT from the start of file. And you will be able to do not wait for a 5 hours again.
Tagscopy, network error
Build

Activities

HaRT

2023-08-17 23:15

reporter   bugnote:0017448

What's the state of the “Use system copy routine” option in FAR's “System settings”? Does the issue repro if the option is toggled?

alexfbg

2023-08-18 18:04

reporter   bugnote:0017450

Last edited: 2023-08-18 18:15

Additional operation with the same effect (not only network error):
0x00000017 - Data error (cyclic redundancy check).

If you had got this error and click on [Retry] button, FAR is starting copying file from zero offset! I had got this now at 120GB file at 76% of copy process... That's unbelievable!

alexfbg

2023-08-18 18:05

reporter   bugnote:0017451

What's the state of the “Use system copy routine” option in FAR's “System settings”? Does the issue repro if the option is toggled?

HaRT

FAR option is:
[x] Use system copy routine < enabled

So, the problem is here? I need to disable it to use internal FAR procedure?

What are the other differences? (Is any doc where differences are written)?

alexfbg

2023-08-18 18:11

reporter   bugnote:0017453

From the help:

Use system copy routine
Use the file copy functions provided by the operating system instead of internal file copy implementation. It can be useful on NTFS, because the system function (CopyFileEx) copies extended file attributes. On the other hand, when using the system function, the possibility of "smart" copying of sparse files is not available.

Help
Is this all difference?
And the main question: why internal FAR procedure can't copy extended NTFS attributes too (if required)? Why original function is need at all? Why it does not fully "copied" and modified for best use (for example, to retry from the saved position)? (But without losing some of the Windows functions).

alexfbg

2023-08-18 18:14

reporter   bugnote:0017454

Does the issue repro if the option is toggled?

HaRT
Oh, sorry, I read this wrong. The issue occurs when this option is ENABLED (toggled).
I did not tested with disabled "[ ] Use system copy routine".
This ticket is a result of working with enabled system routine: "[x] Use system copy routine"

HaRT

2023-08-18 18:47

reporter   bugnote:0017455

“Toggled” does not mean “enabled”, it means “value changed to its opposite”.
So, to better diagnose the issue please test with the option disabled. If/when any of developers who is familiar with that code looks into this issue, to know whether the option makes any difference will be useful.

DrKnS

2023-08-31 20:02

administrator   bugnote:0017478

[Retry] button will restart to copy the file from beginning!
This is how CopyFileEx works.
It is annoying, I know. I wasted an hour or so myself the other day in exactly the same situation.
If your network is prone to "unexpected errors", don't use the system copy routine.

why internal FAR procedure can't copy extended NTFS attributes too (if required)?
Because we have rather limited resources. You are always welcome to implement it yourself and open a pull request.

Why it does not fully "copied" and modified for best use
Because Windows is a commercial closed source OS and the source code of this function is not available, so we can only guess what it does and how.

I'll keep this issue open to explore some alternatives in the future, e.g. optionally using COPY_FILE_RESTARTABLE flag.

Issue History

Date Modified Username Field Change
2023-08-17 17:12 alexfbg New Issue
2023-08-17 17:12 alexfbg Tag Attached: copy
2023-08-17 17:12 alexfbg Tag Attached: network error
2023-08-17 23:15 HaRT Note Added: 0017448
2023-08-18 18:04 alexfbg Note Added: 0017450
2023-08-18 18:05 alexfbg Note Added: 0017451
2023-08-18 18:11 alexfbg Note Added: 0017453
2023-08-18 18:14 alexfbg Note Added: 0017454
2023-08-18 18:15 alexfbg Note Edited: 0017450
2023-08-18 18:47 HaRT Note Added: 0017455
2023-08-31 20:02 DrKnS Note Added: 0017478