ftplib connection fails with multiple nics

Discussion in 'Python' started by Sean DiZazzo, Oct 17, 2009.

  1. Sean DiZazzo

    Sean DiZazzo Guest

    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
     
    Sean DiZazzo, Oct 17, 2009
    #1
    1. Advertising

  2. Sean DiZazzo

    Sean DiZazzo Guest

    On Oct 16, 4:51 pm, Sean DiZazzo <> wrote:
    > 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??
     
    Sean DiZazzo, Oct 18, 2009
    #2
    1. Advertising

  3. Sean DiZazzo <> writes:

    > On Oct 16, 4:51 pm, Sean DiZazzo <> wrote:
    >> 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).
     
    Shantanu Joshi, Oct 20, 2009
    #3
  4. Sean DiZazzo

    Sean DiZazzo Guest

    On Oct 19, 10:23 pm, Tim Roberts <> wrote:
    > Sean DiZazzo <> wrote:
    >
    > >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?
    > --
    > Tim Roberts,
    > Providenza & Boekelheide, Inc.


    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
     
    Sean DiZazzo, Oct 20, 2009
    #4
  5. Sean DiZazzo

    Sean DiZazzo Guest

    On Oct 19, 10:23 pm, Tim Roberts <> wrote:
    > Sean DiZazzo <> wrote:
    >
    > >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?
    > --
    > Tim Roberts,
    > Providenza & Boekelheide, Inc.


    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
     
    Sean DiZazzo, Oct 20, 2009
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Manu
    Replies:
    1
    Views:
    328
  2. Laszlo Nagy
    Replies:
    2
    Views:
    468
    Laszlo Nagy
    Jan 13, 2008
  3. your name

    Single RJ-45 with two NICs?

    your name, Apr 21, 2008, in forum: C Programming
    Replies:
    5
    Views:
    239
    Antoninus Twink
    Apr 21, 2008
  4. Mad Sweeney
    Replies:
    0
    Views:
    389
    Mad Sweeney
    Jun 12, 2011
  5. John Yuan

    Bind NICs to Mechanize

    John Yuan, Mar 30, 2010, in forum: Ruby
    Replies:
    12
    Views:
    208
    John Yuan
    Apr 2, 2010
Loading...

Share This Page