Circleci/postgres suddenly no longer connecting

I set this up last week and got working fine. Now, this morning, it’s not working for some reason.

I get this:

#!/bin/bash -eo pipefail
psql -U dedupely -d dedupely -f ./setup/sql/install.psql
psql: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Exited with code 2

I also have a step just before this one to wait for postgres to start:

      - run:
          name: Waiting for PostgreSQL to start
          command: |
            for i in `seq 1 30`;
            do
              nc -z localhost 5432 && echo Success && exit 0
              echo -n .
              sleep 2
            done
            echo Failed waiting for Postgres && exit 1

In the CircleCI dashboard, it shows this step as passing.

What am I doing wrong and why did it suddenly stop working? I don’t see any new changes in the docker circleci/postgres in the past 24 hours. The ./setup/sql/install.psql is still in my repo, so that’s not the issue. The issue is obviously to do with the connection. I also tried adding -h 127.0.0.1 but to no avail.

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