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