ftplib connection fails with multiple nics

S

Sean DiZazzo

Hi all,

I'm trying to connect to an ftp site from a windows machine with two
nics going to two different networks, but I keep getting the below
exception:

Traceback (most recent call last):
File "ftp.pyo", line 70, in connect
File "ftp.pyo", line 17, in __init__
File "ftplib.pyo", line 131, in connect
File "socket.pyo", line 498, in create_connection
gaierror: [Errno 10093] getaddrinfo failed

I think it is because of the two nics, because the code runs fine on
other machines. Any ideas on how to fix this?

TIA.

~Sean
 
S

Sean DiZazzo

Hi all,

I'm trying to connect to an ftp site from a windows machine with two
nics going to two different networks, but I keep getting the below
exception:

Traceback (most recent call last):
  File "ftp.pyo", line 70, in connect
  File "ftp.pyo", line 17, in __init__
  File "ftplib.pyo", line 131, in connect
  File "socket.pyo", line 498, in create_connection
gaierror: [Errno 10093] getaddrinfo failed

I think it is because of the two nics, because the code runs fine on
other machines.  Any ideas on how to fix this?

TIA.

~Sean

What does socket.getaddrinfo() rely on??
 
S

Shantanu Joshi

Sean DiZazzo said:
Hi all,

I'm trying to connect to an ftp site from a windows machine with two
nics going to two different networks, but I keep getting the below
exception:

Traceback (most recent call last):
  File "ftp.pyo", line 70, in connect
  File "ftp.pyo", line 17, in __init__
  File "ftplib.pyo", line 131, in connect
  File "socket.pyo", line 498, in create_connection
gaierror: [Errno 10093] getaddrinfo failed

I think it is because of the two nics, because the code runs fine on
other machines.  Any ideas on how to fix this?

TIA.

~Sean

What does socket.getaddrinfo() rely on??

First, check if you can ping the FTP server from your client machine.

getaddrinfo relies on either DNS, /etc/hosts, or NIS, depending on how your
system is configured (check the hosts entry in /etc/nsswitch.conf).
 
S

Sean DiZazzo

Sean DiZazzo said:
I'm trying to connect to an ftp site from a windows machine with two
nics going to two different networks, but I keep getting the below
exception:
Traceback (most recent call last):
 File "ftp.pyo", line 70, in connect
 File "ftp.pyo", line 17, in __init__
 File "ftplib.pyo", line 131, in connect
 File "socket.pyo", line 498, in create_connection
gaierror: [Errno 10093] getaddrinfo failed
I think it is because of the two nics, because the code runs fine on
other machines.  Any ideas on how to fix this?

10093 is WSANOTINITIALISED, implying that WSAStartup has not been called.
Are you doing this in a thread?  Are these all the same version of the
operating system?

Yes. I'm running it a thread. It's tough to debug because the code
is wrapped up as an exe. ie. There is no local python install to test
with.

Can you elaborate on what WSANOTINITIALZED actually means? Where is
it called in the Python code? Inside socket.py? Can I force a
WSASTARTUP call in python code?

PS. Im on Windows. Thanks!

~Sean
 
S

Sean DiZazzo

Sean DiZazzo said:
I'm trying to connect to an ftp site from a windows machine with two
nics going to two different networks, but I keep getting the below
exception:
Traceback (most recent call last):
 File "ftp.pyo", line 70, in connect
 File "ftp.pyo", line 17, in __init__
 File "ftplib.pyo", line 131, in connect
 File "socket.pyo", line 498, in create_connection
gaierror: [Errno 10093] getaddrinfo failed
I think it is because of the two nics, because the code runs fine on
other machines.  Any ideas on how to fix this?

10093 is WSANOTINITIALISED, implying that WSAStartup has not been called.
Are you doing this in a thread?  Are these all the same version of the
operating system?

The problem was that I was including "winsock.dll" and "ws2_32.dll" in
the py2exe package. Once I removed them, the application could
connect fine.

Thank you both for your suggestions and help.

~Sean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

FTP problem 4
skip Trackback error for ftp checking 3
FTPlib 2
ftplib error- Large file 6
Problems with FTP 7
ftplib strange behaviour 2
kinterbasdb error connection 3
SSL connection issue with Windows CPython 0

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top