Discourse Docker Image version 1.3.3, released


(Kevin McKinney) #126

I rebooted the host a few times, updated software packages, tried the update again, and… this time it succeeded. Did not hang on the docker stop command, successfully updated to version 1.3.3 of the image. Yay! Thanks to @codinghorror and @Falco for weighing in. I appreciate your help!


(Alan Tan) split this topic #127

3 posts were merged into an existing topic: Blank Page after Upgrading


Blank Page after Upgrading due to old Tagging Plugin
#128

Following successful completion of the upgrade is it safe to remove the postgres_data_old folder?


(Sam Saffron) #129

Sure, go for it! No need to keep it around.


(eriko) #130

So I never did hear what effect running a two container multisite setup would have on this?


(ljpp) #131

@sam, so the error notification about Ruby settings (garbage collector) on the admin panel is a UI-only issue and can be ignored for now? Been reading this thread back and forth, but did not spot if this has been confirmed yet.


(Sam Saffron) #132

Yes, a UI issue that is only in our stable branch, fixed in latest


(ampburner) #133

Dumb question, but I am literally following the steps listed in my console (doing a 1.5.2 => 1.5.3 upgrade)

After

When your instance is running: Run ./launcher enter app Run cd /shared/postgres_backup && sudo -u postgres pg_dump discourse > backup.db

It tells me to

Undo the base_image and postgres template from your container config
Run: ./launcher stop app

but I can’t, it says: bash: ./launcher no such file or directory

I’m guessing I need to “exit the app” first? or whatever the reverse of “enter the app” is? :wink:
what do I do next?


(Felix Freiberger) #134

Yes, this should be running from the outside. exit will quit the bash inside the container and kick you out :slight_smile:


(ampburner) #135

thanks, I figured that part out.

Also Had to clean up some disk space before I could rebuild the app.

now I’m at the final step, and it’s failing to import the backup of my discourse database.

It seems my postgres database is no longer responding.

I have no idea what to do
:tired_face:

@sam any ideas?


(Roberto_Pezzali) #136

I have a similar issue

