Closed franky920920 closed 1 year ago
I think that adding a bit more info about your setup can help with troubleshooting this.
Is this a "simple" Windows share, do you have distributed shares... Azure Files, Samba server.
Are username and password non-empty?
Cheers
@adiroiban Is a share on AWS FSx for Windows Server (aka SMB share on Windows Server). User credentials are Active Directiry's credentials. Thanks
This error should only occur if username/password
is None or an empty string. It's trying to use NTLM but no environmental user file is present for it to use for authentication.
Can you 100% verify that username
and password
are set in your code?
@jborean93
Can you 100% verify that username and password are set in your code?
Yes, I've just print the variables out. 😄
register_session(server=host, username=username, password=password)
with open_file(r"\\" + os.environ['fsxDns'] + "\\" + eKey, mode="w") as fd:
fd.write(eObjBody)
In this example you have server=host
, but the actual subsequent operation is using os.environ['fsxDns']
. Are these the same? Can you omit the register_session
and just do open_file(r"\\" + os.environ['fsxDns'] + "\\" + eKey, mode="w", username=username, password=password) as fd:
?
When running open_file(r"\\" + os.environ['fsxDns'] + "\\" + eKey, mode="w", username=username, password=password) as fd:
only, following error occurred:
[ERROR] FSDriverRequired: Received unexpected status from the server: A volume has been accessed for which a file system driver is required that has not yet been loaded. (3221225884) STATUS_FS_DRIVER_REQUIRED: 0xc000019c
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 59, in lambda_handler
with open_file(r"\\" + os.environ['fsxDns'] + "\\" + eKey, mode="w", username=username, password=password) as fd:
File "/opt/python/smbclient/_os.py", line 369, in open_file
raw_fd = file_class(path, mode=mode, share_access=share_access, desired_access=desired_access,
File "/opt/python/smbclient/_io.py", line 377, in __init__
tree, fd_path = get_smb_tree(path, **kwargs)
File "/opt/python/smbclient/_pool.py", line 327, in get_smb_tree
referral = dfs_request(ipc_tree, "\\%s\\%s" % (path_split[0], path_split[1]))
File "/opt/python/smbclient/_pool.py", line 209, in dfs_request
response = tree.session.connection.receive(request)
File "/opt/python/smbprotocol/connection.py", line 1006, in receive
raise SMBResponseException(response)END RequestId: d3b4dc90-feb1-4518-a5d3-ff9a5b52b271
Ok so we are at least past the authentication problems which is nice. The trouble here is that it's trying to do a DFS request but something is going wrong. What version of smbprotocol do you have installed?
smbprotocal version is 1.9.0 (latest)
It seems like it is failing at https://github.com/jborean93/smbprotocol/blob/v1.9.0/smbclient/_pool.py#L327 which occurs when the initial result is BadNetworkName
(share is not valid). While this particular error should be ignored and the original exception raised so it's not masked it seems like eKey
is not a valid share to connect to on the host requested.
ahhhh got it, I missed to add the share name in that string. Many thanks!
I'm going to keep this open as a reminder to ignore FSDriverRequired
in that particular bit of code. It would have hopefully made the problem clearer.
Hi, the following error occurred:
Failed to authenticate with server: SpnegoError (1): SpnegoError (16): Operation not supported or available, Context: Retrieving NTLM store without NTLM_USER_FILE set to a filepath, Context: Unable to negotiate common mechanism
My code:
Traceback:
Any help will be appericated. Thank you :D