473,385 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

pqReadData() -- read() failed: errno=32

Hi,

cobalt 2.2.16
psql 7.2.3
DBI 1.32

I get this error, as in subject:-
pqReadData() -- read() failed: errno=32
and then followed by this
pqReadData() -- backend closed the channel unexpectedly.

I can find no reference to errno=32 in the mailing lists.

If i define and connect the database handle within the function that does my
processing, then i get no errors (but very slow processing due to connecting
on each event).

If i define and connect the database handle as a global variable outside of
the function, then i get that error on the first insert.

Any ideas ?

Craig


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #1
5 2663
On Thursday 18 December 2003 12:23, Craig Stratton wrote:
Hi,

cobalt 2.2.16
psql 7.2.3
DBI 1.32

I get this error, as in subject:-
pqReadData() -- read() failed: errno=32
and then followed by this
pqReadData() -- backend closed the channel unexpectedly.

I can find no reference to errno=32 in the mailing lists.
From memory and google, it's a broken pipe, traditionally from php's
persistent connections. Assuming a backend isn't dying, I'm a bit puzzled.
Check your logs and see if all is OK.
If i define and connect the database handle within the function that does
my processing, then i get no errors (but very slow processing due to
connecting on each event).

If i define and connect the database handle as a global variable outside
of the function, then i get that error on the first insert.


Can you give a short example of what works and what doesn't.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #2
> > I get this error, as in subject:-
pqReadData() -- read() failed: errno=32
and then followed by this
pqReadData() -- backend closed the channel unexpectedly.

I can find no reference to errno=32 in the mailing lists.
From memory and google, it's a broken pipe, traditionally from php's
persistent connections. Assuming a backend isn't dying, I'm a bit puzzled.
Check your logs and see if all is OK.


This is running as a cgi script, not php. The backend dies afterwards.
I think it is dbi/thread/child related, so i modified the code, but still no
joy.
I am fairly sure its dbi thread related still though.
If i define and connect the database handle within the function that does my processing, then i get no errors (but very slow processing due to
connecting on each event).

If i define and connect the database handle as a global variable outside of the function, then i get that error on the first insert.


Can you give a short example of what works and what doesn't.


1) connect within sub
my $dbv;
sub SQLLogging {
$dbv = DBI->connect("DBI:Pg:dbname=dbv","admin", "", {'PrintError' => 0});
and then all following inserts work fine

2) connect outside of sub
my $dbv;
$dbv = DBI->connect("DBI:Pg:dbname=dbv","admin", "", {'PrintError' => 0});
sub SQLLogging {
and then i get the error on the first insert attempt

3) connect outside, connect inside if not defined (in case missed by thread
fork)
my $dbv;
$dbv = DBI->connect("DBI:Pg:dbname=dbv","admin", "", {'PrintError' => 0});
sub SQLLogging {
unless(defined($dbv)){
$dbv = DBI->connect("DBI:Pg:dbname=dbv","admin", "", {'PrintError' =>
0});
}
this gives me the same problem as (2)
I didn't write the rest of the script, only the logging routine, so until i
go back and study the code, i am not sure where the fork(s) happen.
I was hoping that the errno=32 would give a clear indication that there was
a client/connection problem to follow up.

Regards
Craig

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #3
On Thu, Dec 18, 2003 at 02:30:55PM -0000, Craig Stratton wrote:
This is running as a cgi script, not php. The backend dies afterwards.
I think it is dbi/thread/child related, so i modified the code, but still no
joy.
I am fairly sure its dbi thread related still though.


Is this running within some persistent model? PersistentPerl, mod_perl,
whatever? It may be a problem related to this:

http://perl.apache.org/docs/general/...ed_Subroutines

Even if it's not, you can try using "our" instead of "my" and see if
that fixes it. If it does, then probably that's the problem. If it
doesn't, maybe another of the solutions proposed there will, or maybe
not.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Vivir y dejar de vivir son soluciones imaginarias.
La existencia está en otra parte" (Andre Breton)

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #4
Richard Huxton <de*@archonet.com> writes:
On Thursday 18 December 2003 12:23, Craig Stratton wrote:
I can find no reference to errno=32 in the mailing lists.
From memory and google, it's a broken pipe,


It would be a good idea to check in /usr/include/errno.h before
assuming that 32 means EPIPE on a Cobalt. I'm a bit suspicious
of that because I can't imagine why read() would return EPIPE.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #5
On Thursday 18 December 2003 14:30, Craig Stratton wrote:
I get this error, as in subject:-
pqReadData() -- read() failed: errno=32
and then followed by this
pqReadData() -- backend closed the channel unexpectedly.

I can find no reference to errno=32 in the mailing lists.
From memory and google, it's a broken pipe, traditionally from php's
persistent connections. Assuming a backend isn't dying, I'm a bit
puzzled. Check your logs and see if all is OK.


This is running as a cgi script, not php. The backend dies afterwards.
I think it is dbi/thread/child related, so i modified the code, but still
no joy.
I am fairly sure its dbi thread related still though.

3) connect outside, connect inside if not defined (in case missed by thread
fork)


What threads and forking? Are you re-using the same connection in different
threads/processes?

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chris Jankowski | last post by:
I am trying to print an image file to a network printer and getting the following error. This is a Windows based system, using a network printer. Any ideas. Error Message: cannot print image...
2
by: Nigel King | last post by:
I have a problem with the logging module. It reports a Broken Pipe error after outputing to the log file occasionally (5%). This does not appear to happen on Mac OSX using current finked python...
3
by: RoSsIaCrIiLoIA | last post by:
On Wed, 05 May 2004, CBFalconer <cbfalconer@yahoo.com> wrote: >Even if sscanf succeeds in inputting various fields, there are >probably range and other validity checks to be applied. The...
4
by: ae5880 | last post by:
Hello all, need to read a 321bit value from a file into a 64 bit variable (either float or int). in addition, the endianness of the run-time platform could differ from the endianness of the...
8
by: noleander | last post by:
I've got two threads reading from one disk file (I'm using the Pthread library). I need each thread to have its own file seek pointer, so they can read from independent parts of the file. I...
5
by: Gregory Piñero | last post by:
Hi Guys, I'm sure this is documented somewhere, I just can't locate it. Say I have this code: try: myfile=file('greg.txt','r') except IOError, error: #now psuedo code because this is what...
168
by: broeisi | last post by:
Hello, Is there a way in C to get information at runtime if a processor is 32 or 64 bit? Cheers, Broeisi
22
by: viza | last post by:
Hi all, A quick one - since errno is a lvalue, can I do: fread( & errno, sizeof errno, 1, fp ) ? TIA viza
2
by: jarea | last post by:
I have read quite a bit about this error but I have yet to find the solution to my problem. I am trying to execute the following mysql statement: alter table line_items add...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.