오류: 오래된 버전의 Discourse 이미지를 실행 중입니다

안녕하세요, 첫 게시글을 올립니다! 저는 Nelly Eggsy이고, Ghost와 Discourse를 사용하여 웹사이트를 구축하고 있습니다.

보통 포럼에서 lurking하며 그림자 속에서 게시글을 읽곤 합니다. 막히면 포럼에서 답변을 검색하는데, 대개 잘 작동합니다. 하지만 지금은 막혀서 도움이 필요합니다.

관리자 UI를 통해 Discourse를 업그레이드한 후 다음과 같은 메시지를 확인했습니다:

You are running an old version of the Discourse image.
Upgrades via the web UI are disabled until you run the latest image.

To do so, log in to your server using SSH and run:

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

콘솔 명령어를 사용하여 Discourse와 Docker 이미지를 최신 버전으로 업그레이드하는 방법에 대한 가이드를 따랐습니다. 그러나 오류로 인해 성공적으로 업그레이드하지 못하고 있습니다.

./launcher rebuild app 명령어를 실행할 때 발생하는 오류 메시지는 다음과 같습니다.

> FAILED
> --------------------
> Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 671 exit 1>
> Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
> exec failed with the params {"cd"=>"$home", "hook"=>"assets_precompile", "cmd"=>["su discourse -c 'bundle exec rake themes:update assets:precompile'"]}
> 9c3a1b4a72818216aaafa5de742f7d1a325aa61497ea49f5b4f1660c6e503fd0
> ** 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.

제 Digital Ocean 드롭렛은 2GB 메모리 / 50GB 디스크 + 50GB / SFO2 - Ubuntu 20.04에서 Discourse를 실행하고 있습니다.

제 게시글을 읽어주셔서 감사합니다! 여러분의 답변을 기대하겠습니다.

환영합니다, @nelly! 문제가 발생해 죄송합니다! 이건 정말 예상치 못한 일입니다. 수정: 좀 예상 밖이네요.

custom 플러그인이나 테마를 사용하고 계신가요?

위쪽으로 스크롤해서 실제 에러 메시지를 여기에 붙여넣어 주시겠어요?

@pfaffman 님, 답변해 주셔서 감사합니다. 네, 커스텀 테마와 플러그인이 몇 개 있습니다.

제가 가지고 있는 플러그인은 다음과 같습니다:

      - git clone https://github.com/discourse/docker_manager.git
      - git clone https://github.com/paviliondev/discourse-custom-wizard.git
      - git clone https://github.com/discourse/discourse-spoiler-alert.git
      - git clone https://github.com/paviliondev/discourse-landing-pages.git
      - git clone https://github.com/discourse/discourse-patreon.git
      - git clone https://github.com/discourse/discourse-reactions.git

커스텀 테마에 어떻게 접근해서 삭제해야 하는지 잘 모르겠습니다.

Rafael,

“failed” 오류 바로 위에 보이는 내용은 다음과 같습니다:

