Open vasujammula opened 9 years ago
File "C:\Python27\lib\urllib2.py", line 400, in open response = self._open(req, data) File "C:\Python27\lib\urllib2.py", line 418, in _open '_open', req) File "C:\Python27\lib\urllib2.py", line 378, in _call_chain result = func(*args) File "build\bdist.win32\egg\smb\SMBHandler.py", line 63, in smb_open File "build\bdist.win32\egg\smb\SMBConnection.py", line 112, in connect File "build\bdist.win32\egg\smb\SMBConnection.py", line 511, in _pollForNetBIO SPacket
Please check if you have the remote server name correct. In most of the cases when the remote server terminates the connection, the app has used the wrong Windows name for the remote server.
Probably, the remote server's NetBIOS port (port 137) is closed. This may be the case if SMB has been implemented directly over TCP/IP on port 445, rather than by using NetBIOS. An example of this might be a Samba server.
You can verify this by opening Wireshark and inspecting traffic for the remote server you are trying to connect to (Filter: ip.dst==xxx.xxx.xxx.xxx || ip.src==xxx.xxx.xxx.xxx)
Try "is_direct_tcp=True" and "port=445". It worked for me on a 2012 server out of my domain.
even with is_direct_tcp=True" and "port=445" i still get this error.
File "SMBConnection.py", line 597, in _pollForNetBIOSPacket d = self.sock.recv(read_len) socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
Remote server is a WIN CE embedded PC. Storing a file bigger than 4KB doesn't work.
Server name and client machine name seems correct.
I did some further tests and discovered that it disconnects (socket.error: [Errno 10054]) when a file is bigger then 65520 bytes. Is there a problem with packet sizes?
Further analyses: is_signing_active is False max_buffer_size and max_raw_size are 65520 Bytes
Packetsize is bigger then 65520 Bytes thats the reason why the sambaserver disconnects.
How to solve?
Please do not hijack another issue for your problem. This thread deals with using pysmb with urllib which is not relevant to your issue.
It will be easier to attach the packet capture of the network traffic, so that we can study the parameters that are transmitted between the server and client during the negotiation.
Sorry for the wrong post, i created a new issue.
While opening a file using urllib got this error