Failed to bootstrap on DO/Docker Fresh install


(Cy) #1

I’ve just started a new server following DO instructions step by step and once did “./launcher bootstrap app” I got the following

./launcher bootstrap app
cd /pups && git pull && /pups/bin/pups --stdin
Already up-to-date.
I, [2015-08-07T08:28:55.099744 #36]  INFO -- : Loading --stdin
/pups/lib/pups/cli.rb:15:in `split': invalid byte sequence in US-ASCII (ArgumentError)
	from /pups/lib/pups/cli.rb:15:in `run'
	from /pups/bin/pups:8:in `<main>'
0863bc0343acd6434412d672772acd2b69b6b565fce7aa9848fd12fc83a554ae
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

Any hint on why and how to solve it?


(Jeff Atwood) #2
  • Did you follow the guide exactly, or did you deviate from any of the steps in any way or add anything else?

  • Is this a default english installation?

  • Does the YAML pass an online YAML validator?


(Cy) #3

I followed this guide exactly. Not even one step out of it: How To Install Discourse via Docker on Ubuntu 14.04 | DigitalOcean

history
    1  sudo apt-get update
    2  sudo apt-get upgrade
    3  apt-get install git
    4  sudo install -o root -g root -m 0600 /dev/null /swapfile
    5  dd if=/dev/zero of=/swapfile bs=1k count=2048k
    6  mkswap /swapfile
    7  swapon /swapfile
    8  echo "/swapfile       swap    swap    auto      0       0" | sudo tee -a /etc/fstab
    9  sudo sysctl -w vm.swappiness=10
   10  echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf
   11  free -m
   12  wget -qO- https://get.docker.io/ | sh
   13  mkdir /var/discourse
   14  git clone https://github.com/discourse/discourse_docker.git /var/discourse
   15  cd /var/discourse
   16  cp samples/standalone.yml containers/app.yml
   17  nano containers/app.yml
   18  nano /etc/default/docker 
   19  service docker restart
   20  ./launcher bootstrap app
   21  history

Default english installation

I don’t know how to check the YAML online validator

Instance type 1GB / Frankfurt zone / Ubuntu 14.04


(Régis Hanol) #4

Just copy and paste the content of you app.yml file into http://www.yamllint.com/.


(Cy) #5

Thanks @zogstrip, the validator said:

Valid YAML!


(Jeff Atwood) #6

I would start over from scratch (reset droplet) and follow our official guide instead.

The DO one is also semi-official, but… ours is best :wink:


(Cy) #7

Will do and revert shortly.


(Cy) #8

Exactly the same issue. (well, not exactly the same but fails anyways)

    Success. You can now start the database server using:

    /usr/lib/postgresql/9.3/bin/postgres -D /shared/postgres_data
or
    /usr/lib/postgresql/9.3/bin/pg_ctl -D /shared/postgres_data -l logfile start


I, [2015-08-07T09:13:52.554231 #40]  INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2015-08-07T09:13:52.561658 #40]  INFO -- : 
I, [2015-08-07T09:13:52.562149 #40]  INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2015-08-07T09:13:52.565338 #40]  INFO -- : 
I, [2015-08-07T09:13:52.566234 #40]  INFO -- : > /root/upgrade_postgres
I, [2015-08-07T09:13:52.574080 #40]  INFO -- : 
I, [2015-08-07T09:13:52.576076 #40]  INFO -- : > rm /root/upgrade_postgres
I, [2015-08-07T09:13:52.577873 #40]  INFO -- : 
I, [2015-08-07T09:13:52.578767 #40]  INFO -- : Replacing data_directory = '/var/lib/postgresql/9.3/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-08-07T09:13:52.579961 #40]  INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-08-07T09:13:52.581886 #40]  INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-08-07T09:13:52.583446 #40]  INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-08-07T09:13:52.585126 #40]  INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-08-07T09:13:52.587949 #40]  INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-08-07T09:13:52.589979 #40]  INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2015-08-07T09:13:52.595172 #40]  INFO -- : 
I, [2015-08-07T09:13:52.596220 #40]  INFO -- : Replacing (?-mix:#?max_wal_senders *=.*) with max_wal_senders = $db_max_wal_senders in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-08-07T09:13:52.597622 #40]  INFO -- : Replacing (?-mix:#?wal_level *=.*) with wal_level = $db_wal_level in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-08-07T09:13:52.600259 #40]  INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-08-07T09:13:52.601921 #40]  INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-08-07T09:13:52.603712 #40]  INFO -- : Replacing (?-mix:#?log_min_duration_statement *=.*) with log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-08-07T09:13:52.605656 #40]  INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres  peer in /etc/postgresql/9.3/main/pg_hba.conf
I, [2015-08-07T09:13:52.607642 #40]  INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/9.3/main/pg_hba.conf
I, [2015-08-07T09:13:52.609477 #40]  INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.3/bin/postmaster -D /etc/postgresql/9.3/main
LOG:  invalid value for parameter "shared_buffers": "MB"
2015-08-07 09:13:52 UTC [110-2] FATAL:  configuration file "/etc/postgresql/9.3/main/postgresql.conf" contains errors
I, [2015-08-07T09:13:52.645170 #40]  INFO -- : > sleep 5
I, [2015-08-07T09:13:57.649656 #40]  INFO -- : 
I, [2015-08-07T09:13:57.653807 #40]  INFO -- : > su postgres -c 'createdb discourse' || true
createdb: could not connect to database template1: 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"?
I, [2015-08-07T09:13:57.763683 #40]  INFO -- : 
I, [2015-08-07T09:13:57.765645 #40]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
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"?
I, [2015-08-07T09:13:57.848521 #40]  INFO -- : 
I, [2015-08-07T09:13:57.850881 #40]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
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"?
I, [2015-08-07T09:13:57.924048 #40]  INFO -- : 
I, [2015-08-07T09:13:57.925495 #40]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
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"?
I, [2015-08-07T09:13:57.995779 #40]  INFO -- : 
I, [2015-08-07T09:13:57.996709 #40]  INFO -- : Terminating async processes


FAILED
--------------------
RuntimeError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return #<Process::Status: pid 136 exit 2>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params "su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"
10049654150ec47827e12132b1ebc9ab5fe2e8dfc4ededdda2bd15ee492afac4
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one
root@clubmr2:/var/discourse#

History of commands from fresh install following the official instructions:

history
    1  sudo install -o root -g root -m 0600 /dev/null /swapfile
    2  dd if=/dev/zero of=/swapfile bs=1k count=1024k
    3  dd if=/dev/zero of=/swapfile bs=1k count=2048k
    4  mkswap /swapfile
    5  swapon /swapfile
    6  echo "/swapfile       swap    swap    auto      0       0" | sudo tee -a /etc/fstab
    7  sudo sysctl -w vm.swappiness=10
    8  echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf
    9  wget -qO- https://get.docker.com/ | sh
   10  mkdir /var/discourse
   11  git clone https://github.com/discourse/discourse_docker.git /var/discourse
   12  cd /var/discourse
   13  cp samples/standalone.yml containers/app.yml
   14  nano containers/app.yml
   15  ./launcher bootstrap app
   16  history

(Sam Saffron) #9

what editor did you use to edit your app.yml, it looks like you saved it in a weird format.


(Cy) #10

Used nano, but it passes YAML tests. Above is a copy paste from your web to the command line.


(Sam Saffron) #11

Something in your app.yml is messed up and passing invalid data into postgres conf. what did you change.


(Cy) #12

http://paste.ubuntu.com/12019770/

This is a pastebin directly from command line.

Only changed what is strictly mentioned on the tutorial. SMTP settings and unicorn workers / 128MB


(Jeff Atwood) #13

I, [2015-08-07T09:13:52.609477 #40] INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.3/bin/postmaster -D /etc/postgresql/9.3/main LOG: invalid value for parameter "shared_buffers": "MB"

This is your error. Whatever you are using to edit this file, or the contents of it, you’re entering something invalid.


(Sam Saffron) #14

that is likely it, it wants to know how many MB… a number to denote that would be helpful


(Cy) #15

Exactly @sam That was the issue there. Thanks for your help. :blush:


(Régis Hanol) #16