vote up 1 vote down star

Hi,

I have very strange problem with my application, upon occasions I get following error when connecting to postgres. This happens without any pattern, often happens when I run some extensive selenium tests.

Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.

Postgres logs shows no abnormalities, also other applications that run on same postgres instance have no problems at all.

My Postgres is 8.2.9, running on windows 2008 server

Any hints ?

flag

60% accept rate

5 Answers

vote up 1 vote down

"server closed the connection unexpectedly" most of the time means the backend crashed. If that's the case there should be some lines about it in the server log.

And by the way the latest version in the 8.2 branch is 8.2.12. Upgrade, test, report.

link|flag
Server's not crashing. It runs another applications and they don't report crashes, logs are also clean. I'm absolutely clueless. – CountZero Feb 9 '09 at 22:32
vote up 0 vote down

A random guess. Do you use persistent connections?

link|flag
Problem seems to be random ;), I use 'pg_connect', not pg_pconnect so I belive connection is not persistent – CountZero Feb 9 '09 at 15:01
What's the connection timeout set to? Are your requests longer-running operations than the apps that have no problems? – duffymo Feb 9 '09 at 15:04
My requests are no different to other application's request, standard web page requests. As for connection timeout I dont set it explicitly. I looked in postgres conf file and see no timeout settings there, not sure where to look for it – CountZero Feb 9 '09 at 15:16
vote up 0 vote down

Has this issue been resolved? If so, what was the fix?

I am receiving the exact same error, and it also seems to be occurring randomly.

DB: PostgreSQL 8.3.7 OS: Windows Vista Home Premium

link|flag
vote up 0 vote down

Yes, I do have the same problem. Don't really know where to look.

I have vista Ultimate edition

link|flag
vote up 0 vote down

You're only showing the client error. Since it means that something happened on the backend, you will need to look in your server logs for information about what actually happened. (The postgres logs and/or the eventlog - check both)

A typical reason for these things to happen is if you are running some antivirus software on the server. If you do, try uninstalling it (not just disabling it) and see if the problem goes away.

link|flag

Your Answer

Get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.