Hello @David Lechevalier ,
I think that the ReactOS implementation of RxFsdCommonDispatch (viewable at https://doxygen.reactos.org/d8/d89/rdbss_8c_source.html) is reasonably close to that of current versions of Windows. The only cause of STATUS_UNEXPECTED_NETWORK_ERROR in that implementation is the "orphaning" of the File Control Block (FCB) of a remote file.
I don't think that you will be able to "eliminate" this problem via system configuration - it is probably a timing bug in the Windows Server 2019 implementation; I will however continue to try to identify exactly what goes wrong and when on the basis of the existing traces.
In the last trace that you sent, the problem actually occurred a few times, but some occurrences had no visible impact. As I mentioned previously, the if file exists then delete file
should not be necessary if the subsequent CreateFile uses the CREATE_ALWAYS flag. In one case, the STATUS_UNEXPECTED_NETWORK_ERROR event causes the if file exists
function to return false (because of the error - the file actually does exist) and so the delete file
statement is not executed; this however has no consequence since the CreateFile with CREATE_ALWAYS overwrites/truncates the existing file. Your script finally fails when either the file write or delete functions incur STATUS_UNEXPECTED_NETWORK_ERROR.
It would be possible to code your script to handle this STATUS_UNEXPECTED_NETWORK_ERROR error by just "retrying" the operation that failed (win32file.CreateFile or win32file.WriteFile) although, of course, this should not be necessary in a correctly functioning system.
Gary