Aggiornamento fallito

Eseguo Discourse su Debian 11 con Docker come singolo container.

Ho provato ad aggiornarlo usando ./launcher rebuild app

Fallisce con questo messaggio:

I, [2023-01-04T20:53:09.920876 #1]  INFO -- : cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate'
rake aborted!

Non trovo un modo per farlo ripartire.

Qualche idea?

Vedo che il proprietario è sbagliato

drwxr-xr-x 15 sshd             netdev          4096 Jan  4 21:43 .
drwxr-xr-x  3 root             root            4096 Jan  3  2018 ..
drwxr-xr-x  3             1000 www-data        4096 Jan  3  2018 backups
drwxr-xr-x  8 sshd             netdev          4096 Feb  2  2021 letsencrypt
drwxr-xr-x  4 sshd             netdev          4096 Jan  3  2018 log
drwxr-xr-x  2 systemd-timesync systemd-resolve 4096 Jan  3  2018 postgres_backup
drwx------ 19 systemd-timesync systemd-resolve 4096 Jan  4 21:53 postgres_data
drwx------ 19 sshd             netdev          4096 Jan  4 20:49 postgres_data_new
drwxrwsr-x  6 systemd-timesync systemd-resolve 4096 Jan  4 21:53 postgres_run
drwxr-xr-x  2 systemd-resolve  kvm             4096 Jan  4 21:53 redis_data
drwxr-xr-x  2 sshd             netdev          4096 Jan 22  2021 ssl
drwxr-xr-x  2 sshd             netdev          4096 Jan 21  2021 ssl_old
drwxr-xr-x  4 sshd             netdev          4096 Jan  3  2018 state
drwxr-xr-x  4             1000 www-data        4096 Jan  4 21:28 tmp
drwxr-xr-x  4             1000 www-data        4096 Jan  5  2018 uploads

Avvio il container usando ./launcher start app. Poi entro nel container: ./launcher enter app.

Ripristino la proprietĂ  chown -R postgres:postgres /shared/

Successivamente viene corretto. Ma quando ricostruisco nuovamente l’app, il proprietario è di nuovo sbagliato…

Questo non è l’errore, sarà più in alto, dovremo vedere più del log.

2023-01-04 20:48:05.355 UTC [41] LOG:  avvio di PostgreSQL 13.9 (Debian 13.9-1.pgdg110+1) su x86_64-pc-linux-gnu, compilato da gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2023-01-04 20:48:05.377 UTC [41] LOG:  in ascolto sull'indirizzo IPv4 "0.0.0.0", porta 5432
2023-01-04 20:48:05.377 UTC [41] LOG:  in ascolto sull'indirizzo IPv6 "::", porta 5432
2023-01-04 20:48:05.566 UTC [41] LOG:  in ascolto sul socket Unix "/var/run/postgresql/.s.PGSQL.5432"
2023-01-04 20:48:05.734 UTC [44] LOG:  il sistema del database è stato arrestato alle 2023-01-04 20:46:17 UTC
2023-01-04 20:48:05.878 UTC [41] LOG:  il sistema del database è pronto ad accettare connessioni
I, [2023-01-04T20:48:09.779985 #1]  INFO -- :
I, [2023-01-04T20:48:09.780390 #1]  INFO -- : > su postgres -c 'createdb discourse' || true
2023-01-04 20:48:10.014 UTC [54] postgres@postgres ERROR:  il database "discourse" esiste giĂ 
2023-01-04 20:48:10.014 UTC [54] postgres@postgres STATEMENT:  CREATE DATABASE discourse;
createdb: error: impossibile creare il database: ERROR:  il database "discourse" esiste giĂ 
I, [2023-01-04T20:48:10.017003 #1]  INFO -- :
I, [2023-01-04T20:48:10.017425 #1]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2023-01-04 20:48:10.188 UTC [58] postgres@discourse ERROR:  il ruolo "discourse" esiste giĂ 
2023-01-04 20:48:10.188 UTC [58] postgres@discourse STATEMENT:  create user discourse;
ERROR:  il ruolo "discourse" esiste giĂ 
129:M 04 Jan 2023 20:48:21.224 # Impossibile mettersi in ascolto sulla porta 6379 (TCP), interruzione.

Non vedo altri errori.

:man_shrugging:

All’interno del container provo ad avviare il servizio postgresql e ottengo un errore.

root@server /var/discourse # ./launcher enter app
x86_64 arch detected.
root@discourse:/var/www/discourse# service postgresql start
[FAIL] Starting PostgreSQL 13 database server: main[....] Error: Config owner (postgres:105) and data owner (systemd-timesync:101) do not match, and config owner is not root ... failed!
 failed!
root@discourse:/var/www/discourse#

Se hai cambiato i proprietari dei file all’interno della cartella condivisa, l’installazione verrà interrotta. Un’opzione è la reinstallazione e il ripristino di un backup, mentre l’altra è la correzione manuale di tali proprietari.

1 Mi Piace

@Falco: grazie!

Ho cambiato i proprietari dopo che l’aggiornamento è fallito. Ho trovato il suggerimento chown da qualche parte in un post.

Come posso creare un backup nello stato attuale?

Come posso correggere manualmente i proprietari?

Grazie ancora!

All’interno del container ho provato discourse backup. Segnala che Redis non è in esecuzione. Nel log di Redis “current” ho trovato le seguenti righe alla fine…

10316:M 05 Jan 2023 08:05:27.314 # Server initialized
10316:M 05 Jan 2023 08:05:27.314 # 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.
10316:M 05 Jan 2023 08:05:27.314 # Can't handle RDB format version 10
10316:M 05 Jan 2023 08:05:27.314 # Fatal error loading the DB: Invalid argument. Exiting.
10321:C 05 Jan 2023 08:05:28.345 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10321:C 05 Jan 2023 08:05:28.345 # Redis version=6.2.3, bits=64, commit=00000000, modified=0, pid=10321, just started
10321:C 05 Jan 2023 08:05:28.345 # Configuration loaded
10321:M 05 Jan 2023 08:05:28.346 * monotonic clock: POSIX clock_gettime
10321:M 05 Jan 2023 08:05:28.347 * Running mode=standalone, port=6379.
10321:M 05 Jan 2023 08:05:28.347 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
10321:M 05 Jan 2023 08:05:28.347 # Server initialized
10321:M 05 Jan 2023 08:05:28.347 # 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.
10321:M 05 Jan 2023 08:05:28.348 # Can't handle RDB format version 10
10321:M 05 Jan 2023 08:05:28.348 # Fatal error loading the DB: Invalid argument. Exiting.

Ho corretto i permessi in questo modo (all’interno del container):

Successivamente ho riavviato il container con ./launcher restart app. Ora posso accedere a Discourse. Ma è la vecchia versione 2.8.3 a cui ho cercato di eseguire l’aggiornamento a 3.0.0.beta16 ieri.

Non sono sicuro di come procedere per aggiornare Discourse.

Penso che il mio problema sia correlato a questo thread: Problem upgrading multi-site/multi-containers Discourse instance - #5 by jtraulle

Ricordo di aver avuto problemi di aggiornamento in passato ma non li ho mai approfonditi.

./launcher rebuild app

Sono riuscito a impostare la versione su 2.9.0.beta2 (id commit: 88a8584348ed93a28286839bfc1c32b06bd50b3f) impostando l’id commit come “version” in app.yml. Questa volta l’aggiornamento ha funzionato. Dopo di che sono stato in grado di aggiornare a 3.0.0.beta16.

Grazie a tutti.

5 Mi Piace

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.