scriptamanent@ddayforum:/var/discourse$ sudo ./launcher rebuild app
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, [2016-06-29T15:12:13.982225 #15]  INFO -- : Loading --stdin
I, [2016-06-29T15:12:13.989848 #15]  INFO -- : > mkdir -p /shared/postgres_run
I, [2016-06-29T15:12:13.994637 #15]  INFO -- :
I, [2016-06-29T15:12:13.994976 #15]  INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2016-06-29T15:12:13.999197 #15]  INFO -- :
I, [2016-06-29T15:12:13.999630 #15]  INFO -- : > chmod 775 /shared/postgres_run
I, [2016-06-29T15:12:14.004372 #15]  INFO -- :
I, [2016-06-29T15:12:14.004725 #15]  INFO -- : > rm -fr /var/run/postgresql
I, [2016-06-29T15:12:14.010294 #15]  INFO -- :
I, [2016-06-29T15:12:14.010685 #15]  INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2016-06-29T15:12:14.015640 #15]  INFO -- :
I, [2016-06-29T15:12:14.016007 #15]  INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2016/06/29 15:12:14 socat[23] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): Connection refused
I, [2016-06-29T15:12:14.062642 #15]  INFO -- :
I, [2016-06-29T15:12:14.062859 #15]  INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2016-06-29T15:12:14.068272 #15]  INFO -- :
I, [2016-06-29T15:12:14.068513 #15]  INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2016-06-29T15:12:14.073671 #15]  INFO -- :
I, [2016-06-29T15:12:14.073891 #15]  INFO -- : > mkdir -p /shared/postgres_run/9.5-main.pg_stat_tmp
I, [2016-06-29T15:12:14.078017 #15]  INFO -- :
I, [2016-06-29T15:12:14.078559 #15]  INFO -- : > chown postgres:postgres /shared/postgres_run/9.5-main.pg_stat_tmp
I, [2016-06-29T15:12:14.083245 #15]  INFO -- :
I, [2016-06-29T15:12:14.093062 #15]  INFO -- : File > /etc/service/postgres/run  chmod: +x
I, [2016-06-29T15:12:14.107051 #15]  INFO -- : File > /etc/runit/3.d/99-postgres  chmod: +x
I, [2016-06-29T15:12:14.121312 #15]  INFO -- : File > /root/upgrade_postgres  chmod: +x
I, [2016-06-29T15:12:14.121994 #15]  INFO -- : > chown -R root /var/lib/postgresql/9.5/main
I, [2016-06-29T15:12:14.256224 #15]  INFO -- :
I, [2016-06-29T15:12:14.256659 #15]  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, [2016-06-29T15:12:14.263167 #15]  INFO -- :
I, [2016-06-29T15:12:14.263326 #15]  INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2016-06-29T15:12:14.282958 #15]  INFO -- :
I, [2016-06-29T15:12:14.283164 #15]  INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2016-06-29T15:12:14.287823 #15]  INFO -- :
I, [2016-06-29T15:12:14.288144 #15]  INFO -- : > /root/upgrade_postgres
I, [2016-06-29T15:12:14.296718 #15]  INFO -- :
I, [2016-06-29T15:12:14.297003 #15]  INFO -- : > rm /root/upgrade_postgres
I, [2016-06-29T15:12:14.300948 #15]  INFO -- :
I, [2016-06-29T15:12:14.301318 #15]  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, [2016-06-29T15:12:14.302005 #15]  INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-06-29T15:12:14.303631 #15]  INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-06-29T15:12:14.304182 #15]  INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-06-29T15:12:14.304774 #15]  INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-06-29T15:12:14.305613 #15]  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, [2016-06-29T15:12:14.306191 #15]  INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2016-06-29T15:12:14.315004 #15]  INFO -- :
I, [2016-06-29T15:12:14.315949 #15]  INFO -- : Replacing (?-mix:#?max_wal_senders *=.*) with max_wal_senders = $db_max_wal_senders in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-06-29T15:12:14.316637 #15]  INFO -- : Replacing (?-mix:#?wal_level *=.*) with wal_level = $db_wal_level in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-06-29T15:12:14.317374 #15]  INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-06-29T15:12:14.318063 #15]  INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-06-29T15:12:14.318942 #15]  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, [2016-06-29T15:12:14.319570 #15]  INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres  peer in /etc/postgresql/9.5/main/pg_hba.conf
I, [2016-06-29T15:12:14.320146 #15]  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, [2016-06-29T15:12:14.320819 #15]  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, [2016-06-29T15:12:14.326856 #15]  INFO -- : > sleep 5
2016-06-29 15:12:14 UTC [47-1] LOG:  database system shutdown was interrupted; last known up at 2016-06-29 15:06:23 UTC
2016-06-29 15:12:14 UTC [47-2] LOG:  database system was not properly shut down; automatic recovery in progress
2016-06-29 15:12:14 UTC [47-3] LOG:  redo starts at 26/454B5740
2016-06-29 15:12:16 UTC [47-4] LOG:  unexpected pageaddr 26/149E6000 in log segment 000000010000002600000060, offset 10379264
2016-06-29 15:12:16 UTC [47-5] LOG:  redo done at 26/609E4C40
I, [2016-06-29T15:12:19.334134 #15]  INFO -- :
I, [2016-06-29T15:12:19.334676 #15]  INFO -- : > su postgres -c 'createdb discourse' || true
2016-06-29 15:12:19 UTC [51-1] postgres@postgres FATAL:  the database system is starting up
2016-06-29 15:12:19 UTC [52-1] postgres@template1 FATAL:  the database system is starting up
createdb: could not connect to database template1: FATAL:  the database system is starting up
I, [2016-06-29T15:12:19.479096 #15]  INFO -- :
I, [2016-06-29T15:12:19.479385 #15]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2016-06-29 15:12:19 UTC [63-1] postgres@discourse FATAL:  the database system is starting up
psql: FATAL:  the database system is starting up
I, [2016-06-29T15:12:19.593620 #15]  INFO -- :
I, [2016-06-29T15:12:19.593933 #15]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
2016-06-29 15:12:19 UTC [74-1] postgres@discourse FATAL:  the database system is starting up
psql: FATAL:  the database system is starting up
I, [2016-06-29T15:12:19.734582 #15]  INFO -- :
I, [2016-06-29T15:12:19.735083 #15]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
2016-06-29 15:12:19 UTC [85-1] postgres@discourse FATAL:  the database system is starting up
psql: FATAL:  the database system is starting up
I, [2016-06-29T15:12:19.862191 #15]  INFO -- :
I, [2016-06-29T15:12:19.862772 #15]  INFO -- : Terminating async processes
I, [2016-06-29T15:12:19.862855 #15]  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
2016-06-29 15:12:19 UTC [44-1] LOG:  received fast shutdown request
I, [2016-06-29T15:12:29.864378 #15]  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 pid:44 did not terminate cleanly, forcing termination!


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

(Roberto_Pezzali) #137

Here if I use the 9.3 template

    sudo ./launcher rebuild app
    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, [2016-06-29T16:11:29.886444 #15]  INFO -- : Loading --stdin
    I, [2016-06-29T16:11:29.894523 #15]  INFO -- : > apt-get remove -y postgresql-9.                                                                          5 postgresql-client-9.5 postgresql-contrib-9.5
    I, [2016-06-29T16:11:35.540593 #15]  INFO -- : Reading package lists...
    Building dependency tree...
    Reading state information...
    The following packages will be REMOVED:
      postgresql-9.5 postgresql-client-9.5 postgresql-contrib-9.5
    0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
    After this operation, 26.0 MB disk space will be freed.
    (Reading database ... 34207 files and directories currently installed.)
    Removing postgresql-contrib-9.5 (9.5.3-1.pgdg16.04+1) ...
    update-alternatives: warning: forcing reinstallation of alternative /usr/share/p                                                                          ostgresql/9.5/man/man1/postmaster.1.gz because link group postmaster.1.gz is bro                                                                          ken
    Removing postgresql-9.5 (9.5.3-1.pgdg16.04+1) ...
    invoke-rc.d: could not determine current runlevel
    invoke-rc.d: policy-rc.d denied execution of stop.
    Removing postgresql-client-9.5 (9.5.3-1.pgdg16.04+1) ...
    Processing triggers for postgresql-common (174.pgdg16.04+1) ...
    Building PostgreSQL dictionaries from installed myspell/hunspell packages...
    Removing obsolete dictionary files:

    I, [2016-06-29T16:11:35.541099 #15]  INFO -- : > apt-get update && apt-get insta                                                                          ll -y postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
    dpkg-preconfigure: unable to re-open stdin:
    I, [2016-06-29T16:11:52.772572 #15]  INFO -- : Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
    Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [94.5 kB]
    Get:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]
    Get:4 http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease [26.5 kB]
    Get:5 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [301 kB]
    Get:6 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [157 kB]
    Get:7 http://archive.ubuntu.com/ubuntu xenial-security/main amd64 Packages [109 kB]
    Get:8 http://archive.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [28.9 kB]
    Get:9 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 Packages [64.9 kB]
    Get:10 https://deb.nodesource.com/node_4.x xenial InRelease [3,914 B]
    Get:11 https://deb.nodesource.com/node_4.x xenial/main Sources [762 B]
    Get:12 https://deb.nodesource.com/node_4.x xenial/main amd64 Packages [961 B]
    Fetched 882 kB in 1s (530 kB/s)
    Reading package lists...
    Reading package lists...
    Building dependency tree...
    Reading state information...
    The following additional packages will be installed:
      libossp-uuid16
    Suggested packages:
      uuid locales-all postgresql-doc-9.3 libdbd-pg-perl
    The following NEW packages will be installed:
      libossp-uuid16 postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
    0 upgraded, 4 newly installed, 0 to remove and 26 not upgraded.
    Need to get 4,990 kB of archives.
    After this operation, 23.9 MB of additional disk space will be used.
    Get:1 http://archive.ubuntu.com/ubuntu xenial/universe amd64 libossp-uuid16 amd64 1.6.2-1.5build2 [28.6 kB]
    Get:2 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-client-9.3 amd64 9.3.13-1.pgdg16.04+1 [1,038 kB]
    Get:3 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-9.3 amd64 9.3.13-1.pgdg16.04+1 [3,515 kB]
    Get:4 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-contrib-9.3 amd64 9.3.13-1.pgdg16.04+1 [409 kB]
    Fetched 4,990 kB in 1s (2,715 kB/s)
    Selecting previously unselected package libossp-uuid16:amd64.
    (Reading database ... 33538 files and directories currently installed.)
    Preparing to unpack .../libossp-uuid16_1.6.2-1.5build2_amd64.deb ...
    Unpacking libossp-uuid16:amd64 (1.6.2-1.5build2) ...
    Selecting previously unselected package postgresql-client-9.3.
    Preparing to unpack .../postgresql-client-9.3_9.3.13-1.pgdg16.04+1_amd64.deb ...
    Unpacking postgresql-client-9.3 (9.3.13-1.pgdg16.04+1) ...
    Selecting previously unselected package postgresql-9.3.
    Preparing to unpack .../postgresql-9.3_9.3.13-1.pgdg16.04+1_amd64.deb ...
    Unpacking postgresql-9.3 (9.3.13-1.pgdg16.04+1) ...
    Selecting previously unselected package postgresql-contrib-9.3.
    Preparing to unpack .../postgresql-contrib-9.3_9.3.13-1.pgdg16.04+1_amd64.deb ...
    Unpacking postgresql-contrib-9.3 (9.3.13-1.pgdg16.04+1) ...
    Processing triggers for libc-bin (2.23-0ubuntu3) ...
    Processing triggers for postgresql-common (174.pgdg16.04+1) ...
    Building PostgreSQL dictionaries from installed myspell/hunspell packages...
    Removing obsolete dictionary files:
    Setting up libossp-uuid16:amd64 (1.6.2-1.5build2) ...
    Setting up postgresql-client-9.3 (9.3.13-1.pgdg16.04+1) ...
    update-alternatives: using /usr/share/postgresql/9.3/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode
    Setting up postgresql-9.3 (9.3.13-1.pgdg16.04+1) ...
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
    Creating new cluster 9.3/main ...
      config /etc/postgresql/9.3/main
      data   /var/lib/postgresql/9.3/main
      locale C
      socket /var/run/postgresql
      port   5432
    update-alternatives: using /usr/share/postgresql/9.3/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
    invoke-rc.d: could not determine current runlevel
    invoke-rc.d: policy-rc.d denied execution of start.
    Setting up postgresql-contrib-9.3 (9.3.13-1.pgdg16.04+1) ...
    Processing triggers for libc-bin (2.23-0ubuntu3) ...

    I, [2016-06-29T16:11:52.772948 #15]  INFO -- : > /etc/init.d/postgresql stop
    I, [2016-06-29T16:11:53.080193 #15]  INFO -- :  * Stopping PostgreSQL 9.3 database server
       ...done.

    I, [2016-06-29T16:11:53.080496 #15]  INFO -- : > mkdir -p /shared/postgres_run
    I, [2016-06-29T16:11:53.085299 #15]  INFO -- :
    I, [2016-06-29T16:11:53.085740 #15]  INFO -- : > chown postgres:postgres /shared/postgres_run
    I, [2016-06-29T16:11:53.091969 #15]  INFO -- :
    I, [2016-06-29T16:11:53.092661 #15]  INFO -- : > chmod 775 /shared/postgres_run
    I, [2016-06-29T16:11:53.098117 #15]  INFO -- :
    I, [2016-06-29T16:11:53.098455 #15]  INFO -- : > rm -fr /var/run/postgresql
    I, [2016-06-29T16:11:53.104058 #15]  INFO -- :
    I, [2016-06-29T16:11:53.104337 #15]  INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
    I, [2016-06-29T16:11:53.109696 #15]  INFO -- :
    I, [2016-06-29T16:11:53.110019 #15]  INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
    2016/06/29 16:11:53 socat[1480] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): Connection refused
    I, [2016-06-29T16:11:53.147966 #15]  INFO -- :
    I, [2016-06-29T16:11:53.148221 #15]  INFO -- : > rm -fr /shared/postgres_run/.s*
    I, [2016-06-29T16:11:53.155703 #15]  INFO -- :
    I, [2016-06-29T16:11:53.155915 #15]  INFO -- : > rm -fr /shared/postgres_run/*.pid
    I, [2016-06-29T16:11:53.163001 #15]  INFO -- :
    I, [2016-06-29T16:11:53.163208 #15]  INFO -- : > mkdir -p /shared/postgres_run/9.3-main.pg_stat_tmp
    I, [2016-06-29T16:11:53.169156 #15]  INFO -- :
    I, [2016-06-29T16:11:53.169698 #15]  INFO -- : > chown postgres:postgres /shared/postgres_run/9.3-main.pg_stat_tmp
    I, [2016-06-29T16:11:53.175957 #15]  INFO -- :
    I, [2016-06-29T16:11:53.176622 #15]  INFO -- : Replacing (?-mix:port =.*) with port = 5432 in /etc/postgresql/9.3/main/postgresql.conf
    I, [2016-06-29T16:11:53.189098 #15]  INFO -- : File > /etc/service/postgres/run  chmod: +x
    I, [2016-06-29T16:11:53.201370 #15]  INFO -- : File > /etc/runit/3.d/99-postgres  chmod: +x
    I, [2016-06-29T16:11:53.201809 #15]  INFO -- : > chown -R root /var/lib/postgresql/9.3/main
    I, [2016-06-29T16:11:53.221709 #15]  INFO -- :
    I, [2016-06-29T16:11:53.222072 #15]  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, [2016-06-29T16:11:53.226392 #15]  INFO -- :
    I, [2016-06-29T16:11:53.226513 #15]  INFO -- : > chown -R postgres:postgres /shared/postgres_data
    I, [2016-06-29T16:11:53.246271 #15]  INFO -- :
    I, [2016-06-29T16:11:53.246509 #15]  INFO -- : > chown -R postgres:postgres /var/run/postgresql
    I, [2016-06-29T16:11:53.252863 #15]  INFO -- :
    I, [2016-06-29T16:11:53.253231 #15]  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, [2016-06-29T16:11:53.255075 #15]  INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/9.3/main/postgresql.conf
    I, [2016-06-29T16:11:53.256052 #15]  INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/9.3/main/postgresql.conf
    I, [2016-06-29T16:11:53.256868 #15]  INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/9.3/main/postgresql.conf
    I, [2016-06-29T16:11:53.257538 #15]  INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/9.3/main/postgresql.conf
    I, [2016-06-29T16:11:53.258088 #15]  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, [2016-06-29T16:11:53.258666 #15]  INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
    I, [2016-06-29T16:11:53.263842 #15]  INFO -- :
    I, [2016-06-29T16:11:53.264636 #15]  INFO -- : Replacing (?-mix:#?max_wal_senders *=.*) with max_wal_senders = $db_max_wal_senders in /etc/postgresql/9.3/main/postgresql.conf
    I, [2016-06-29T16:11:53.265705 #15]  INFO -- : Replacing (?-mix:#?wal_level *=.*) with wal_level = $db_wal_level in /etc/postgresql/9.3/main/postgresql.conf
    I, [2016-06-29T16:11:53.266337 #15]  INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/9.3/main/postgresql.conf
    I, [2016-06-29T16:11:53.267032 #15]  INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/9.3/main/postgresql.conf
    I, [2016-06-29T16:11:53.267835 #15]  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, [2016-06-29T16:11:53.268478 #15]  INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres  peer in /etc/postgresql/9.3/main/pg_hba.conf
    I, [2016-06-29T16:11:53.269284 #15]  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, [2016-06-29T16:11:53.269809 #15]  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
    I, [2016-06-29T16:11:53.276346 #15]  INFO -- : > sleep 5
    2016-06-29 16:11:53 UTC [1496-1] FATAL:  database files are incompatible with server
    2016-06-29 16:11:53 UTC [1496-2] DETAIL:  The data directory was initialized by PostgreSQL version 9.5, which is not compatible with this version 9.3.13.
    I, [2016-06-29T16:11:58.284686 #15]  INFO -- :
    I, [2016-06-29T16:11:58.285236 #15]  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, [2016-06-29T16:11:58.400422 #15]  INFO -- :
    I, [2016-06-29T16:11:58.400864 #15]  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, [2016-06-29T16:11:58.534461 #15]  INFO -- :
    I, [2016-06-29T16:11:58.535247 #15]  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, [2016-06-29T16:11:58.673892 #15]  INFO -- :
    I, [2016-06-29T16:11:58.674201 #15]  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, [2016-06-29T16:11:58.837295 #15]  INFO -- :
    I, [2016-06-29T16:11:58.837823 #15]  INFO -- : Terminating async processes


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

@sam any idea?


(ampburner) #138

@Sam do you have any advice? Im dealing with a Large community which has had 24h of downtime because I am not sure how to proceed. Any help is appreciated


(Roberto_Pezzali) #139

I solved renaming postgres_data_old into postgres_data and using 9.3 template.


(Allen - Watchman Monitoring) #140

I wonder if my problem isn’t one of the many in this thread, but I can’t figure which one…

I just removed the .9.3 from my postgres template and attempted a rebuild of my discourse. (This was all precipitated by failures to finish rebuilding in the UI)

The output of my attempts is posted here:

I’m on an ubuntu 14 host with # docker --version Docker version 1.12.1, build 23cf638

I have a full backup downloaded from before I started this, so I wonder… what’s the best way to get my discourse back up & running using postgres 9.5?


(Jay Pfaffman) #141

I’d install fresh on a new droplet and restore there.


(Allen - Watchman Monitoring) #142

The host is customized enough to the point where that’s not ideal…

Starting over with a new container & importing from the backup seems a better way to go… if this can’t be fixed


(Allen - Watchman Monitoring) #143

In my case, going back to the 9.3 template & rebuilding brought the discourse instance back up without a hassle


(Allen - Watchman Monitoring) #144

I used the steps @mpalmer provided to move to the newer postgres template.

See -

Problem == solved.


(Jeff Atwood) closed #145