rake aborted!
NameError: undefined local variable or method `name' for main:Object
/var/www/discourse/lib/tasks/assets.rake:251:in `rescue in block (2 levels) in <main>'
/var/www/discourse/lib/tasks/assets.rake:240:in `block (2 levels) in <main>'

Caused by:
OpenURI::HTTPError: 401 Error: Invalid license key
/var/www/discourse/lib/file_helper.rb:63:in `block in download'
/var/www/discourse/lib/final_destination.rb:422:in `block (3 levels) in safe_get'
/var/www/discourse/lib/final_destination.rb:421:in `catch'
/var/www/discourse/lib/final_destination.rb:421:in `block (2 levels) in safe_get'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-2.3.2/lib/patches/net_patches.rb:19:in `block in request_with_mini_profiler'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-2.3.2/lib/mini_profiler/profiling_methods.rb:46:in `step'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-2.3.2/lib/patches/net_patches.rb:18:in `request_with_mini_profiler'
/var/www/discourse/lib/final_destination.rb:393:in `block in safe_get'
/var/www/discourse/lib/final_destination.rb:437:in `block in safe_session'
/var/www/discourse/lib/final_destination.rb:434:in `safe_session'
/var/www/discourse/lib/final_destination.rb:385:in `safe_get'
/var/www/discourse/lib/final_destination.rb:134:in `get'
/var/www/discourse/lib/file_helper.rb:55:in `download'
/var/www/discourse/lib/discourse_ip_info.rb:39:in `mmdb_download'
/var/www/discourse/lib/tasks/assets.rake:242:in `block (3 levels) in <main>'
/var/www/discourse/lib/tasks/assets.rake:241:in `each'
/var/www/discourse/lib/tasks/assets.rake:241:in `block (2 levels) in <main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
I, [2021-05-02T20:17:42.823237 #1]  INFO -- : Downloading MaxMindDB...
Compressing Javascript and Generating Source Maps

도움이 되길 바랍니다. 미리 감사드립니다!

더 위로 조금 더 스크롤해야 할 것 같아요. 그 라이선스 키 메시지는 Maxmind 관련 내용이고, 그게 문제라고 생각하지 않거든요.

Jay,

아래에 출력 결과를 첨부합니다. 포럼에 게시할 수 있도록 내용을 많이 줄였습니다.

2021-05-03 00:32:20.635 UTC [63] postgres@postgres ERROR:  database "discourse" already exists
2021-05-03 00:32:20.635 UTC [63] postgres@postgres STATEMENT:  CREATE DATABASE discourse;
createdb: error: database creation failed: ERROR:  database "discourse" already exists
I, [2021-05-03T00:32:20.639714 #1]  INFO -- : 
I, [2021-05-03T00:32:20.640335 #1]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2021-05-03 00:32:20.760 UTC [74] postgres@discourse ERROR:  role "discourse" already exists
2021-05-03 00:32:20.760 UTC [74] postgres@discourse STATEMENT:  create user discourse;
ERROR:  role "discourse" already exists

I, [2021-05-03T00:32:21.634456 #1]  INFO -- : File > /etc/service/redis/run  chmod: +x  chown: 
I, [2021-05-03T00:32:21.640838 #1]  INFO -- : File > /etc/service/redis/log/run  chmod: +x  chown: 
I, [2021-05-03T00:32:21.646998 #1]  INFO -- : File > /etc/runit/3.d/10-redis  chmod: +x  chown: 
I, [2021-05-03T00:32:21.648588 #1]  INFO -- : Replacing daemonize yes with  in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.650175 #1]  INFO -- : Replacing (?-mix:^pidfile.*$) with  in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.651303 #1]  INFO -- : > install -d -m 0755 -o redis -g redis /shared/redis_data
I, [2021-05-03T00:32:21.656597 #1]  INFO -- : 
I, [2021-05-03T00:32:21.657900 #1]  INFO -- : Replacing (?-mix:^logfile.*$) with logfile "" in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.659157 #1]  INFO -- : Replacing (?-mix:^bind .*$) with  in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.660353 #1]  INFO -- : Replacing (?-mix:^dir .*$) with dir /shared/redis_data in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.661652 #1]  INFO -- : Replacing (?-mix:^protected-mode yes) with protected-mode no in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.662825 #1]  INFO -- : Replacing # io-threads 4 with io-threads $redis_io_threads in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.663908 #1]  INFO -- : > echo redis installed
I, [2021-05-03T00:32:21.668192 #1]  INFO -- : redis installed
I, [2021-05-03T00:32:21.669144 #1]  INFO -- : > cat /etc/redis/redis.conf | grep logfile
I, [2021-05-03T00:32:21.679111 #1]  INFO -- : logfile ""
I, [2021-05-03T00:32:21.680077 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2021-05-03T00:32:21.683045 #1]  INFO -- : > sleep 10
167:C 03 May 2021 00:32:21.698 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
167:C 03 May 2021 00:32:21.698 # Redis version=6.2.1, bits=64, commit=00000000, modified=0, pid=167, just started
167:C 03 May 2021 00:32:21.699 # Configuration loaded
167:M 03 May 2021 00:32:21.700 * monotonic clock: POSIX clock_gettime
167:M 03 May 2021 00:32:21.702 * Running mode=standalone, port=6379.
167:M 03 May 2021 00:32:21.702 # Server initialized
167:M 03 May 2021 00:32:21.703 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
I, [2021-05-03T00:32:41.096190 #1]  INFO -- : > cd /var/www/discourse && bash -c "touch -a           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log"
terser '/var/www/discourse/public/assets/_vendor-892d5a1f7dfb58e3f80950989c67133fd6062344153d17e67db8ba3d126c7a1a.js' -m -c -o '/var/www/discourse/public/assets/vendor-892d5a1f7dfb58e3f80950989c67133fd6062344153d17e67db8ba3d126c7a1a.js' --source-map "base='/var/www/discourse/public/assets',root='/assets',url='/assets/vendor-892d5a1f7dfb58e3f80950989c67133fd6062344153d17e67db8ba3d126c7a1a.js.map'"
****************************************************************************************************
#<Thread:0x000055a7feb17780 /var/www/discourse/lib/tasks/assets.rake:239 run> terminated with exception (report_on_exception is true):
/var/www/discourse/lib/tasks/assets.rake:251:in `rescue in block (2 levels) in <main>': undefined local variable or method `name' for main:Object (NameError)
	from /var/www/discourse/lib/tasks/assets.rake:240:in `block (2 levels) in <main>'
/var/www/discourse/lib/file_helper.rb:63:in `block in download': 401 Error: Invalid license key (OpenURI::HTTPError)

