# Circleci/postgres suddenly no longer connecting

**URL:** <https://discuss.circleci.com/t/circleci-postgres-suddenly-no-longer-connecting/21211>\
**Category:** Databases\
**Tags:** postgresql, circle-yml\
**Created:** [April 3, 2018, 1:07pm UTC](https://discuss.circleci.com/t/circleci-postgres-suddenly-no-longer-connecting/21211 "2018-04-03T13:07:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dedupely](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/dedupely/32/18113_2.png) [@dedupely](https://discuss.circleci.com/u/dedupely)\
**Post date:** [April 3, 2018, 1:07pm UTC](https://discuss.circleci.com/t/circleci-postgres-suddenly-no-longer-connecting/21211/1 "2018-04-03T13:07:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [July 2, 2018, 1:07pm UTC](https://discuss.circleci.com/t/circleci-postgres-suddenly-no-longer-connecting/21211/2 "2018-07-02T13:07:10Z")

</div>

Closed on July 2, 2018, 1:07pm UTC

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