[Solved]Bootstrap fails, Postgres already running

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?

1 Like

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

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 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.

 ./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
1 Like

What I should to do now?

Reboot. It should fix it.

2 Likes

Installation is at /var/discourse, as per the official installation notes.
Using Debian

Thank you! It works! )

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

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

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

1 Like

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

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

Or try

sudo reboot
1 Like
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.

what does docker ps return?

@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

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

Instead do:

./launcher rebuild app

@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

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

3 Likes

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?