Moving to -ram postgresql image leads to PG::ConnectionBad: PQsocket() can't get socket descriptor

Hi folks,

We’ve been building for a while on CircleCI, using our own Docker image (hosted by GCP) for a React/Rails app with ~2500 specs. Its been running specs in 4 parallel steps. This configuration has worked for us for months.

Today I tried to use a RAM disk version of Postgresql to see how it affected our specs. The entire diff of our circleci config is here

  db:
    - image: postgres:9.6-alpine
   + image: circleci/postgres:9.6.17-ram

All 4 parallel test groups fail every time on every spec with

       ActiveRecord::StatementInvalid:
         PG::ConnectionBad: PQsocket() can't get socket descriptor: BEGIN /*role:web,trace_id:82b6cbe3-bd61-4af6-aaca-23a29b63a222*/
       # ./spec/rails_helper.rb:84:in `block (2 levels) in <top (required)>'
       # ------------------
       # --- Caused by: ---
       # PG::ConnectionBad:
       #   PQsocket() can't get socket descriptor

That seems to say the containers can not reach the database. I’ve tried several different dbs in the 9.6-*-ram series that are available and get the same results – no specs can run.

So it seems like there’s something specific and systemic here. I assume its something about how docker mounts things vs how the -ram containers work but I really have no clue. Any ideas?

Also just tried “forcing” a TCP connection with a database URL in database.yml with no change to the results.

Tried it locally, without parallelism, and get


PG::ConnectionBad:
  FATAL:  could not write init file