miketeo/pysmb

Code stopped working after no changes

Closed this issue · 2 comments

I have been using SMBConnection for almost a year now without issue. Suddenly around October of last year my script began to give the error:
ConnectionRefusedError: [Errno 61] Connection refused

As far as I can tell, no updates to pysmb happened in this time, the python version has remained constant, and no changes have been made to the server. This error has been plaguing me for months now and I absolutely can not figure out what won't work

Here is the code that used to work:

try:
    conn = SMBConnection('user','password',KODYS-LAPTOP','CUChangeLab',use_ntlm_v2 = True)
    conn.connect('ucbfiles.colorado.edu', 139)
    return(conn)
except Exception as e:
    print(e)

And the error I now receive:

File "/Users/popiop4/Desktop/Work/Researchjob/Code/prism/prism/SMBdownload.py", line 22, in connect_to_server assert conn.connect('ucbfiles.colorado.edu', 139)

File "/Users/popiop4/anaconda/lib/python3.6/site-packages/smb/SMBConnection.py", line 103, in connect self.sock.connect(( ip, port ))

ConnectionRefusedError: [Errno 61] Connection refused

I have also posted about this on stackexchange here

Any help on this matter would be much appreciated. If the issue remains unresolved are there any recommendations for similar programs to access smb file shares?

You can check if the firewall is blocking access on port 139 or if someone has disabled SMB access on your windows server.

Issue closed. If the problem persists, feel free to reopen again.