[erlang-questions] Problem with connection via ODBC

Ingela Anderton Andin ingela@REDACTED
Mon Jul 28 14:50:20 CEST 2008


Hi,

This seems like some kind of configuration problem, maybe it has to do 
with ipv6. Odbc on unix will use either ipv4 or ipv6 depending on 
configuration,
but if you have a broken configuration maybe odbc tries to use a ipv6 
that is not really there?! My first hit when gooling for eafnosupport  says:

"Address family not supported by protocol

This is an error you get when you try to connect(2) 
<http://www.wlug.org.nz/connect%282%29> or bind(2) 
<http://www.wlug.org.nz/bind%282%29> a socket to an address where that 
address doesn't make sense. For example trying to bind a socket created 
with PF_INET (Protocol Family Internet) to a AF_UNIX (Address Family 
Unix Domain Socket) address, it just doesn't make sense. Alternatively 
you forgot to fill in the sin_family or uin_family field in your address 
structure. Either way the programmer screwed up.

This can also occur if the OperatingSystem 
<http://www.wlug.org.nz/OperatingSystem> does not support a particular 
protocol. For example

    $ ping6 ::1 ping6: socket: Address family not supported by protocol

    $ strace ping6 ::1 ... socket(PF_INET6, SOCK_RAW, 58) = -1
    EAFNOSUPPORT (Address family not supported by protocol) ...

In this case, the machine does not have IPv6 
<http://www.wlug.org.nz/IPv6> support, but a program tried to use i.


Regards  Ingela - Erlang/OTP, Ericsson

> ------------------------------
>
> Message: 3
> Date: Tue, 15 Jul 2008 09:15:03 +0400
> From: camui <camuig@REDACTED>
> Subject: Re: [erlang-questions] Problem with connection via ODBC
> To: "Gleb Peregud" <gleber.p@REDACTED>
> Cc: erlang-questions@REDACTED
> Message-ID:
> 	<3df44f150807142215re1450d8l5b5856974760d52e@REDACTED>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I have some doubt in that this is bug in ODBC, because I have no trouble
> with connection to the database from another applications (such as
> OpenOffice). This applications also use ODBC.
>
> 2008/7/14, Gleb Peregud <gleber.p@REDACTED>:
>   
>> 2008/7/14 camui <camuig@REDACTED>:
>>
>>     
>>> Dear Erlang Team!
>>>
>>> I have a problem with connection to the remote database via ODBC in
>>>       
>> Erlang.
>>     
>>> 1> odbc:connect("DSN=pg", [{scrollable_cursors, off}]).
>>> {error,{{badmatch,{error,eafnosupport}},
>>> [{odbc,init,1},{gen_server,init_it,6},{proc_lib,init_p,5}]}}
>>>
>>> The database is located on another machine in the local network.
>>> I have tried to connect to this database in the OpenOffice Base (using
>>>       
>> ODBC)
>>     
>>> and there are no problems. And I had not any troubles with connection in
>>> Erlang on the machine where database is located.
>>>
>>> May you help me, please?
>>>
>>> Andrey.
>>>       
>> Hi,
>>
>> Quick search about "eafnosupport" (which, as can be read from this
>> error log, is the error "code") reveals:
>>
>> "This is an error you get when you try to connect(2) or bind(2) a
>> socket to an address where that address doesn't make sense. "
>>
>> and
>>
>> "Either way the programmer screwed up."
>>
>> So it may be bug in ODBC or i are using it in a wrong way :)
>>
>>
>> --
>> Gleb Peregud
>> http://gleber.pl/
>>
>> Every minute is to be grasped.
>> Time waits for nobody.
>> -- Inscription on a Zen Gong
>>
>>     
>




More information about the erlang-questions mailing list