Errore "Database system was not properly shut down" durante la ricostruzione

==================== PROBLEMA GRAVE!!!! ====================
app non in esecuzione!
Tentativo di ricostruzione
==================== LOG DI RICOSTRUZIONE ====================
Verifica che il launcher sia aggiornato
Recupero dell'origine
Il launcher è aggiornato
cd /pups && git pull && /pups/bin/pups --stdin
Già aggiornato.
I, [2019-09-19T03:25:36.256661 #1]  INFO -- : Caricamento --stdin
I, [2019-09-19T03:25:36.269059 #1]  INFO -- : > locale-gen $LANG && update-locale
I, [2019-09-19T03:25:36.322226 #1]  INFO -- : Generazione delle localizzazioni (potrebbe richiedere del tempo)...
Generazione completata.

I, [2019-09-19T03:25:36.322605 #1]  INFO -- : > mkdir -p /shared/postgres_run
I, [2019-09-19T03:25:36.328236 #1]  INFO -- :
I, [2019-09-19T03:25:36.328720 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2019-09-19T03:25:36.333983 #1]  INFO -- :
I, [2019-09-19T03:25:36.334293 #1]  INFO -- : > chmod 775 /shared/postgres_run
I, [2019-09-19T03:25:36.337836 #1]  INFO -- :
I, [2019-09-19T03:25:36.338129 #1]  INFO -- : > rm -fr /var/run/postgresql
I, [2019-09-19T03:25:36.343137 #1]  INFO -- :
I, [2019-09-19T03:25:36.343429 #1]  INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2019-09-19T03:25:36.347597 #1]  INFO -- :
I, [2019-09-19T03:25:36.347819 #1]  INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres già in esecuzione, arresta il contenitore ; exit 1
2019/09/19 03:25:36 socat[28] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): File o directory non esistente
I, [2019-09-19T03:25:36.354672 #1]  INFO -- :
I, [2019-09-19T03:25:36.355006 #1]  INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2019-09-19T03:25:36.359801 #1]  INFO -- :
I, [2019-09-19T03:25:36.360028 #1]  INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2019-09-19T03:25:36.365218 #1]  INFO -- :
I, [2019-09-19T03:25:36.365462 #1]  INFO -- : > mkdir -p /shared/postgres_run/10-main.pg_stat_tmp
I, [2019-09-19T03:25:36.370636 #1]  INFO -- :
I, [2019-09-19T03:25:36.370987 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run/10-main.pg_stat_tmp
I, [2019-09-19T03:25:36.375238 #1]  INFO -- :
I, [2019-09-19T03:25:36.384014 #1]  INFO -- : File > /etc/service/postgres/run  chmod: +x  chown:
I, [2019-09-19T03:25:36.391893 #1]  INFO -- : File > /etc/service/postgres/log/run  chmod: +x  chown:
I, [2019-09-19T03:25:36.399904 #1]  INFO -- : File > /etc/runit/3.d/99-postgres  chmod: +x  chown:
I, [2019-09-19T03:25:36.409011 #1]  INFO -- : File > /root/upgrade_postgres  chmod: +x  chown:
I, [2019-09-19T03:25:36.409331 #1]  INFO -- : > chown -R root /var/lib/postgresql/10/main
I, [2019-09-19T03:25:39.272591 #1]  INFO -- :
I, [2019-09-19T03:25:39.272827 #1]  INFO -- : > [ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/10/bin/initdb -D /shared/postgres_data || exit 0
I, [2019-09-19T03:25:39.276677 #1]  INFO -- :
I, [2019-09-19T03:25:39.276825 #1]  INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2019-09-19T03:25:39.300652 #1]  INFO -- :
I, [2019-09-19T03:25:39.300913 #1]  INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2019-09-19T03:25:39.305131 #1]  INFO -- :
I, [2019-09-19T03:25:39.305468 #1]  INFO -- : > /root/upgrade_postgres
I, [2019-09-19T03:25:39.315038 #1]  INFO -- :
I, [2019-09-19T03:25:39.315197 #1]  INFO -- : > rm /root/upgrade_postgres
I, [2019-09-19T03:25:39.318486 #1]  INFO -- :
I, [2019-09-19T03:25:39.318940 #1]  INFO -- : Sostituzione data_directory = '/var/lib/postgresql/10/main' con data_directory = '/shared/postgres_data' in /etc/postgresql/10/main/postgresql.conf
I, [2019-09-19T03:25:39.320086 #1]  INFO -- : Sostituzione (?-mix:#?listen_addresses *=.*) con listen_addresses = '*' in /etc/postgresql/10/main/postgresql.conf
I, [2019-09-19T03:25:39.322462 #1]  INFO -- : Sostituzione (?-mix:#?synchronous_commit *=.*) con synchronous_commit = $db_synchronous_commit in /etc/postgresql/10/main/postgresql.conf
I, [2019-09-19T03:25:39.324514 #1]  INFO -- : Sostituzione (?-mix:#?shared_buffers *=.*) con shared_buffers = $db_shared_buffers in /etc/postgresql/10/main/postgresql.conf
I, [2019-09-19T03:25:39.325648 #1]  INFO -- : Sostituzione (?-mix:#?work_mem *=.*) con work_mem = $db_work_mem in /etc/postgresql/10/main/postgresql.conf
I, [2019-09-19T03:25:39.326845 #1]  INFO -- : Sostituzione (?-mix:#?default_text_search_config *=.*) con default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/10/main/postgresql.conf
I, [2019-09-19T03:25:39.328375 #1]  INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2019-09-19T03:25:39.334429 #1]  INFO -- :
I, [2019-09-19T03:25:39.334939 #1]  INFO -- : Sostituzione (?-mix:#?max_wal_senders *=.*) con max_wal_senders = $db_max_wal_senders in /etc/postgresql/10/main/postgresql.conf
I, [2019-09-19T03:25:39.335686 #1]  INFO -- : Sostituzione (?-mix:#?wal_level *=.*) con wal_level = $db_wal_level in /etc/postgresql/10/main/postgresql.conf
I, [2019-09-19T03:25:39.338130 #1]  INFO -- : Sostituzione (?-mix:#?checkpoint_segments *=.*) con checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/10/main/postgresql.conf
I, [2019-09-19T03:25:39.341035 #1]  INFO -- : Sostituzione (?-mix:#?logging_collector *=.*) con logging_collector = $db_logging_collector in /etc/postgresql/10/main/postgresql.conf
I, [2019-09-19T03:25:39.342254 #1]  INFO -- : Sostituzione (?-mix:#?log_min_duration_statement *=.*) con log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/10/main/postgresql.conf
I, [2019-09-19T03:25:39.343427 #1]  INFO -- : Sostituzione (?-mix:^#local +replication +postgres +peer$) con local replication postgres peer in /etc/postgresql/10/main/pg_hba.conf
I, [2019-09-19T03:25:39.343950 #1]  INFO -- : Sostituzione (?-mix:^host.*all.*all.*127.*$) con host all all 0.0.0.0/0 md5 in /etc/postgresql/10/main/pg_hba.conf
I, [2019-09-19T03:25:39.345666 #1]  INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main
I, [2019-09-19T03:25:39.348666 #1]  INFO -- : > sleep 5
2019-09-19 03:25:39.378 UTC [51] LOG:  in ascolto sull'indirizzo IPv4 "0.0.0.0", porta 5432
2019-09-19 03:25:39.378 UTC [51] LOG:  in ascolto sull'indirizzo IPv6 "::", porta 5432
2019-09-19 03:25:39.384 UTC [51] LOG:  in ascolto sulla socket Unix "/var/run/postgresql/.s.PGSQL.5432"
2019-09-19 03:25:39.493 UTC [54] LOG:  il sistema di database è stato arrestato in modalità recovery alle 2019-09-19 03:23:55 UTC
2019-09-19 03:25:39.493 UTC [54] LOG:  il sistema di database non è stato arrestato correttamente; in corso il recupero automatico
2019-09-19 03:25:39.509 UTC [54] LOG:  redo inizia da 1003/5E792F0
I, [2019-09-19T03:25:44.352528 #1]  INFO -- :
I, [2019-09-19T03:25:44.352957 #1]  INFO -- : > su postgres -c 'createdb discourse' || true
2019-09-19 03:25:44.438 UTC [58] postgres@postgres FATAL:  il sistema di database è in fase di avvio
2019-09-19 03:25:44.439 UTC [59] postgres@template1 FATAL:  il sistema di database è in fase di avvio
createdb: impossibile connettersi al database template1: FATAL:  il sistema di database è in fase di avvio
I, [2019-09-19T03:25:44.442572 #1]  INFO -- :
I, [2019-09-19T03:25:44.443122 #1]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2019-09-19 03:25:44.525 UTC [70] postgres@discourse FATAL:  il sistema di database è in fase di avvio
psql: FATAL:  il sistema di database è in fase di avvio
I, [2019-09-19T03:25:44.527564 #1]  INFO -- :
I, [2019-09-19T03:25:44.527978 #1]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
2019-09-19 03:25:44.617 UTC [81] postgres@discourse FATAL:  il sistema di database è in fase di avvio
psql: FATAL:  il sistema di database è in fase di avvio
I, [2019-09-19T03:25:44.619389 #1]  INFO -- :
I, [2019-09-19T03:25:44.619732 #1]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
2019-09-19 03:25:44.699 UTC [92] postgres@discourse FATAL:  il sistema di database è in fase di avvio
psql: FATAL:  il sistema di database è in fase di avvio
I, [2019-09-19T03:25:44.701755 #1]  INFO -- :
I, [2019-09-19T03:25:44.702510 #1]  INFO -- : Terminazione dei processi asincroni
I, [2019-09-19T03:25:44.702584 #1]  INFO -- : Invio di INT a HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main pid: 51
2019-09-19 03:25:44.702 UTC [51] LOG:  ricevuto richiesta di arresto rapido
2019-09-19 03:25:44.745 UTC [95] LOG:  arresto in corso
2019-09-19 03:25:44.926 UTC [51] LOG:  il sistema di database è arrestato


FALLITO
--------------------
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' fallito con codice di ritorno #<Process::Status: pid 82 exit 2>
Posizione dell'errore: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec fallito con i parametri "su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"
e3c609d02d8197f6efd84dd0ecf99456ed566b02fd3a09d87e286696496e56c8
** BOOTSTRAP FALLITO ** scorri verso l'alto e cerca messaggi di errore precedenti, potrebbero essercene più di uno.
./discourse-doctor potrebbe aiutare a diagnosticare il problema.
> 

Questo errore è iniziato dopo l’ultimo aggiornamento

  • Ho già rimosso i plugin non ufficiali
  • C’è molto spazio (più di 600GB)
  • File di Swap da 2GB

C’è un problema con il tuo database

 2019-09-19 03:25:39.493 UTC [54] LOG: il sistema di database non è stato arrestato correttamente; in corso il ripristino automatico

Potrebbe essere che se

. /launcher start app

e aspetti semplicemente un po’, il ripristino verrà completato e potrai procedere con una ricostruzione.

Grazie per la rapida risposta, ma ci sono ancora degli errori:

Dopo ./launcher start app

ATTENZIONE: Stiamo per iniziare il download dell'immagine base di Discourse
Questo processo può richiedere da pochi minuti a un'ora, a seconda della velocità della tua rete

Ti preghiamo di essere paziente

Impossibile trovare l'immagine 'discourse/base:2.0.20190906-0522' localmente
2.0.20190906-0522: Pulling from discourse/base
1ab2bdfe9778: Pulling fs layer
a313ca07f056: Pulling fs layer
1ab2bdfe9778: Download complete
1ab2bdfe9778: Pull complete
a313ca07f056: Verifying Checksum
a313ca07f056: Download complete
a313ca07f056: Pull complete
Digest: sha256:8c58bd323c80b464b2634d2aa8c322772d0c7bff3e08eff06cf2b66d37fe623d
Stato: Immagine scaricata per discourse/base:2.0.20190906-0522

Impossibile trovare l'immagine 'local_discourse/app:latest' localmente
/usr/bin/docker: Errore di risposta dal demone: accesso al pull negato per local_discourse/app, il repository non esiste o potrebbe richiedere 'docker login'.
Vedi '/usr/bin/docker run --help'.

Oh, sembra che tu non abbia un container funzionante.

La soluzione più semplice, se hai un backup, è eliminare la directory postgres_data, ricostruire e ripristinare il backup. Se non hai un backup, potresti essere in grado di [convertire un container standalone in due container separati] (Move from standalone container to separate web and data containers).

Non so se quelle istruzioni chiariscano come spostare i dati esistenti nel nuovo container.

Per 500 $ sistemerò il problema o ti rimborserò (e c’è una probabilità considerevole che alla fine perderò il mio tempo e ti rimborserò comunque). I miei contatti sono nel mio profilo.