Help with Multisite Installation


#1

Hi,

Can any one guide me how to fix this error while boot strapping web_only?

./launcher bootstrap web_only

RuntimeError: cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate failed with return #<Process::Status: pid 164 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params "cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate"
bc2ddaeb6124f5163d0ec5b1539f6b5ef9ba388a60bd90ade9914493eab5caa7
FAILED TO BOOTSTRAP

Here are my YML files

web_only.yml

templates:
  - "templates/sshd.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
expose:
  - "80:80"
  - "2222:22"
params:
  version: tests-passed
env:
  LANG: en_US.UTF-8
  UNICORN_WORKERS: 4
  DISCOURSE_DEVELOPER_EMAILS: 'xxx@xxx.xxx'
  DISCOURSE_DB_SOCKET: ''
  DISCOURSE_DB_PASSWORD: xxxx
  DISCOURSE_DB_HOST: xxx
  DISCOURSE_HOSTNAME: 'site1.domain.com'
  DISCOURSE_REDIS_HOST: xxxxxxxx
  # don't forget to set mail
  DISCOURSE_SMTP_ADDRESS: smtp.mandrillapp.com
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: xxx@xxx.xxx
  DISCOURSE_SMTP_PASSWORD: xxxxxxxxxxxxxxxxx
volumes:
  - volume:
        host: /var/docker/shared
        guest: /shared
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
hooks:
  after_code:
    - file:
        path: /var/www/discourse/config/multisite.yml
        contents: |
         secondsite:
           adapter: postgresql
           host: xxxxxxxxxxxx
           database: b_discourse
           username: discourse
           password: xxxxxxxxxx
           pool: 25
           timeout: 5000
           db_id: 2
           host_names:
             - site2.domain.com

         thirdsite:
           adapter: postgresql
           host: xxxxxxxxxx
           database: c_discourse
           username: discourse
           password: xxxxxxxxxxx
           pool: 25
           timeout: 5000
           db_id: 3
           host_names:
              - site3.domain2.com
    - exec:
        cd: /var/www/discourse/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
  after_web:
    - exec: cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate
run:
  - exec: echo "Beginning of custom commands"

  - exec: echo "End of custom commands"
  - exec: awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print "Authorized SSH keys for this container:"; } NF>=2 {print $NF;}'

data.yml

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/sshd.template.yml"

expose:
  - "5432:5432"
  - "6379:6379"
  - "2221:22"

params:
  db_default_text_search_config: "pg_catalog.english"
env:
  LANG: en_US.UTF-8
hooks:
  after_postgres:
    - exec:
        stdin: |
          alter user discourse with password 'xxxxx';
        cmd: sudo -u postgres psql discourse
        raise_on_fail: false
volumes:
  - volume:
        host: /var/docker/shared
        guest: /shared

hooks:
  after_postgres:
     - exec: sudo -u postgres createdb b_discourse || exit 0
     - exec:
          stdin: |
            grant all privileges on database b_discourse to discourse;
          cmd: sudo -u postgres psql b_discourse
          raise_on_fail: false

     - exec: /bin/bash -c 'sudo -u postgres psql b_discourse <<< "alter schema public owner to discourse;"'
     - exec: /bin/bash -c 'sudo -u postgres psql b_discourse <<< "create extension if not exists hstore;"'
     - exec: /bin/bash -c 'sudo -u postgres psql b_discourse <<< "create extension if not exists pg_trgm;"'
hooks:
   after_postgres:
     - exec: sudo -u postgres createdb c_discourse || exit 0
     - exec:
           stdin: |
             grant all privileges on database c_discourse to discourse;
           cmd: sudo -u postgres psql c_discourse
           raise_on_fail: false

     - exec: /bin/bash -c 'sudo -u postgres psql c_discourse <<< "alter schema public owner to discourse;"'
     - exec: /bin/bash -c 'sudo -u postgres psql c_discourse <<< "create extension if not exists hstore;"'
     - exec: /bin/bash -c 'sudo -u postgres psql c_discourse <<< "create extension if not exists pg_trgm;"'

#2

:slight_smile: no reply. Any way I managed to fix it and here are the steps I followed if it helps any one here