-
Notifications
You must be signed in to change notification settings - Fork 85
Description
I am encountering random authentication errors when accessing files on a DFS. The issue is intermittent: the same code works sometimes but fails without any changes at other times. When I replace the DFS path with the direct storage server path, the problem does not occur.
In this case, I am using Kerberos authentication and therefore am not specifying any credentials in the code:
import smbclient
smb_path = r"\\dfs-server\path\to\file.txt"
local_path = "/tmp/file.txt"
with smbclient.open_file(smb_path, mode="rb") as remote_file:
with open(local_path, "wb") as local_file:
local_file.write(remote_file.read())
print(f"File downloaded successfully to {local_path}")When running the script multiple times in sequence, it works successfully for some runs but fails intermittently (typically on subsequent runs) with the following error:
smbprotocol.exceptions.SMBAuthenticationError: Failed to authenticate with server: SpnegoError (4294967295): Major (131072): An invalid name was supplied, Minor (100001): Success, Context: Processing security token