Skip to content

Instantly share code, notes, and snippets.

@vshvedov
Created June 25, 2015 12:27
Show Gist options
  • Save vshvedov/544ad5e35514facf1903 to your computer and use it in GitHub Desktop.
Save vshvedov/544ad5e35514facf1903 to your computer and use it in GitHub Desktop.
cd /pups && git pull && /pups/bin/pups --stdin
Already up-to-date.
I, [2015-06-25T12:13:26.532815 #36] INFO -- : Loading --stdin
I, [2015-06-25T12:13:26.538863 #36] INFO -- : > mkdir -p /shared/postgres_run
I, [2015-06-25T12:13:26.541025 #36] INFO -- :
I, [2015-06-25T12:13:26.541511 #36] INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2015-06-25T12:13:26.543761 #36] INFO -- :
I, [2015-06-25T12:13:26.544237 #36] INFO -- : > chmod 775 /shared/postgres_run
I, [2015-06-25T12:13:26.546100 #36] INFO -- :
I, [2015-06-25T12:13:26.546574 #36] INFO -- : > rm -fr /var/run/postgresql
I, [2015-06-25T12:13:26.548545 #36] INFO -- :
I, [2015-06-25T12:13:26.549021 #36] INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2015-06-25T12:13:26.550861 #36] INFO -- :
I, [2015-06-25T12:13:26.551331 #36] INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2015/06/25 12:13:26 socat[44] E connect(4, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): No such file or directory
I, [2015-06-25T12:13:26.554431 #36] INFO -- :
I, [2015-06-25T12:13:26.554936 #36] INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2015-06-25T12:13:26.557375 #36] INFO -- :
I, [2015-06-25T12:13:26.558106 #36] INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2015-06-25T12:13:26.560777 #36] INFO -- :
I, [2015-06-25T12:13:26.561524 #36] INFO -- : > mkdir -p /shared/postgres_run/9.3-main.pg_stat_tmp
I, [2015-06-25T12:13:26.563430 #36] INFO -- :
I, [2015-06-25T12:13:26.564120 #36] INFO -- : > chown postgres:postgres /shared/postgres_run/9.3-main.pg_stat_tmp
I, [2015-06-25T12:13:26.566079 #36] INFO -- :
I, [2015-06-25T12:13:26.570736 #36] INFO -- : File > /etc/service/postgres/run chmod: +x
I, [2015-06-25T12:13:26.575190 #36] INFO -- : File > /etc/runit/3.d/99-postgres chmod: +x
I, [2015-06-25T12:13:26.579730 #36] INFO -- : File > /root/upgrade_postgres chmod: +x
I, [2015-06-25T12:13:26.581531 #36] INFO -- : > chown -R root /var/lib/postgresql/9.3/main
I, [2015-06-25T12:13:26.586083 #36] INFO -- :
I, [2015-06-25T12:13:26.586195 #36] INFO -- : > [ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/9.3/bin/initdb -D /shared/postgres_data || exit 0
initdb: could not create directory "/shared/postgres_data/global": No space left on device
initdb: removing contents of data directory "/shared/postgres_data"
I, [2015-06-25T12:13:26.599424 #36] INFO -- : The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /shared/postgres_data ... ok
creating subdirectories ...
I, [2015-06-25T12:13:26.599554 #36] INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2015-06-25T12:13:26.601493 #36] INFO -- :
I, [2015-06-25T12:13:26.601593 #36] INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2015-06-25T12:13:26.603351 #36] INFO -- :
I, [2015-06-25T12:13:26.603954 #36] INFO -- : > /root/upgrade_postgres
cat: /shared/postgres_data/PG_VERSION: No such file or directory
/root/upgrade_postgres: line 2: [: 9.2: unary operator expected
I, [2015-06-25T12:13:26.608057 #36] INFO -- :
I, [2015-06-25T12:13:26.608601 #36] INFO -- : > rm /root/upgrade_postgres
I, [2015-06-25T12:13:26.610149 #36] INFO -- :
I, [2015-06-25T12:13:26.610384 #36] 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-06-25T12:13:26.611576 #36] INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:13:26.612245 #36] INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:13:26.612922 #36] INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:13:26.613599 #36] INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:13:26.614255 #36] 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-06-25T12:13:26.615270 #36] INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2015-06-25T12:13:26.617420 #36] INFO -- :
I, [2015-06-25T12:13:26.617626 #36] INFO -- : Replacing (?-mix:#?max_wal_senders *=.*) with max_wal_senders = $db_max_wal_senders in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:13:26.618283 #36] INFO -- : Replacing (?-mix:#?wal_level *=.*) with wal_level = $db_wal_level in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:13:26.618939 #36] INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:13:26.619556 #36] INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:13:26.620172 #36] 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-06-25T12:13:26.620856 #36] INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres peer in /etc/postgresql/9.3/main/pg_hba.conf
I, [2015-06-25T12:13:26.621474 #36] 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-06-25T12:13:26.622384 #36] 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
2015-06-25 12:13:26 UTC [70-1] FATAL: "/shared/postgres_data" is not a valid data directory
2015-06-25 12:13:26 UTC [70-2] DETAIL: File "/shared/postgres_data/PG_VERSION" is missing.
I, [2015-06-25T12:13:26.631998 #36] INFO -- : > sleep 5
I, [2015-06-25T12:13:31.633795 #36] INFO -- :
I, [2015-06-25T12:13:31.634817 #36] 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-06-25T12:13:31.691604 #36] INFO -- :
I, [2015-06-25T12:13:31.692443 #36] 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-06-25T12:13:31.746300 #36] INFO -- :
I, [2015-06-25T12:13:31.747036 #36] 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-06-25T12:13:31.794751 #36] INFO -- :
I, [2015-06-25T12:13:31.795418 #36] 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-06-25T12:13:31.838761 #36] INFO -- :
I, [2015-06-25T12:13:31.839009 #36] INFO -- : Terminating async processes
FAILED
--------------------
RuntimeError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return #<Process::Status: pid 96 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;\"'"
ad95f9a27eea6b37df2053a9f21f1cab05cfbb41269bc7a7617ae173456ccd20
FAILED TO BOOTSTRAP
root@ns398553:/var/discourse# nano /etc/default/docker
root@ns398553:/var/discourse# service docker restart
docker stop/waiting
docker start/running, process 10689
root@ns398553:/var/discourse# ./launcher bootstrap app
cd /pups && git pull && /pups/bin/pups --stdin
Already up-to-date.
I, [2015-06-25T12:20:21.159495 #36] INFO -- : Loading --stdin
I, [2015-06-25T12:20:21.166042 #36] INFO -- : > mkdir -p /shared/postgres_run
I, [2015-06-25T12:20:21.167897 #36] INFO -- :
I, [2015-06-25T12:20:21.168417 #36] INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2015-06-25T12:20:21.170662 #36] INFO -- :
I, [2015-06-25T12:20:21.171155 #36] INFO -- : > chmod 775 /shared/postgres_run
I, [2015-06-25T12:20:21.173012 #36] INFO -- :
I, [2015-06-25T12:20:21.173502 #36] INFO -- : > rm -fr /var/run/postgresql
I, [2015-06-25T12:20:21.175442 #36] INFO -- :
I, [2015-06-25T12:20:21.175935 #36] INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2015-06-25T12:20:21.177757 #36] INFO -- :
I, [2015-06-25T12:20:21.178251 #36] INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2015/06/25 12:20:21 socat[44] E connect(4, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): No such file or directory
I, [2015-06-25T12:20:21.181427 #36] INFO -- :
I, [2015-06-25T12:20:21.181889 #36] INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2015-06-25T12:20:21.184277 #36] INFO -- :
I, [2015-06-25T12:20:21.184716 #36] INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2015-06-25T12:20:21.187106 #36] INFO -- :
I, [2015-06-25T12:20:21.187547 #36] INFO -- : > mkdir -p /shared/postgres_run/9.3-main.pg_stat_tmp
I, [2015-06-25T12:20:21.189430 #36] INFO -- :
I, [2015-06-25T12:20:21.189890 #36] INFO -- : > chown postgres:postgres /shared/postgres_run/9.3-main.pg_stat_tmp
I, [2015-06-25T12:20:21.191913 #36] INFO -- :
I, [2015-06-25T12:20:21.196292 #36] INFO -- : File > /etc/service/postgres/run chmod: +x
I, [2015-06-25T12:20:21.200526 #36] INFO -- : File > /etc/runit/3.d/99-postgres chmod: +x
I, [2015-06-25T12:20:21.204792 #36] INFO -- : File > /root/upgrade_postgres chmod: +x
I, [2015-06-25T12:20:21.206205 #36] INFO -- : > chown -R root /var/lib/postgresql/9.3/main
I, [2015-06-25T12:20:21.211162 #36] INFO -- :
I, [2015-06-25T12:20:21.211259 #36] INFO -- : > [ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/9.3/bin/initdb -D /shared/postgres_data || exit 0
I, [2015-06-25T12:20:21.213003 #36] INFO -- :
I, [2015-06-25T12:20:21.213110 #36] INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2015-06-25T12:20:21.215129 #36] INFO -- :
I, [2015-06-25T12:20:21.215225 #36] INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2015-06-25T12:20:21.217113 #36] INFO -- :
I, [2015-06-25T12:20:21.217687 #36] INFO -- : > /root/upgrade_postgres
cat: /shared/postgres_data/PG_VERSION: No such file or directory
/root/upgrade_postgres: line 2: [: 9.2: unary operator expected
I, [2015-06-25T12:20:21.222090 #36] INFO -- :
I, [2015-06-25T12:20:21.222562 #36] INFO -- : > rm /root/upgrade_postgres
I, [2015-06-25T12:20:21.224150 #36] INFO -- :
I, [2015-06-25T12:20:21.224355 #36] 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-06-25T12:20:21.225463 #36] INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:20:21.226074 #36] INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:20:21.226712 #36] INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:20:21.227322 #36] INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:20:21.227880 #36] 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-06-25T12:20:21.228760 #36] INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2015-06-25T12:20:21.231338 #36] INFO -- :
I, [2015-06-25T12:20:21.231550 #36] INFO -- : Replacing (?-mix:#?max_wal_senders *=.*) with max_wal_senders = $db_max_wal_senders in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:20:21.232090 #36] INFO -- : Replacing (?-mix:#?wal_level *=.*) with wal_level = $db_wal_level in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:20:21.232785 #36] INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:20:21.233408 #36] INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-06-25T12:20:21.234021 #36] 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-06-25T12:20:21.234570 #36] INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres peer in /etc/postgresql/9.3/main/pg_hba.conf
I, [2015-06-25T12:20:21.235111 #36] 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-06-25T12:20:21.235921 #36] 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
2015-06-25 12:20:21 UTC [65-1] FATAL: "/shared/postgres_data" is not a valid data directory
2015-06-25 12:20:21 UTC [65-2] DETAIL: File "/shared/postgres_data/PG_VERSION" is missing.
I, [2015-06-25T12:20:21.244616 #36] INFO -- : > sleep 5
I, [2015-06-25T12:20:26.246195 #36] INFO -- :
I, [2015-06-25T12:20:26.247217 #36] 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-06-25T12:20:26.303952 #36] INFO -- :
I, [2015-06-25T12:20:26.304836 #36] 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-06-25T12:20:26.358839 #36] INFO -- :
I, [2015-06-25T12:20:26.359564 #36] 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-06-25T12:20:26.406220 #36] INFO -- :
I, [2015-06-25T12:20:26.406846 #36] 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-06-25T12:20:26.448677 #36] INFO -- :
I, [2015-06-25T12:20:26.448923 #36] INFO -- : Terminating async processes
FAILED
--------------------
RuntimeError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return #<Process::Status: pid 91 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;\"'"
19606b3ff5dd930ce8e83e3b49cc6e2593cdb3c27a4857c3d4acfe49fc6d35d2
FAILED TO BOOTSTRAP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment