Erro ao atualizar da Beta 3.1.x para a mais recente

Faço uma atualização a cada 2 a 3 dias, a última atualização foi bem-sucedida.

A atualização de hoje via URL /admin/upgrade falhou inicialmente.

Então eu fiz o usual:

cd /var/discourse
sudo git pull
sudo ./launcher rebuild app

Isso também resultou em um erro:

/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
I, [2023-01-20T15:27:00.834259 #1]  INFO -- : == 20230118020114 AddPublicTopicCountToTags: migrating ========
-- add_column(:tags, :public_topic_count, :integer, {:default=>0, :null=>false})
   -> 0.0138s
-- execute("UPDATE tags t\nSET public_topic_count = x.topic_count\nFROM (\n  SELECT\n    COUNT(topics.id) AS topic_count,\n    tags.id AS tag_id\n  FROM tags\n  INNER JOIN topic_tags ON tags.id = topic_tags.tag_id\n  INNER JOIN topics ON topics.id = topic_tags.topic_id AND topics.deleted_at IS NULL AND topics.archetype != 'private_message'\n  INNER JOIN categories ON categories.id = topics.category_id AND NOT categories.read_restricted\n  GROUP BY tags.id\n) x\nWHERE x.tag_id = t.id\nAND x.topic_count <> t.public_topic_count;\n")

I, [2023-01-20T15:27:00.834823 #1]  INFO -- : Terminating async processes
I, [2023-01-20T15:27:00.834868 #1]  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/13/bin/postmaster -D /etc/postgresql/13/main pid: 42
I, [2023-01-20T15:27:00.835173 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 103
2023-01-20 15:27:00.835 UTC [42] LOG:  received fast shutdown request
103:signal-handler (1674228420) Received SIGTERM scheduling shutdown...
2023-01-20 15:27:00.849 UTC [42] LOG:  aborting any active transactions
2023-01-20 15:27:00.851 UTC [42] LOG:  background worker "logical replication launcher" (PID 51) exited with exit code 1
2023-01-20 15:27:00.855 UTC [46] LOG:  shutting down
2023-01-20 15:27:00.901 UTC [42] LOG:  database system is shut down
103:M 20 Jan 2023 15:27:00.905 # User requested shutdown...
103:M 20 Jan 2023 15:27:00.905 * Saving the final RDB snapshot before exiting.
103:M 20 Jan 2023 15:27:00.950 * DB saved on disk
103:M 20 Jan 2023 15:27:00.950 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse &amp;&amp; su discourse -c 'bundle exec rake db:migrate' failed with return #&lt;Process::Status: pid 390 exit 1&gt;
Location of failure: /usr/local/lib/ruby/gems/3.1.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
37cbe5dc5c82e0a41e9e1deea5b99f5e643bfe6bcd53d52c38e3e855a85ed81e

Rolar mais para cima, vejo uma entrada:

PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_tags_on_name"
DETAIL:  Key (name)=(net) already exists.

Estou realmente sem saber como consertar/resolver.

Meu fórum está agora offline. Executei sudo ./launcher rebuild app novamente. Também falhou.

Alguém poderia me ajudar com algumas sugestões sobre como resolver?

Execute ./launcher start app para reiniciar a imagem antiga. Isso pode trazer seu fórum de volta online.

1 curtida

Muito obrigado.

O contêiner está rodando novamente, mas o erro persiste.

Muito provavelmente, tenho o mesmo problema que aqui:

Não vou tentar resolver da mesma forma descrita lá.

Atualização 1 - Solução

Ok, parece que consegui resolver com estes passos:

  1. Editei o app.yaml e fiz:
  2. Reconstruí a imagem.
  3. Ativei e iniciei o plugin Data Explorer e usei esta consulta para identificar as tags duplicadas.
  4. Usei a GUI de administrador normal para identificar as tags. Em seguida, renomeei uma tag para que fosse única novamente.
  5. Removi a versão fixada novamente.
  6. Reconstruí o Discourse sudo ./launcher rebuild app. Isso foi bem-sucedido agora.
  7. Após iniciar o Discourse, fui para a área de administração de tags e trabalhei mais nas duplicadas (excluí uma das tags anteriormente duplicadas após atribuir a outra tag).
1 curtida

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