Thread: Problem with NT 4.0 / driver 08.01.0102

Problem with NT 4.0 / driver 08.01.0102

From
"Philippe Lang"
Date:
Hi,

I get an error under Windows NT 4.0, and driver version 08.01.0102.

Here it is:


CONN ERROR: func=PGAPI_GetConnectOption, desc='fOption=30002', errnum=205,
errmsg='Unknown connect option (Get)'

------------------------------------------------------------
henv=169348848, conn=151350640, status=0, num_stmts=16 conn=151350640,
PGAPI_DriverConnect( in)='DSN=testdb;UID=aaaa;PWD=;APP=Microsoft
Access;DATABASE=testdb;TABLE=adresses;', fDriverCompletion=1 DSN info:
DSN='testdb',server='172.17.0.4',port='',dbase='testdb',user='aaaa',passwd='
xxxxx'
          onlyread='',protocol='',showoid='',fakeoidindex='',showsystable=''
          conn_settings='',conn_encoding='OTHER'
          translation_dll='',translation_option=''
Global Options: Version='08.01.0102', fetch=100, socket=0,
unknown_sizes=254, max_varchar_size=8190, max_longvarchar_size=20250962
                disable_optimizer=1, ksqo=1, unique_index=1,
use_declarefetch=0
                text_as_longvarchar=1, unknowns_as_longvarchar=0,
bools_as_char=1 NAMEDATALEN=64
                extra_systable_prefixes='dd_;', conn_settings=''
conn_encoding='OTHER'
CONN ERROR: func=PGAPI_DriverConnect, desc='Error from CC_Connect',
errnum=113, errmsg='could not translate host name "172.17.0.4" to address:
Unknown host '

------------------------------------------------------------
            henv=169348848, conn=151350640, status=0, num_stmts=16



No problem of this type arise with both Windows 2000 and XP.
And the old 7.030.208 version does not have this problem. It runs fine under
NT.


Philippe Lang
Attik System

Attachment

Re: Problem with NT 4.0 / driver 08.01.0102

From
Ludek Finstrle
Date:
> CONN ERROR: func=PGAPI_GetConnectOption, desc='fOption=30002', errnum=205,
> errmsg='Unknown connect option (Get)'

I think the real problem is described later.

> CONN ERROR: func=PGAPI_DriverConnect, desc='Error from CC_Connect',
> errnum=113, errmsg='could not translate host name "172.17.0.4" to address:
> Unknown host '

I don't know why but it can't get IP address. It means that 172.17.0.4
is name not IP. Could you check DNS server or lmhosts file?
Do you have correct route table on the host? Could you ping/reach
172.17.0.4 host?

> No problem of this type arise with both Windows 2000 and XP.
> And the old 7.030.208 version does not have this problem. It runs fine
> under NT.

It run in same situation (same host, same app, ...)? The newer driver
is using libpq to connect to server. So it could be the problem. I have
no WinNT 4.0 box here.

BTW maybe mylog output could be mo0re helpful.

Regards,

Luf

Re: Problem with NT 4.0 / driver 08.01.0102

From
"Philippe Lang"
Date:
I guess the problem comes from libpq, because on this exact same computer, a
simple switch from psqlodbc 7.030.208 to 08.01.0102 and the problem arises.
172.17.0.4 is accessible and used by many people, no problem on the server
side.

Is libpq maybe incompatible with Windows NT 4.0? Or may a bug with name
resolution under NT 4.0?

Here is the mylog output:


[158]Could not establish connection to the database; LIBPQ returned -> could
not translate host name "172.17.0.4" to address: Unknown host

