PG::ConnectionBad: PQsocket() can't get socket descriptor

Sometimes you see the error when running your specs.

PG::ConnectionBad: PQsocket() can't get socket descriptor

This normally means your app exhausts connections to the database. When you started getting this, you may want to add the following to your database.yml.

pool: 5
reaping_frequency: 10

Since CircleCI uses auto-generated database.yml by default, you need to replace the database.yml by your own.

database:
  post:
    - mv config/database.ci.yml config/database.yml

where config/database.ci.yml has the connection options.

1 Like