# \[Solved\]Bootstrap fails, Postgres already running

**URL:** https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041
**Category:** Self-hosting
**Created:** [September 13, 2014, 8:24pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041 "2014-09-13T20:24:15Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![lolmewn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lolmewn/32/114927_2.png) [@lolmewn](https://meta.discourse.org/u/lolmewn)
#### Post date: [September 13, 2014, 8:24pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/1 "2014-09-13T20:24:15Z")

</div>

Hi,

I’m attempting to install Discourse, but am failing so far. It appears that bootstrapping doesn’t want to… bootstrap?  
Anyhow, I read a couple of other threads about it and tried “./launcher rebuild app”, which gave the following output:

```
WARNING: No memory limit support
WARNING: No swap limit support
Updating discourse docker
Already up-to-date.
Calculated ENV: -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=3 -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=myEmail -e DISCOURSE_HOSTNAME=myWebsite -e DISCOURSE_SMTP_ADDRESS=smtp.mandrillapp.com
cd /pups && git pull && /pups/bin/pups --stdin
From https://github.com/SamSaffron/pups
   f7a125b..ac9bdf8 master -> origin/master
Updating f7a125b..ac9bdf8
Fast-forward
 README.md | 2 +-
 lib/pups/config.rb | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)
I, [2014-09-13T20:18:17.839357 #47] INFO -- : Loading --stdin
I, [2014-09-13T20:18:17.846012 #47] INFO -- : > mkdir -p /shared/postgres_run
I, [2014-09-13T20:18:17.851117 #47] INFO -- :
I, [2014-09-13T20:18:17.852106 #47] INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2014-09-13T20:18:17.856033 #47] INFO -- :
I, [2014-09-13T20:18:17.857172 #47] INFO -- : > chmod 775 /shared/postgres_run
I, [2014-09-13T20:18:17.861779 #47] INFO -- :
I, [2014-09-13T20:18:17.862868 #47] INFO -- : > rm -fr /var/run/postgresql
I, [2014-09-13T20:18:17.867169 #47] INFO -- :
I, [2014-09-13T20:18:17.868189 #47] INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2014-09-13T20:18:17.872311 #47] INFO -- :
I, [2014-09-13T20:18:17.873194 #47] INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
I, [2014-09-13T20:18:17.880853 #47] 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 54 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:85: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"
fe396f76ce0ba379260b0a625c3007cf1d2f13343b7de29f3376ffd5fbb02e2b
FAILED TO BOOTSTRAP

```

What am I doing wrong?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [September 13, 2014, 8:54pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/2 "2014-09-13T20:54:07Z")

</div>

Where are you installing, what OS? You are following our official guide?

---

<div class="post-metadata">

### Author: ![Vitach](https://avatars.discourse-cdn.com/v4/letter/v/c6cbf5/32.png) [@Vitach](https://meta.discourse.org/u/Vitach)
#### Post date: [September 13, 2014, 9:12pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/3 "2014-09-13T21:12:01Z")

</div>

Hi.  
I have the same issue. Tried to run “./launcher start app” command from [https://github.com/discourse/discourse/blob/master/docs/INSTALL-digital-ocean.md](https://github.com/discourse/discourse/blob/master/docs/INSTALL-digital-ocean.md) instructions on Amazon EC2 linux ami last version. Everything was fine but during running the command the connection was lost and after reconnecting I getting the same error when trying to run that command again.

---

<div class="post-metadata">

### Author: ![Vitach](https://avatars.discourse-cdn.com/v4/letter/v/c6cbf5/32.png) [@Vitach](https://meta.discourse.org/u/Vitach)
#### Post date: [September 13, 2014, 9:15pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/4 "2014-09-13T21:15:02Z")

</div>

```
 ./launcher bootstrap app
which: no docker.io in (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/odesk/bin:/opt/aws/bin)
Your Docker installation is not using the recommended AuFS (union filesystem) and may be unstable.
If you are unable to bootstrap / stop your image please report the issue at:
[https://]meta.discourse.org/t/discourse-docker-installation-without-aufs/15639
Calculated ENV: -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=3 -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=doe518875@gmail.comsmtp.example.co -e DISCOURSE_HOSTNAME=discourse.example.com -e DISCOURSE_SMTP_ADDRESS=smtp.mandrillapp.com
cd /pups && git pull && /pups/bin/pups --stdin
From github.com/SamSaffron/pups
   f7a125b..ac9bdf8 master -> origin/master
Updating f7a125b..ac9bdf8
Fast-forward
 README.md | 2 +-
 lib/pups/config.rb | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)
I, [2014-09-13T21:01:09.379800 #43] INFO -- : Loading --stdin
I, [2014-09-13T21:01:09.388596 #43] INFO -- : > mkdir -p /shared/postgres_run
I, [2014-09-13T21:01:09.408363 #43] INFO -- :
I, [2014-09-13T21:01:09.409992 #43] INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2014-09-13T21:01:09.444893 #43] INFO -- :
I, [2014-09-13T21:01:09.446697 #43] INFO -- : > chmod 775 /shared/postgres_run
I, [2014-09-13T21:01:09.463053 #43] INFO -- :
I, [2014-09-13T21:01:09.464424 #43] INFO -- : > rm -fr /var/run/postgresql
I, [2014-09-13T21:01:09.479833 #43] INFO -- :
I, [2014-09-13T21:01:09.481206 #43] INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2014-09-13T21:01:09.496822 #43] INFO -- :
I, [2014-09-13T21:01:09.498387 #43] INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
I, [2014-09-13T21:01:09.539816 #43] 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 50 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:85: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"
c284aef6888f612519acfd6fd42a21e81f1ac3e6e266244ba4c9a07a816f263d
FAILED TO BOOTSTRAP

```

---

<div class="post-metadata">

### Author: ![Vitach](https://avatars.discourse-cdn.com/v4/letter/v/c6cbf5/32.png) [@Vitach](https://meta.discourse.org/u/Vitach)
#### Post date: [September 13, 2014, 9:16pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/5 "2014-09-13T21:16:57Z")

</div>

What I should to do now?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 13, 2014, 10:12pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/6 "2014-09-13T22:12:39Z")

</div>

Reboot. It should fix it.

---

<div class="post-metadata">

### Author: ![lolmewn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lolmewn/32/114927_2.png) [@lolmewn](https://meta.discourse.org/u/lolmewn)
#### Post date: [September 13, 2014, 10:33pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/7 "2014-09-13T22:33:12Z")

</div>

Installation is at /var/discourse, as per the [official installation notes](https://github.com/discourse/discourse/blob/master/docs/INSTALL-digital-ocean.md).  
Using Debian

---

<div class="post-metadata">

### Author: ![Vitach](https://avatars.discourse-cdn.com/v4/letter/v/c6cbf5/32.png) [@Vitach](https://meta.discourse.org/u/Vitach)
#### Post date: [September 14, 2014, 5:00am UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/8 "2014-09-14T05:00:33Z")

</div>

Thank you! It works! )

---

<div class="post-metadata">

### Author: ![lolmewn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lolmewn/32/114927_2.png) [@lolmewn](https://meta.discourse.org/u/lolmewn)
#### Post date: [September 14, 2014, 9:14am UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/9 "2014-09-14T09:14:14Z")

</div>

Rebooting the whole system seems to have worked. It now passes the initial breaking point, and I’m awaiting full rebuild now. Thanks 🙂

---

<div class="post-metadata">

### Author: ![ChrisOva](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisova/32/95283_2.png) [@ChrisOva](https://meta.discourse.org/u/ChrisOva)
#### Post date: [October 25, 2014, 8:43pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/10 "2014-10-25T20:43:30Z")

</div>

reboot as in type “reboot” in the cli? cause that didn’t work for me. Im on docker

---

<div class="post-metadata">

### Author: ![lolmewn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lolmewn/32/114927_2.png) [@lolmewn](https://meta.discourse.org/u/lolmewn)
#### Post date: [October 25, 2014, 10:26pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/11 "2014-10-25T22:26:18Z")

</div>

I meant the whole server. Not just docker, not just cli, everything. All of it.

---

<div class="post-metadata">

### Author: ![ChrisOva](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisova/32/95283_2.png) [@ChrisOva](https://meta.discourse.org/u/ChrisOva)
#### Post date: [October 26, 2014, 7:32am UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/12 "2014-10-26T07:32:36Z")

</div>

Done. Same results. I was doing the same thing before anyways.

```
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 52 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"
cb91b239e00fe5e4c1a0f4eb5eea26263eb6149df52db1c6cb6d81899e4cc510
FAILED TO BOOTSTRAP

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [October 26, 2014, 8:10am UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/13 "2014-10-26T08:10:53Z")

</div>

reboot your droplet in the digital ocean dashboard, if its a physical server, pull the power cord out.

Or try

```plaintext
sudo reboot

```

---

<div class="post-metadata">

### Author: ![Dwalus](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@Dwalus](https://meta.discourse.org/u/Dwalus)
#### Post date: [March 29, 2015, 10:43pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/15 "2015-03-29T22:43:48Z")

</div>

```
root@maps:/var/discourse# ./launcher bootstrap app
cd /pups && git pull && /pups/bin/pups --stdin
From https://github.com/SamSaffron/pups
   ee8fdfb..4203610 master -> origin/master
Updating ee8fdfb..4203610
Fast-forward
 README.md | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
I, [2015-03-29T22:40:43.249663 #41] INFO -- : Loading --stdin
I, [2015-03-29T22:40:43.263023 #41] INFO -- : > mkdir -p /shared/postgres_run
I, [2015-03-29T22:40:43.268037 #41] INFO -- : 
I, [2015-03-29T22:40:43.269442 #41] INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2015-03-29T22:40:43.274397 #41] INFO -- : 
I, [2015-03-29T22:40:43.275935 #41] INFO -- : > chmod 775 /shared/postgres_run
I, [2015-03-29T22:40:43.279817 #41] INFO -- : 
I, [2015-03-29T22:40:43.281147 #41] INFO -- : > rm -fr /var/run/postgresql
I, [2015-03-29T22:40:43.287355 #41] INFO -- : 
I, [2015-03-29T22:40:43.288678 #41] INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2015-03-29T22:40:43.291936 #41] INFO -- : 
I, [2015-03-29T22:40:43.293245 #41] INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
I, [2015-03-29T22:40:43.308277 #41] 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 48 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"
6a20fc5591eb101f70e77d9988ddcbd234572b24b3f46878c94e6fa0638089b0
FAILED TO BOOTSTRAP

```

Can someone tell me what I’m doing wrong? I already tried rebooting my server from both the digitalocean website and using **sudo reboot**.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 29, 2015, 10:46pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/16 "2015-03-29T22:46:23Z")

</div>

what does `docker ps` return?

---

<div class="post-metadata">

### Author: ![Dwalus](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@Dwalus](https://meta.discourse.org/u/Dwalus)
#### Post date: [March 29, 2015, 10:48pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/17 "2015-03-29T22:48:18Z")

</div>

@sam

```
root@maps:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
29a0fb6df815 local_discourse/app:latest "/sbin/boot" 24 minutes ago Up 7 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:2222->22/tcp app

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 29, 2015, 10:52pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/18 "2015-03-29T22:52:50Z")

</div>

well, if you app is running you can not bootstrap it.

Instead do:

```plaintext
./launcher rebuild app

```

---

<div class="post-metadata">

### Author: ![Dwalus](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@Dwalus](https://meta.discourse.org/u/Dwalus)
#### Post date: [March 29, 2015, 11:01pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/19 "2015-03-29T23:01:07Z")

</div>

@sam okay, and then I try launching? I’m still failing to bootstrap.

```
root@maps:/var/discourse# ./launcher bootstrap app
cd /pups && git pull && /pups/bin/pups --stdin
From https://github.com/SamSaffron/pups
   ee8fdfb..4203610 master -> origin/master
Updating ee8fdfb..4203610
Fast-forward
 README.md | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
I, [2015-03-29T22:59:46.227700 #41] INFO -- : Loading --stdin
I, [2015-03-29T22:59:46.242309 #41] INFO -- : > mkdir -p /shared/postgres_run
I, [2015-03-29T22:59:46.248445 #41] INFO -- : 
I, [2015-03-29T22:59:46.250250 #41] INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2015-03-29T22:59:46.254719 #41] INFO -- : 
I, [2015-03-29T22:59:46.256305 #41] INFO -- : > chmod 775 /shared/postgres_run
I, [2015-03-29T22:59:46.262436 #41] INFO -- : 
I, [2015-03-29T22:59:46.263948 #41] INFO -- : > rm -fr /var/run/postgresql
I, [2015-03-29T22:59:46.269209 #41] INFO -- : 
I, [2015-03-29T22:59:46.270759 #41] INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2015-03-29T22:59:46.274267 #41] INFO -- : 
I, [2015-03-29T22:59:46.275702 #41] INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
I, [2015-03-29T22:59:46.304313 #41] 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 48 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"
70642f4f8aed7b087435e19837ae83a11b3a562dabe51e43ebf0c8bd2d462221
FAILED TO BOOTSTRAP

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 29, 2015, 11:12pm UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/20 "2015-03-29T23:12:45Z")

</div>

> [@Dwalus](#):
>
> okay, and then I try launching? I’m still failing to bootstrap.

launcher rebuild **will** bootstrap your app **and** restart it. There is not need to **bootstrap** AGAIN while the recreated container is already running.

Golden rule if this is confusing you.

**never run ./launcher bootstrap ever, just use ./launcher rebuild and you should be good**

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 30, 2015, 3:01am UTC](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041/21 "2015-03-30T03:01:25Z")

</div>

If this is the case bootstrap should complain if stuff is running and you’re bootstrapping again. Any rudimentary protection we can add here to reduce support requests?

[Next page](https://meta.discourse.org/t/solved-bootstrap-fails-postgres-already-running/20041.md?page=2)
