# Cannot rebuild following site failure: "postgres already running"

**URL:** <https://meta.discourse.org/t/cannot-rebuild-following-site-failure-postgres-already-running/24102>\
**Category:** Self-hosting\
**Created:** [January 16, 2015, 10:06pm UTC](https://meta.discourse.org/t/cannot-rebuild-following-site-failure-postgres-already-running/24102 "2015-01-16T22:06:26Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![DaveShaw](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daveshaw/32/114847_2.png) [@DaveShaw](https://meta.discourse.org/u/DaveShaw)\
**Post date:** [January 16, 2015, 10:06pm UTC](https://meta.discourse.org/t/cannot-rebuild-following-site-failure-postgres-already-running/24102/1 "2015-01-16T22:06:27Z")

</div>

My discourse crashed, so I tried rebuilding and I am getting the following error message. I was on 1.2.0beta4 before it went down.

I’ve rebooted the VM twice and I am getting the same problem:

Any ideas?

The full output of a rebuild now is:

```plaintext
/var/discourse$ sudo ./launcher rebuild app
WARNING: No swap limit support
Updating discourse docker
Already up-to-date.
Stopping old container
Error response from daemon: No such container: 8fc10a0a1c682060ef7ef3ff06945abc1bc9cd7e88336299eb8975e652bd9890
2015/01/15 23:15:53 Error: failed to stop one or more containers
Calculated ENV: -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=2 -e UNICORN_SIDEKIQS=1 -e RUBY_GC_MALLOC_LIMIT=40000000 -e RUBY_HEAP_MIN_SLOTS=800000 -e DISCOURSE_DB_SOCKET=/var/run/postgresql -e DISCOURSE_DB_HOST= -e DISCOURSE_DB_PORT= -e HOME=/root -e DISCOURSE_DEVELOPER_EMAILS=hidded@example.org -e DISCOURSE_HOSTNAME=tolguild.co.uk -e DISCOURSE_SMTP_ADDRESS=smtp.mandrillapp.com -e DISCOURSE_SMTP_PORT=587 -e DISCOURSE_SMTP_USER_NAME=hidden@example.org -e DISCOURSE_SMTP_PASSWORD=hidden
cd /pups && git pull && /pups/bin/pups --stdin
Already up-to-date.
I, [2015-01-15T23:15:59.292757 #42] INFO -- : Loading --stdin
I, [2015-01-15T23:15:59.305246 #42] INFO -- : > mkdir -p /shared/postgres_run
I, [2015-01-15T23:15:59.307805 #42] INFO -- :
I, [2015-01-15T23:15:59.312513 #42] INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2015-01-15T23:15:59.314954 #42] INFO -- :
I, [2015-01-15T23:15:59.315604 #42] INFO -- : > chmod 775 /shared/postgres_run
I, [2015-01-15T23:15:59.317583 #42] INFO -- :
I, [2015-01-15T23:15:59.322184 #42] INFO -- : > rm -fr /var/run/postgresql
I, [2015-01-15T23:15:59.324303 #42] INFO -- :
I, [2015-01-15T23:15:59.325098 #42] INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2015-01-15T23:15:59.326968 #42] INFO -- :
I, [2015-01-15T23:15:59.327703 #42] INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
I, [2015-01-15T23:15:59.336875 #42] INFO -- : postgres already running stop container

FAILED
--------------------
RuntimeError: socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1 failed with return #<Process::Status: pid 49 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params "socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1"
fe8f9c6922355ce819ce32e35b11f0f87cced5cb7ffaff6f115a2cfc9f0e4608
FAILED TO BOOTSTRAP

```

Cheers,  
Dave

---

_[View the full topic](https://meta.discourse.org/t/cannot-rebuild-following-site-failure-postgres-already-running/24102)._
