Обсуждение: ConnecDB() -- couldn't send SSL negotiation packet:
hi, While i am trying to connect pgsql from a perl program, i am getting the error message as ConnectDB() -- couldn't send SSL negotiation packet: errno=9 Bad file descriptor Why i am getting this error? How can i rectify this problem? Remember, i am socksifying my application for some necessary reason.
From: "Bhuvan A" <bhuvanbk@yahoo.com> > While i am trying to connect pgsql from a perl program, i am > getting the error message as > > ConnectDB() -- couldn't send SSL negotiation packet: > errno=9 Bad file descriptor Are you checking return values from whatever connect/open call you make? It sounds like the client end is trying to negotiate a connection over a non-existent socket. What Perl module are you using? Can you show some code? - Richard Huxton
Well, I am using the perl standard module 'Pg'. For your kind attention, I am socksifying my application, since we are here using proxy! On Thu, 5 Jul 2001, Richard Huxton wrote: > From: "Bhuvan A" <bhuvanbk@yahoo.com> > > > While i am trying to connect pgsql from a perl program, i am > > getting the error message as > > > > ConnectDB() -- couldn't send SSL negotiation packet: > > errno=9 Bad file descriptor > > Are you checking return values from whatever connect/open call you make? It > sounds like the client end is trying to negotiate a connection over a > non-existent socket. > > What Perl module are you using? > > Can you show some code? > > - Richard Huxton >
Bhuvan A wrote: > > Well, I am using the perl standard module 'Pg'. For your > kind attention, I am socksifying my application, since we > are here using proxy! Right - can you post the 10 lines of code or so leading up to where the error occurs? - Richard Huxton
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 255 returned --------END--------- MISC: Sir, why my message is not getting posted in pgsql-sql mailing list! On Fri, 6 Jul 2001, Richard Huxton wrote: > Bhuvan A wrote: > > > > Well, I am using the perl standard module 'Pg'. For your > > kind attention, I am socksifying my application, since we > > are here using proxy! > > Right - can you post the 10 lines of code or so leading up to where the > error occurs? > > - Richard Huxton >
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