Open siznad opened 10 years ago
@siznad : Can you provide more information about the remote server? What are the versions of the OS/Samba service that is working and is not working?
If you can, please provide the TCP packet capture of both working and non-working scenarios.
Thank you
Hi Michael,
Thanks for the quick response. I don't have the details yet about the remote servers. I can get that next week. But I did already take network captures for both scenarios.
Attached are the working and non-working captures.
For the not working scenario use filter 'tcp.stream eq 0'
For working, use filter 'tcp.stream eq 110'
Thanks.
On 2014-10-25 13:44, Michael Teo wrote:
@siznad [1] : Can you provide more information about the remote server? What are the versions of the OS/Samba service that is working and is not working?
If you can, please provide the TCP packet capture of both working and non-working scenarios.
Thank you
Reply to this email directly or view it on GitHub [2].
[1] https://github.com/siznad [2] https://github.com/miketeo/pysmb/issues/23#issuecomment-60492929
@siznad : I think the attachments are not available on github when you reply via email. Can you email me your packet captures directly at miketeo@miketeo.net ? Thanks
Hi, I sent you the captures to miketeo@miketeo.net. Just wanted to confirm you got them. John
Thank goodness you have probed me on this. Your packet capture has ended up in my spam box. I will look into this.
@siznad : I was looking through your packet captures. The remote CIFS/SMB server for the non-working looks interesting; it seems to be a NAS. Can you provide more details on the remote server? Thank you.
It is NAS. It's a SAN storage running NetApp.
Hi Mike,
Any idea what the issue could be?
John
@siznad: Unfortunately, I do not have access to a NetApp storage facility to troubleshoot. I'm tied down with my work for this month, and will look into this once my time loosen up.
@miketeo @siznad Don't know if this is already solved, but using is_direct_tcp=True on the SMBConnection solved the problem for me. Also, you might wanna use port 445 instead of 139.
I had the same symptom and in my case it was because the opened file was positioned to the end of the file. The storeFile method just performs read() to get the data, so it wasn't finding anything at the end of the file. I did a file_obj.seek(0) before writing and this fixed it.
@G-Goldstein 6 years later, thank you so much for this! Saved me.
I'm using pysmb 1.1.13 with Python 2. I'm using the storeFIle function to copy files to a share. It is writing 0 byte files. The same piece of code works just fine on a different share on a different server.
Here's the code.
from smb.SMBConnection import SMBConnection from smb import smb_structs smb_structs.SUPPORT_SMB2 = False
client_machine_name = 'TESTPC' server_name = 'testsvr' server_ip = 'testsvr' username = 'bob' password = 'password' inputfile = 'text.txt'
conn = SMBConnection(username, password, client_machine_name, server_name, use_ntlm_v2 = True)
conn.connect(server_ip, 139)
with open(inputfile, 'r') as file_obj: numBytes = conn.storeFile('workgroup', 'testpath', file_obj, timeout=600)
conn.close()
Not sure what is different about each share that one would result in 0 byte files. Any ideas on how to troubleshoot this?