Fehler beim Upgrade von Beta 3.1.x auf die neueste Version

Ich führe etwa alle 2 bis 3 Tage ein Upgrade durch, das letzte Update war erfolgreich.

Das heutige Update über die URL /admin/upgrade schlug zuerst fehl.

Dann habe ich wie üblich Folgendes getan:

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

Dies führte ebenfalls zu einem Fehler:

/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

Wenn ich weiter nach oben scrolle, sehe ich einen Eintrag:

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

Ich bin wirklich ratlos, wie ich das beheben/lösen kann.

Mein Forum ist jetzt offline. Ich habe sudo ./launcher rebuild app erneut ausgeführt. Es ist auch fehlgeschlagen.

Könnte mir bitte jemand einige Vorschläge zur Lösung geben?

Bitte führen Sie ./launcher start app aus, um das alte Image neu zu starten. Dies kann Ihr Forum wieder online bringen.

1 „Gefällt mir“

Vielen Dank.\n\nDer Container läuft jetzt wieder, aber der Fehler besteht weiterhin.\n\nHöchstwahrscheinlich habe ich das gleiche Problem wie hier:\n\nHow does one run sql queries if the container doesn't start? (rebuild failed) werde nicht versuchen, es auf die gleiche Weise zu lösen, wie dort beschrieben.\n\n### Update 1 - Lösung\n\nOK, es scheint, dass ich es mit diesen Schritten lösen konnte:\n\n1. Die app.yaml bearbeitet und folgendes getan:\n * Das Data Explorer Plugin installiert\n * Die Version auf eine frühere Version angeheftet\n1. Das Image neu erstellt.\n1. Das Data Explorer Plugin aktiviert und gestartet und diese Abfrage verwendet, um die doppelten Tags zu identifizieren.\n1. Die normale Admin-GUI verwendet, um die Tags zu identifizieren. Dann einen Tag umbenannt, um ihn wieder eindeutig zu machen.\n1. Die angeheftete Version wieder entfernt.\n1. Discourse neu erstellt sudo ./launcher rebuild app. Dies war nun erfolgreich.\n1. Nach dem Start von Discourse ging ich zum Admin-Bereich für Tags und habe weiter an den Duplikaten gearbeitet (einen der ehemals doppelten Tags gelöscht, nachdem der andere Tag zugewiesen wurde).

1 „Gefällt mir“

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