Beta 3.1.x에서 최신 버전으로 업그레이드 중 오류 발생

최근 업데이트를 대략 2~3일 간격으로 수행해 왔으며, 마지막 업데이트는 성공적으로 완료되었습니다.

오늘 /admin/upgrade URL을 통해 업데이트를 시도했으나 처음에는 실패했습니다.

이후 평소처럼 다음 명령을 실행했습니다:

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

이 역시 오류가 발생했습니다:

/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 && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 390 exit 1>
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

더 위로 스크롤하면 다음과 같은 항목을 볼 수 있습니다:

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

어떻게 수정/해결해야 할지 정말로 막막합니다.

저의 포럼이 현재 오프라인 상태입니다. sudo ./launcher rebuild app을 다시 실행해 보았으나, 이 또한 실패했습니다.

해결 방법에 대한 조언을 주실 수 있을까요?

오래된 이미지를 재부팅하려면 ./launcher start app을 실행해 주세요. 이렇게 하면 포럼이 다시 온라인으로 복구될 수 있습니다.

감사합니다.

컨테이너가 다시 실행되고 있지만, 여전히 오류가 지속됩니다.

아마도 다음과 같은 동일한 문제를 겪고 있는 것 같습니다:

거기서 설명된 방식대로 해결을 시도하지는 않을 것입니다.

업데이트 1 - 해결 방법

다음 단계를 통해 해결할 수 있었던 것 같습니다:

  1. app.yaml 파일을 편집하여 다음을 수행했습니다:
  2. 이미지를 다시 빌드했습니다.
  3. Data Explorer 플러그인을 활성화하고 시작하여, 이 쿼리를 사용하여 중복된 태그를 식별했습니다.
  4. 일반 관리자 GUI를 사용하여 태그를 식별했습니다. 그런 다음 한 태그를 다시 고유하도록 이름 변경했습니다.
  5. 고정된 버전을 다시 제거했습니다.
  6. Discourse를 다시 빌드했습니다 sudo ./launcher rebuild app. 이제 성공적으로 실행되었습니다.
  7. Discourse를 시작한 후, 태그 관리 영역으로 이동하여 중복된 태그를 추가로 작업했습니다(다른 태그를 할당한 후, 기존 중복 태그 중 하나를 삭제했습니다).