Because my Discourse gave me notice to git pull
and rebuild the app to get the most recent updates, I’ve been attempting to do so, but rebuilding seems to take my site offline. I’m not sure why, because I don’t see any obvious problems in the rebuilding process. Here’s what I see when I rebuild… Any thoughts about what might be going wrong?
me@me:~# cd /var/discourse
me@me:/var/discourse# git pull
remote: Counting objects: 226, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 226 (delta 98), reused 102 (delta 98), pack-reused 121
Receiving objects: 100% (226/226), 47.55 KiB | 0 bytes/s, done.
Resolving deltas: 100% (155/155), completed with 35 local objects.
From https://github.com/discourse/discourse_docker
350cc62..9291792 master -> origin/master
Updating 350cc62..9291792
Fast-forward
.gitignore | 1 +
README.md | 16 +++++++++++--
Vagrantfile | 15 +++++++-----
discourse-setup | 199 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------------
image/auto_build.rb | 5 ++--
image/base/.gitignore | 1 -
image/base/Dockerfile | 16 ++++---------
image/base/download_phantomjs | 3 ---
image/base/install-nginx | 2 +-
image/base/rb_thread_fd_close.patch | 15 ------------
image/base/runit-1.d-00-fix-var-logs | 2 ++
image/build.rb | 1 -
image/discourse_bench/Dockerfile | 2 +-
image/discourse_dev/Dockerfile | 11 ++++++++-
image/discourse_fast_switch/Dockerfile | 2 +-
image/discourse_fast_switch/create_switch.rb | 2 +-
image/discourse_test/Dockerfile | 12 ++++++++--
image/monitor/Dockerfile | 2 +-
launcher | 40 ++++++++++++++++---------------
samples/data.yml | 10 +++-----
samples/web_only.yml | 61 +++++++++++++++++++++++++++-------------------
templates/import/mbox.template.yml | 48 +++++++++++++++++++++++++++++++++++++
templates/postgres.10.template.yml | 175 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
templates/postgres.template.yml | 8 ++++++-
templates/redis.template.yml | 8 ++++++-
templates/web.letsencrypt.ssl.template.yml | 2 +-
templates/web.ssl.template.yml | 2 +-
templates/web.template.yml | 22 +++++++++++++----
28 files changed, 504 insertions(+), 179 deletions(-)
delete mode 100644 image/base/.gitignore
delete mode 100755 image/base/download_phantomjs
delete mode 100644 image/base/rb_thread_fd_close.patch
create mode 100644 templates/import/mbox.template.yml
create mode 100644 templates/postgres.10.template.yml
me@me:/var/discourse# ./launcher rebuild app
WARNING: Docker version 17.05.0-ce deprecated, recommend upgrade to 17.06.2 or newer.
WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed
Please be patient
Unable to find image 'discourse/base:2.0.20171231' locally
2.0.20171231: Pulling from discourse/base
50aff78429b1: Pulling fs layer
f6d82e297bce: Pulling fs layer
275abb2c8a6f: Pulling fs layer
9f15a39356d6: Pulling fs layer
fc0342a94c89: Pulling fs layer
35787b1294ac: Pulling fs layer
9f15a39356d6: Waiting
fc0342a94c89: Waiting
35787b1294ac: Waiting
275abb2c8a6f: Verifying Checksum
275abb2c8a6f: Download complete
f6d82e297bce: Verifying Checksum
f6d82e297bce: Download complete
fc0342a94c89: Verifying Checksum
fc0342a94c89: Download complete
9f15a39356d6: Verifying Checksum
9f15a39356d6: Download complete
50aff78429b1: Verifying Checksum
50aff78429b1: Download complete
50aff78429b1: Pull complete
f6d82e297bce: Pull complete
275abb2c8a6f: Pull complete
9f15a39356d6: Pull complete
fc0342a94c89: Pull complete
35787b1294ac: Verifying Checksum
35787b1294ac: Download complete
35787b1294ac: Pull complete
Digest: sha256:5452defe724d2940ae2fd11ec690fbcd1d49cf7607ca9044502f2817c0f76647
Status: Downloaded newer image for discourse/base:2.0.20171231
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 10 app
app
cd /pups && git pull && /pups/bin/pups --stdin
Already up-to-date.
I, [2018-04-01T05:10:54.942391 #13] INFO -- : Loading --stdin
I, [2018-04-01T05:10:54.952542 #13] INFO -- : > mkdir -p /shared/postgres_run
I, [2018-04-01T05:10:54.959620 #13] INFO -- :
I, [2018-04-01T05:10:54.960588 #13] INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2018-04-01T05:10:54.964199 #13] INFO -- :
I, [2018-04-01T05:10:54.964997 #13] INFO -- : > chmod 775 /shared/postgres_run
I, [2018-04-01T05:10:54.967599 #13] INFO -- :
I, [2018-04-01T05:10:54.968244 #13] INFO -- : > rm -fr /var/run/postgresql
I, [2018-04-01T05:10:54.971168 #13] INFO -- :
I, [2018-04-01T05:10:54.971899 #13] INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2018-04-01T05:10:54.974469 #13] INFO -- :
I, [2018-04-01T05:10:54.975091 #13] INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2018/04/01 05:10:54 socat[21] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): No such file or directory
I, [2018-04-01T05:10:54.982479 #13] INFO -- :
I, [2018-04-01T05:10:54.983044 #13] INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2018-04-01T05:10:54.986313 #13] INFO -- :
I, [2018-04-01T05:10:54.986865 #13] INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2018-04-01T05:10:54.989894 #13] INFO -- :
I, [2018-04-01T05:10:54.990439 #13] INFO -- : > mkdir -p /shared/postgres_run/9.5-main.pg_stat_tmp
I, [2018-04-01T05:10:54.992973 #13] INFO -- :
I, [2018-04-01T05:10:54.993637 #13] INFO -- : > chown postgres:postgres /shared/postgres_run/9.5-main.pg_stat_tmp
I, [2018-04-01T05:10:54.996370 #13] INFO -- :
I, [2018-04-01T05:10:55.001625 #13] INFO -- : File > /etc/service/postgres/run chmod: +x
I, [2018-04-01T05:10:55.006537 #13] INFO -- : File > /etc/service/postgres/log/run chmod: +x
I, [2018-04-01T05:10:55.011732 #13] INFO -- : File > /etc/runit/3.d/99-postgres chmod: +x
I, [2018-04-01T05:10:55.016554 #13] INFO -- : File > /root/upgrade_postgres chmod: +x
I, [2018-04-01T05:10:55.017303 #13] INFO -- : > chown -R root /var/lib/postgresql/9.5/main
I, [2018-04-01T05:10:55.237527 #13] INFO -- :
I, [2018-04-01T05:10:55.237972 #13] INFO -- : > [ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/9.5/bin/initdb -D /shared/postgres_data || exit 0
I, [2018-04-01T05:10:55.241156 #13] INFO -- :
I, [2018-04-01T05:10:55.241685 #13] INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2018-04-01T05:10:55.282583 #13] INFO -- :
I, [2018-04-01T05:10:55.283639 #13] INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2018-04-01T05:10:55.287077 #13] INFO -- :
I, [2018-04-01T05:10:55.287950 #13] INFO -- : > /root/upgrade_postgres
I, [2018-04-01T05:10:55.294328 #13] INFO -- :
I, [2018-04-01T05:10:55.295154 #13] INFO -- : > rm /root/upgrade_postgres
I, [2018-04-01T05:10:55.297868 #13] INFO -- :
I, [2018-04-01T05:10:55.299166 #13] INFO -- : Replacing data_directory = '/var/lib/postgresql/9.5/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/9.5/main/postgresql.conf
I, [2018-04-01T05:10:55.300311 #13] INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/9.5/main/postgresql.conf
I, [2018-04-01T05:10:55.301160 #13] INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/9.5/main/postgresql.conf
I, [2018-04-01T05:10:55.301990 #13] INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/9.5/main/postgresql.conf
I, [2018-04-01T05:10:55.302774 #13] INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/9.5/main/postgresql.conf
I, [2018-04-01T05:10:55.303635 #13] INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/9.5/main/postgresql.conf
I, [2018-04-01T05:10:55.304388 #13] INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2018-04-01T05:10:55.309999 #13] INFO -- :
I, [2018-04-01T05:10:55.311048 #13] INFO -- : Replacing (?-mix:#?max_wal_senders *=.*) with max_wal_senders = $db_max_wal_senders in /etc/postgresql/9.5/main/postgresql.conf
I, [2018-04-01T05:10:55.311976 #13] INFO -- : Replacing (?-mix:#?wal_level *=.*) with wal_level = $db_wal_level in /etc/postgresql/9.5/main/postgresql.conf
I, [2018-04-01T05:10:55.312939 #13] INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/9.5/main/postgresql.conf
I, [2018-04-01T05:10:55.313824 #13] INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/9.5/main/postgresql.conf
I, [2018-04-01T05:10:55.314689 #13] INFO -- : Replacing (?-mix:#?log_min_duration_statement *=.*) with log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/9.5/main/postgresql.conf
I, [2018-04-01T05:10:55.315776 #13] INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres peer in /etc/postgresql/9.5/main/pg_hba.conf
I, [2018-04-01T05:10:55.316672 #13] INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/9.5/main/pg_hba.conf
I, [2018-04-01T05:10:55.317398 #13] INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.5/bin/postmaster -D /etc/postgresql/9.5/main
I, [2018-04-01T05:10:55.319650 #13] INFO -- : > sleep 5
2018-04-01 05:10:55.379 UTC [47] LOG: database system was shut down at 2018-04-01 05:10:47 UTC
2018-04-01 05:10:55.383 UTC [47] LOG: MultiXact member wraparound protections are now enabled
2018-04-01 05:10:55.387 UTC [44] LOG: database system is ready to accept connections
2018-04-01 05:10:55.389 UTC [51] LOG: autovacuum launcher started
I, [2018-04-01T05:11:00.325233 #13] INFO -- :
I, [2018-04-01T05:11:00.325711 #13] INFO -- : > su postgres -c 'createdb discourse' || true
2018-04-01 05:11:00.452 UTC [56] postgres@postgres ERROR: database "discourse" already exists
2018-04-01 05:11:00.452 UTC [56] postgres@postgres STATEMENT: CREATE DATABASE discourse;
createdb: database creation failed: ERROR: database "discourse" already exists
I, [2018-04-01T05:11:00.455715 #13] INFO -- :
I, [2018-04-01T05:11:00.456345 #13] INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2018-04-01 05:11:00.565 UTC [67] postgres@discourse ERROR: role "discourse" already exists
2018-04-01 05:11:00.565 UTC [67] postgres@discourse STATEMENT: create user discourse;
ERROR: role "discourse" already exists
I, [2018-04-01T05:11:00.568728 #13] INFO -- :
I, [2018-04-01T05:11:00.569341 #13] INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
I, [2018-04-01T05:11:00.649665 #13] INFO -- : GRANT
I, [2018-04-01T05:11:00.651489 #13] INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
I, [2018-04-01T05:11:00.732381 #13] INFO -- : ALTER SCHEMA
I, [2018-04-01T05:11:00.733202 #13] INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists hstore;"'
NOTICE: extension "hstore" already exists, skipping
I, [2018-04-01T05:11:00.817014 #13] INFO -- : CREATE EXTENSION
I, [2018-04-01T05:11:00.817643 #13] INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists pg_trgm;"'
NOTICE: extension "pg_trgm" already exists, skipping
I, [2018-04-01T05:11:00.899389 #13] INFO -- : CREATE EXTENSION
I, [2018-04-01T05:11:00.900043 #13] INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists hstore;"'
NOTICE: extension "hstore" already exists, skipping
I, [2018-04-01T05:11:00.984131 #13] INFO -- : CREATE EXTENSION
I, [2018-04-01T05:11:00.984810 #13] INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists pg_trgm;"'
NOTICE: extension "pg_trgm" already exists, skipping
I, [2018-04-01T05:11:01.065210 #13] INFO -- : CREATE EXTENSION
I, [2018-04-01T05:11:01.065891 #13] INFO -- : > sudo -u postgres psql discourse
I, [2018-04-01T05:11:01.069873 #13] INFO -- : update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = 'discourse' AND encoding = pg_char_to_encoding('SQL_ASCII');
I, [2018-04-01T05:11:01.164184 #13] INFO -- : File > /var/lib/postgresql/take-database-backup chmod: +x
I, [2018-04-01T05:11:01.168170 #13] INFO -- : File > /var/spool/cron/crontabs/postgres chmod:
I, [2018-04-01T05:11:01.168830 #13] INFO -- : > echo postgres installed!
I, [2018-04-01T05:11:01.171428 #13] INFO -- : postgres installed!
I, [2018-04-01T05:11:01.175972 #13] INFO -- : File > /etc/service/redis/run chmod: +x
I, [2018-04-01T05:11:01.180347 #13] INFO -- : File > /etc/service/redis/log/run chmod: +x
I, [2018-04-01T05:11:01.184687 #13] INFO -- : File > /etc/runit/3.d/10-redis chmod: +x
I, [2018-04-01T05:11:01.185651 #13] INFO -- : Replacing daemonize yes with in /etc/redis/redis.conf
I, [2018-04-01T05:11:01.186614 #13] INFO -- : Replacing (?-mix:^pidfile.*$) with in /etc/redis/redis.conf
I, [2018-04-01T05:11:01.190816 #13] INFO -- : > install -d -m 0755 -o redis -g redis /shared/redis_data
I, [2018-04-01T05:11:01.194130 #13] INFO -- :
I, [2018-04-01T05:11:01.194881 #13] INFO -- : Replacing (?-mix:^logfile.*$) with logfile "" in /etc/redis/redis.conf
I, [2018-04-01T05:11:01.195695 #13] INFO -- : Replacing (?-mix:^bind .*$) with in /etc/redis/redis.conf
I, [2018-04-01T05:11:01.196497 #13] INFO -- : Replacing (?-mix:^dir .*$) with dir /shared/redis_data in /etc/redis/redis.conf
I, [2018-04-01T05:11:01.197237 #13] INFO -- : > echo redis installed
I, [2018-04-01T05:11:01.199243 #13] INFO -- : redis installed
I, [2018-04-01T05:11:01.199887 #13] INFO -- : > cat /etc/redis/redis.conf | grep logfile
I, [2018-04-01T05:11:01.204778 #13] INFO -- : logfile ""
I, [2018-04-01T05:11:01.205323 #13] INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2018-04-01T05:11:01.206939 #13] INFO -- : > sleep 10
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.0.6 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 159
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
159:M 01 Apr 05:11:01.216 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
159:M 01 Apr 05:11:01.217 # Server started, Redis version 3.0.6
159:M 01 Apr 05:11:01.217 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
159:M 01 Apr 05:11:01.217 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
159:M 01 Apr 05:11:01.351 * DB loaded from disk: 0.134 seconds
159:M 01 Apr 05:11:01.352 * The server is now ready to accept connections on port 6379
…
I, [2018-04-01T05:18:46.818127 #13] INFO -- : Terminating async processes
I, [2018-04-01T05:18:46.819061 #13] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.5/bin/postmaster -D /etc/postgresql/9.5/main pid: 44
2018-04-01 05:18:46.819 UTC [44] LOG: received fast shutdown request
2018-04-01 05:18:46.820 UTC [44] LOG: aborting any active transactions
I, [2018-04-01T05:18:46.820892 #13] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 159
159:signal-handler (1522559926) Received SIGTERM scheduling shutdown...
2018-04-01 05:18:46.821 UTC [51] LOG: autovacuum launcher shutting down
2018-04-01 05:18:46.829 UTC [48] LOG: shutting down
2018-04-01 05:18:46.847 UTC [48] LOG: database system is shut down
159:M 01 Apr 05:18:46.912 # User requested shutdown...
159:M 01 Apr 05:18:46.913 * Saving the final RDB snapshot before exiting.
159:M 01 Apr 05:18:47.090 * DB saved on disk
159:M 01 Apr 05:18:47.090 # Redis is now ready to exit, bye bye...
sha256:308ba7f73663b521567f5d00a2f784d49d02d22fc7c92fb2a5eb5fa4ff2ed005
a0fd20a59915456f291ee0519e6ed3508157e9b42ac15d27ca568ba384dce369
Removing old container
+ /usr/bin/docker rm app
app
+ /usr/bin/docker run -d --restart=always -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=2 -e UNICORN_SIDEKIQS=1 -e RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 -e RUBY_GC_HEAP_GROWTH_MAX_SLOTS=40000 -e RUBY_GC_HEAP_INIT_SLOTS=400000 -e RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.5 -e DISCOURSE_DB_SOCKET=/var/run/postgresql -e DISCOURSE_DB_HOST= -e DISCOURSE_DB_PORT= -e LETSENCRYPT_DIR=/shared/letsencrypt -e DISCOURSE_HOSTNAME=[MYADDRESS] -e DISCOURSE_ONION=[ONION SITE] -e DISCOURSE_DEVELOPER_EMAILS=[MYEMAIL] -e DISCOURSE_SMTP_ADDRESS=[MY MAILSERVER] -e DISCOURSE_SMTP_PORT=587 -e DISCOURSE_SMTP_USER_NAME=[SMTPUSERNAME -e DISCOURSE_SMTP_PASSWORD=PASSWORD -e LETSENCRYPT_ACCOUNT_EMAIL=ACCOUNTEMAIL -h an-app -e DOCKER_HOST_IP=172.17.0.1 --name app -t -p 80:80 -p 443:443 -v /var/discourse/shared/standalone:/shared -v /var/discourse/shared/standalone/log/var-log:/var/log --mac-address [MAC ADDRESS] local_discourse/app /sbin/boot
d0a8d2b49c0a93462b359778e5335b5f04681032de0bb52686c86856ba312054