Errore durante l'aggiornamento da Beta 3.1.x all'ultima versione

Eseguo un aggiornamento circa ogni 2 o 3 giorni, l’ultimo aggiornamento è riuscito.

L’aggiornamento di oggi tramite l’URL /admin/upgrade è fallito inizialmente.

Poi ho fatto il solito:

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

Anche questo ha prodotto un errore:

/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

Scorrendo più in alto, vedo una voce:

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

Sono davvero a corto di idee su come risolvere/risolvere.

Il mio forum è ora offline. Ho eseguito di nuovo sudo ./launcher rebuild app. Anche questo è fallito.

Qualcuno potrebbe aiutarmi con qualche suggerimento su come risolvere?

Esegui ./launcher start app per riavviare la vecchia immagine. Questo potrebbe riportare online il tuo forum.

1 Mi Piace

Grazie mille.

Il container è ora di nuovo in esecuzione, ma l’errore persiste.

Molto probabilmente ho lo stesso problema di qui:

Non tenterò di risolverlo nello stesso modo descritto lì.

Aggiornamento 1 - Soluzione

OK, sembra che sia riuscito a risolvere con questi passaggi:

  1. Ho modificato app.yaml e ho fatto:
  2. Ricostruito l’immagine.
  3. Attivato e avviato il plugin Data Explorer e utilizzato questa query per identificare i tag duplicati.
  4. Utilizzato la normale interfaccia grafica di amministrazione per identificare i tag. Quindi ho rinominato un tag per renderlo nuovamente univoco.
  5. Rimosso nuovamente la versione bloccata.
  6. Ricostruito Discourse sudo ./launcher rebuild app. Ora è riuscito.
  7. Dopo aver avviato Discourse, sono andato nell’area di amministrazione dei tag e ho continuato a lavorare sui duplicati (eliminato uno dei tag precedentemente duplicati dopo aver assegnato l’altro tag).
1 Mi Piace

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