[158]CONN ERROR: func=PGAPI_DriverConnect, desc='Error from CC_Connect',
errnum=113, errmsg='could not translate host name "172.17.0.4" to address:
Unknown host
'
[158][[SQLGetDiagRec]]
[158]PGAPI_GetDiagRec entering rec=1[158]**** PGAPI_ConnectError:
hdbc=151350640 <0>
[158]enter CC_get_error
[158]enter CC_create_errormsg
[158]msg = 'could not translate host name "172.17.0.4" to address: Unknown
host
'
[158]exit CC_create_errormsg
[158]exit CC_get_error
[158]CC_get_error: status = 113, msg = #could not translate host name
"172.17.0.4" to address: Unknown host
#
[158]         szSqlState = 'S1000',len=68, szError='(null)'
[158]PGAPI_GetDiagRec exiting 1
[158][[SQLGetDiagRec]]
[158]PGAPI_GetDiagRec entering rec=1[158]**** PGAPI_ConnectError:
hdbc=151350640 <70>
[158]enter CC_get_error
[158]exit CC_get_error
[158]CC_get_error: status = 113, msg = #could not translate host name
"172.17.0.4" to address: Unknown host
#
[158]         szSqlState = 'S1000',len=68, szError='could not translate host
name "172.17.0.4" to address: Unknown host
'
[158]PGAPI_GetDiagRec exiting 0
[158][[SQLGetDiagField]] Handle=(2,9056d70) Rec=1 Id=8
[158]PGAPI_GetDiagField entering rec=1[158]PGAPI_GetDiagField exiting 0
[158][[SQLGetDiagField]] Handle=(2,9056d70) Rec=1 Id=9
[158]PGAPI_GetDiagField entering rec=1[158]PGAPI_GetDiagField exiting 0
[158][[SQLGetDiagField]] Handle=(2,9056d70) Rec=1 Id=10
[158]PGAPI_GetDiagField entering rec=1[158]PGAPI_GetDiagField exiting 0
[158][[SQLGetDiagField]] Handle=(2,9056d70) Rec=1 Id=11
[158]PGAPI_GetDiagField entering rec=1[158]PGAPI_GetDiagField exiting 0
[158][[SQLGetDiagRec]]
[158]PGAPI_GetDiagRec entering rec=2[158]**** PGAPI_ConnectError:
hdbc=151350640 <0>
[158]PGAPI_GetDiagRec exiting 100
[158][[SQLFreeHandle]][158]PGAPI_FreeConnect: entering...
[158]**** in PGAPI_FreeConnect: hdbc=151350640
[158]enter CC_Destructor, self=151350640
[158]in CC_Cleanup, self=151350640
[158]after LIBPQ destructor
[158]exit CC_Cleanup
[158]after CC_Cleanup
[158]after free statement holders
[158]exit CC_Destructor
[158]PGAPI_FreeConnect: returning...
[158][[SQLFreeHandle]][158]**** in PGAPI_FreeEnv: env = 169348848 **
[158]in EN_Destructor, self=169348848
[158]exit EN_Destructor: rv = 1
[158]   ok

-----Message d'origine-----
De : Ludek Finstrle [mailto:luf@pzkagis.cz]
Envoyé : lundi, 23. janvier 2006 14:47
À : Philippe Lang
Cc : pgsql-odbc@postgresql.org
Objet : Re: [ODBC] Problem with NT 4.0 / driver 08.01.0102

> CONN ERROR: func=PGAPI_GetConnectOption, desc='fOption=30002',
> errnum=205, errmsg='Unknown connect option (Get)'

I think the real problem is described later.

> CONN ERROR: func=PGAPI_DriverConnect, desc='Error from CC_Connect',
> errnum=113, errmsg='could not translate host name "172.17.0.4" to address:
> Unknown host '

I don't know why but it can't get IP address. It means that 172.17.0.4 is
name not IP. Could you check DNS server or lmhosts file?
Do you have correct route table on the host? Could you ping/reach
172.17.0.4 host?

> No problem of this type arise with both Windows 2000 and XP.
> And the old 7.030.208 version does not have this problem. It runs fine
> under NT.

It run in same situation (same host, same app, ...)? The newer driver is
using libpq to connect to server. So it could be the problem. I have no
WinNT 4.0 box here.

BTW maybe mylog output could be mo0re helpful.

Regards,

Luf

Attachment

Re: Problem with NT 4.0 / driver 08.01.0102

From
Ludek Finstrle
Date:
> I guess the problem comes from libpq, because on this exact same computer, a
> simple switch from psqlodbc 7.030.208 to 08.01.0102 and the problem arises.
> 172.17.0.4 is accessible and used by many people, no problem on the server
> side.

:-( Bad information.

> Is libpq maybe incompatible with Windows NT 4.0? Or may a bug with name
> resolution under NT 4.0?

I don't know. You have to search the pgsql-interfaces archive. Maybe
try google. Maybe someone else know it.
BTW what about service pack?

I see in psqlODBC that it use only host=xxx - use host name lookups.
I don't know what is problematic in host name lookups in WinNT 4.0.
There is hostaddr=yyy in libpq which doesn't use host name lookups.
So if you could compile psqlODBC yourself I advise you change
lines in function LIBPQ_connect in connection.c:
- conninfo = (char *)malloc((sizeof(char) * strlen(" host=") + strlen(self->connInfo.server) + 1));
+ conninfo = (char *)malloc((sizeof(char) * strlen(" hostaddr=") + strlen(self->connInfo.server) + 1));
- conninfo = strcpy(conninfo," host=");
+ conninfo = strcpy(conninfo," hostaddr=");

(- means original line, + means new line). I don't see trivial patch
for this behaviour yet so I can't create official patch for it.

> Here is the mylog output:

Don't you strip it from begin? Or do you enable mylog output
under Global button? Some informations is missing.

>
> [158]Could not establish connection to the database; LIBPQ returned -> could
> not translate host name "172.17.0.4" to address: Unknown host
>
> [158]CONN ERROR: func=PGAPI_DriverConnect, desc='Error from CC_Connect',
> errnum=113, errmsg='could not translate host name "172.17.0.4" to address:
> Unknown host

Regards,

Luf