Hello,
On Windows server 2019, I often have the error 59: An unexpected network error occurred.
I did a python sample script which reproduce the issue doing write test on a Windows smb share.
I got the following errors:
The error returned by the script can be
Traceback (most recent call last):
File "Test_integrity.py", line 153, in <module>
test_integrity()
File "Test_integrity.py", line 149, in test_integrity
file_write_content(path, info)
File "Test_integrity.py", line 125, in file_write_content
os.remove(path)
WindowsError: [Error 59] An unexpected network error occurred: 'U:\\data\\Desktop\.\\pref.ini'
or
Traceback (most recent call last):
File "Test_integrity.py", line 153, in <module>
test_integrity()
File "Test_integrity.py", line 149, in test_integrity
file_write_content(path, info)
File "Test_integrity.py", line 140, in file_write_content
win32file.WriteFile(handle, data, None)
pywintypes.error: (59, 'WriteFile', 'An unexpected network error occurred.')
To reproduce
Create a share on another Windows server
Map a share using the letter U:
Install python + pywin32 (pip install pywin32)
Start the script test.py
Actual result
The above error occur
I made some tests:
The issue seems to only occurs from a Windows server 2019.
It occurs with many samba version, (tested on centos7:4.10.16, bionic:4.10.13, xenial:4.3.11), many windows server share (Windows server 2012R2, Windows server 2019)
It occurs even if I force dialect to 3.10, 3.02 or 3.00.
The Windows server is fully updated (Build 17763.rs5_release.180914-1434).
* On procmon, I have the following error

I wanted to join the wireshark trace of my issue (U:\\data\\Desktop\.\\pref.ini) and the script used to reproduce my issue.
But The interface does not allow it.
I would like to understand more this issue and eventually find a workaround.
Thank you for your help.
David Lechevalier.

