jborean93 / smbprotocol

Python SMBv2 and v3 Client
MIT License
318 stars 73 forks source link

Getting STATUS_FS_DRIVER_REQUIRED #174

Closed ccwillia closed 2 years ago

ccwillia commented 2 years ago

Trying to use smbclient from osx. I am able to execute mkdir, remove, open with success. When trying to use rename/replace i get an STATUS_FS_DRIVER_REQUIRED. Do i need to disable DFS some how? I looked for example of rename/replace in the low-level examples using smbprotocol but wasn't able to find one to try.

ccwillia commented 2 years ago

I have done some more testing against a couple other SMB shares. It appears this issue is related to DFS. The share where the rename/replace commands are not working returns capabilities = (8) SMB2_SHARE_CAP_DFS which then sets is_dfs_share to True. If i edit the code and flip is_dfs_share to False the rename/replace operations work. It would be great to have a flag that could be set in either register_session or ClientConfig to force is_dfs_share to False

ccwillia commented 2 years ago

I ended up disabling DFS on the storage and now rename/replace are working.

jborean93 commented 2 years ago

DFS is a bit confusing but it sounds like we potentially need to just ignore this error if attempting to do a DFS referral request. Disabling it on the share/server is definitely a workaround at this point in time.

Is it possible to share what SMB server you are using in your scenario so I can try and test this out myself?

ccwillia commented 2 years ago

Sorry, the SMB server is a private cloud

jborean93 commented 2 years ago

No worries, i was more looking for the product, like AWS FS or something like that. Still understand if you can’t share that as well just curious.

jborean93 commented 2 years ago

Closing as OP had a workaround in place and without further info on the environment or a way to replicate I cannot do much else to help.

jepperaskdk commented 2 years ago

I'm getting this error as well.

I have created a shared folder on my laptop in C:\Shared (Windows 11). I'm then attempting to e.g. listdir from my Ubuntu WSL VM:

smbclient.listdir(r"\\[IP]\Shared", username="[USER]", password="[PASSWORD]")

Throws this error:

smbprotocol.exceptions.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

@jborean93 can I assist in resolving this issue? I'm new to SMB (and Windows ecosystem generally) - is this an error saying the target machine requires additional drivers? Or is it the library that attempts to use DFS and then fails? Can it be remedied by disabling DFS completely in the library?

EDIT: Maybe I changed something else as well, since I now realized the share name was incorrect and I was also getting smbprotocol.exceptions.BadNetworkName: Received unexpected status from the server: The specified share name cannot be found on the remote server.. So it was probably not an issue at all.