octopus icon indicating copy to clipboard operation
octopus copied to clipboard

PG::UnableToSend: server closed the connection unexpectedly

Open mbajur opened this issue 9 years ago • 2 comments

Hello!

I've reently started using octopus for read/write separation and i'm experiencing some troubles with my setup. I have configured a lot of websites using the same stack: postgres + rails and never encountered such issue. That makes me think that it's somewhat related to octopus gem but i obviously can't be sure.

Basically, from time to time (let's say once per hour) my app throws

PG::UnableToSend: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.

and there is no any helpful output in my postgres logs.

I'm not sure what can i post here to make it a bit easier to debug, my config is also quite standard. I've seen in few places that such issue is ofter caused by badly wrriten ruby code (like here for example: http://stackoverflow.com/questions/32638245/rspec-pgunabletosendserver-closed-the-connection-unexpectedly-this-probably ) - is that possible i've encountered some hidden bug of octopus?

Thanks in advance for any help!

ps. i'm on ruby 2.0.0, rails 4.1.0 and octopus 0.8.5

mbajur avatar Feb 01 '16 11:02 mbajur

We've started trying to deploy a branch of our app with Octopus and inevitably run into this error every time. In our case, everything is fine for a while, several of these errors show up at once, throughput on the server running this code drops, and timeouts follow.

We initially thought it was an issue with the changes in our octopus branch causing locking in postgres (and eventually timeouts), but none of the other frontend servers encountered such timeouts.

@mbajur have you made any progress with this issue?

jwilm avatar Jun 27 '16 20:06 jwilm

@mbajur @jwilm did you guys ever resolve these issues? we are running into the same problems in production at random intervals

naxels avatar May 11 '20 08:05 naxels