# "PQsocket() can't get socket" error

**URL:** <https://community.fly.io/t/pqsocket-cant-get-socket-error/20820>\
**Category:** General\
**Tags:** postgres, rails, proxy, login-only\
**Created:** [July 15, 2024, 8:45am UTC](https://community.fly.io/t/pqsocket-cant-get-socket-error/20820 "2024-07-15T08:45:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luizkowalski](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/luizkowalski/32/36821_2.png) [@luizkowalski](https://community.fly.io/u/luizkowalski)\
**Post date:** [July 15, 2024, 8:45am UTC](https://community.fly.io/t/pqsocket-cant-get-socket-error/20820/1 "2024-07-15T08:45:05Z")

</div>

hey 👋

Every since I deployed a Rails app with `good_job`, I keep getting this error:

```auto
PQsocket() can't get socket descriptor

```

it does a weird thing where the processes list on `good_job` is empty, but the actual process is up and running, picking up and processing jobs:

![image](https://global.discourse-cdn.com/fly1/original/3X/2/5/255ad4e11e8f29d8f303b5c071e4a80f7cd4e694.png)  
 ![image](https://global.discourse-cdn.com/fly1/original/3X/4/c/4c19f50f0ea1d1df41e5a2098a9c8e6c88bd4ad4.png)

this is not a new situation and other people reported this behavior on different instances like [here](https://community.fly.io/t/postgres-dropping-connection-after-30s-when-using-listen-notify/12188). The suggestion of stop using the `fly-proxy` address and connect directly to the database using `top2.nearest.of` worked, but only for a couple of days. This morning I got the error again, and it keeps happening **exactly** every hour which is weird, I wonder if this points to something… I do have a cron task that runs every 30min but I don’t think it’s related

 ![image](https://global.discourse-cdn.com/fly1/original/3X/3/f/3fffe95d99c7d03693f9bf984b6335f83bcbd423.jpeg)

I discussed this in brief with Ben, good\_job’s creator and there’s an [issue](https://github.com/bensheldon/good_job/issues/1417) open right now to follow up on this.

Has anyone seen this or fixed it somehow?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg) [@system](https://community.fly.io/u/system)\
**Post date:** [July 22, 2024, 8:45am UTC](https://community.fly.io/t/pqsocket-cant-get-socket-error/20820/2 "2024-07-22T08:45:23Z")

</div>

Closed on July 22, 2024, 8:45am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
