Re: ConnecDB() -- couldn't send SSL negotiation packet: - Mailing list pgsql-sql

From Richard Huxton
Subject Re: ConnecDB() -- couldn't send SSL negotiation packet:
Date
Msg-id 003901c10603$e70de2c0$1001a8c0@archonet.com
Whole thread Raw
In response to Re: ConnecDB() -- couldn't send SSL negotiation packet:  (Bhuvan A <bhuvanbk@yahoo.com>)
List pgsql-sql
From: "Bhuvan A" <bhuvanbk@yahoo.com>

> Well, here is the part of my code where i am trying to
> connect to database server which uses the perl module 'Pg'.
>
>
> $db    =   'user=bhuvan dbname=bhuvan host=localhost';
> $conn  =  Pg::connectdb($db);
> die "Sorry! DATABASE CONNECTION FAILED\n",
> $conn->errorMessage unless PGRES_CONNECTION_OK eq $conn->status;
> print "db connection SUCCESSFUL\n";
>
>
> Here is again the output:
>
> Sorry! DATABASE CONNECTION FAILED
> connectDB() -- couldn't send SSL negotiation packet: errno=9
> Bad file descriptor

Well - a quick peek at the source shows this error is generated exactly
where you'd expect - in the client connection routines.

It looks like negotiating SSL is the first thing it does after connecting,
and the "Bad file descriptor" doesn't look promising either. BUT - the
initial connection was opened satisfactorily.

Poking around on google turns up a lot of pages for "bad file descriptor"
and adding "socks" gives a fair list including:
 malik.bishkek.su/doc/UNIX/socks/socksfaq.htm

20. What causes the log message "Bind failed for xxx.xxx.xxx.xxx: ..."?
[Top]
This log message occurs when the SOCKS server tries to bind to a port in use
by another process. For example, another SOCKS server is running or inetd is
listening to the port. Use the ps command to find and terminate the other
process or check /etc/inetd.conf for a conflicting entry.
Most UNIX systems return EADDRINUSE, address is already in use. Some
systems, including Linux, return EBADF, bad file descriptor. Although the
messages and codes differ, the source of the problem is that the port is in
use.

Check your socks logfile and see if this is the root of the problem. I'm
assuming pre-socks everything worked fine with Pg?

HTH

- Richard Huxton



pgsql-sql by date:

Previous
From: "Richard Huxton"
Date:
Subject: Re: While Using COPY COMMAND ...
Next
From: Morgan Curley
Date:
Subject: Cross database foreign keys