Estava atualizando a partir da versão 2.7.0.beta1 e recebi esta mensagem de erro:
2021-01-22 20:16:22.015 UTC [4055] discourse@discourse LOG: duração: 75335.241 ms instrução: UPDATE notifications SET processed = true
2021-01-22 20:16:23.792 UTC [4055] discourse@discourse LOG: duração: 1776.591 ms instrução: ALTER TABLE "notifications" ALTER COLUMN "processed" SET NOT NULL
2021-01-22 20:16:25.198 UTC [4055] discourse@discourse LOG: duração: 1323.298 ms instrução: CREATE INDEX "index_notifications_on_processed" ON "notifications" ("processed")
2021-01-22 20:16:25.458 UTC [4055] discourse@discourse LOG: duração: 241.063 ms instrução: CREATE TABLE "user_notification_schedules" ("id" bigserial primary key, "user_id" integer NOT NULL, "enabled" boolean DEFAULT FALSE NOT NULL, "day_0_start_time" integer NOT NULL, "day_0_end_time" integer NOT NULL, "day_1_start_time" integer NOT NULL, "day_1_end_time" integer NOT NULL, "day_2_start_time" integer NOT NULL, "day_2_end_time" integer NOT NULL, "day_3_start_time" integer NOT NULL, "day_3_end_time" integer NOT NULL, "day_4_start_time" integer NOT NULL, "day_4_end_time" integer NOT NULL, "day_5_start_time" integer NOT NULL, "day_5_end_time" integer NOT NULL, "day_6_start_time" integer NOT NULL, "day_6_end_time" integer NOT NULL)
2021-01-22 20:16:25.560 UTC [4055] discourse@discourse LOG: duração: 100.868 ms instrução: CREATE INDEX "index_user_notification_schedules_on_user_id" ON "user_notification_schedules" ("user_id")
2021-01-22 20:16:25.782 UTC [4055] discourse@discourse LOG: duração: 142.180 ms instrução: CREATE INDEX "index_do_not_disturb_timings_on_scheduled" ON "do_not_disturb_timings" ("scheduled")
2021-01-22 20:16:26.414 UTC [4055] discourse@discourse LOG: duração: 361.514 ms instrução: UPDATE users
SET locale = 'en_GB'
WHERE locale = 'en'
2021-01-22 20:16:26.656 UTC [4055] discourse@discourse LOG: duração: 132.778 ms instrução: UPDATE theme_translation_overrides
SET locale = 'en_GB'
WHERE locale = 'en'
2021-01-22 20:16:42.745 UTC [4055] discourse@discourse ERROR: valor de chave duplicada viola a restrição de unicidade "index_users_on_username"
2021-01-22 20:16:42.745 UTC [4055] discourse@discourse DETAIL: Chave (username)=(DaveW) já existe.
2021-01-22 20:16:42.745 UTC [4055] discourse@discourse STATEMENT: UPDATE users
SET locale = 'en'
WHERE locale = 'en_US'
rake aborted!
StandardError: Ocorreu um erro; esta e todas as migrações subsequentes foram canceladas:
PG::UniqueViolation: ERROR: valor de chave duplicada viola a restrição de unicidade "index_users_on_username"
DETAIL: Chave (username)=(DaveW) já existe.
E então, no final da saída:
I, [2021-01-22T20:16:42.805286 #1] INFO -- : Encerrando processos assíncronos
I, [2021-01-22T20:16:42.805333 #1] INFO -- : Enviando INT para HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 49
I, [2021-01-22T20:16:42.805381 #1] INFO -- : Enviando TERM para exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 166
166:signal-handler (1611346602) Recebeu SIGTERM agendando desligamento...
2021-01-22 20:16:42.805 UTC [49] LOG: recebido pedido de desligamento rápido
2021-01-22 20:16:42.835 UTC [49] LOG: abortando todas as transações ativas
2021-01-22 20:16:42.857 UTC [49] LOG: worker de fundo "iniciador de replicação lógica" (PID 58) saiu com código de saída 1
166:M 22 Jan 2021 20:16:42.876 # Usuário solicitou desligamento...
166:M 22 Jan 2021 20:16:42.876 * Salvando o snapshot RDB final antes de sair.
166:M 22 Jan 2021 20:16:44.758 * Banco de dados salvo no disco
166:M 22 Jan 2021 20:16:44.758 # Redis está pronto para sair, tchau tchau...
2021-01-22 20:16:45.563 UTC [53] LOG: desligando
I, [2021-01-22T20:16:52.806177 #1] INFO -- : HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid:49 não terminou corretamente, forçando o término!
FALHA
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' falhou com retorno #<Process::Status: pid 4032 exit 1>
Localização da falha: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec falhou com os parâmetros {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
d627ad17d1f22d839a7dc8099878e6272eb3ea1772539f6628e2a23dd830aca2
** FALHA NO BOOTSTRAP ** por favor, role para cima e procure mensagens de erro anteriores; pode haver mais de uma.
./discourse-doctor pode ajudar a diagnosticar o problema.
Não faço ideia de como poderia haver duas contas com o mesmo nome de usuário.
Nosso site está totalmente fora do ar. O que devo fazer agora?
Obrigado,
Gunnar