도움이 되기를 바랍니다!

app.yml 파일에 MaxMind 라이선스 키를 위한 줄이 있나요? 해당 줄을 제거하고 다시 빌드해 보세요.

감사합니다! 어느 정도 효과가 있는 것 같습니다. 포럼 홈 페이지에 접속하면 “축하합니다, Discourse를 설치했습니다!” 페이지로 이동합니다. 제 질문은 다음과 같습니다:

포럼을 다시 설치해야 합니까? 기존 콘텐츠가 유지되는지, 아니면 모두 삭제되었는지요?

모든 것이 삭제된 것처럼 보이지만, 실제로는 여전히 남아 있을 가능성이 높습니다. 한동안 업데이트를 하지 않으셨나요? PostgreSQL이 업데이트되었나요? 제 추측으로는 PostgreSQL 업데이트 과정에서 문제가 발생하여 postgres_old를 이름 변경하고 처음부터 다시 시작해야 할 것 같습니다. PostgreSQL 13 업데이트에 관련 세부 정보가 있습니다.

Jay, (방금) 떠올랐는데, 이전에 업로드와 백업을 DigitalOcean Block Storage로 이동하려고 시도한 적이 있었습니다. 방금 다시 시도했는데, 홈페이지를 방문하는 동안 “Oops” 오류 메시지가 표시되었습니다:

Oops
이 토론 포럼을 구동하는 소프트웨어에서 예상치 못한 문제가 발생했습니다. 불편을 드려 죄송합니다.

오류에 대한 자세한 정보가 기록되고 자동 알림이 생성되었습니다. 확인해 보겠습니다.

추가 조치는 필요하지 않습니다. 그러나 오류 상태가 지속되는 경우, 오류를 재현하는 단계를 포함하여 추가 세부 정보를 사이트의 피드백 카테고리에 토론 주제를 게시하여 제공할 수 있습니다.

제가 실행한 명령어는 다음과 같습니다:

mv /var/discourse/shared/standalone/postgres_data /var/postgres_data_discourse
mv /var/discourse/shared /mnt/discourse-sfo2-01

app.yml 파일에 다음 내용을 추가했습니다:

## The Docker container is stateless; all data is stored in /shared
volumes:
  - volume:
      host: /mnt/discourse-sfo2-01/shared/standalone
      guest: /shared
  - volume:
      host: /mnt/discourse-sfo2-01/shared/standalone/log/var-log
      guest: /var/log
  - volume:
      host: /var/postgres_data_discourse
      guest: /shared/postgres_data

모든 명령어는 ./launcher rebuild app을 실행했을 때 문제 없이 완료되었습니다.

모든 분들께 죄송합니다. 이 작업을 수행했던 사실을 잊고 있었습니다. 이것이 문제의 원인일 가능성이 높다고 생각합니다.

저도 실패한 재빌드 후에 이 방법으로 해결되었습니다. 여기서 문제가 무엇인가요? 감사합니다!