您好,
我正在将 Discourse 从 v2.3.0.beta8 +212 升级到 2.4.0.beta1。
首先,我通过 Web UI 升级了 Docker 管理器。随后,Web UI 提示我需要在命令行中进行升级,于是我便照做了。
在升级过程中,我反复遇到错误。我执行了以下命令:
cd /var/discourse
su ./launcher rebuild app
该命令运行几分钟后,在数据库升级步骤失败。我重启了服务器,Discourse 恢复运行(但未完成升级),然后再次尝试升级,结果仍是相同的错误。
对于接下来的操作,您有什么建议吗?
以下是我运行 rebuild 时最后出现的几行日志:
Optimizing site icons...
I, [2019-07-09T01:22:18.589503 #13] INFO -- : Terminating async processes
I, [2019-07-09T01:22:18.589624 #13] 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/10/bin/postmaster -D /etc/postgresql/10/main pid: 67
I, [2019-07-09T01:22:18.589816 #13] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 183
2019-07-09 01:22:18.589 UTC [67] LOG: received fast shutdown request
183:signal-handler (1562635338) Received SIGTERM scheduling shutdown...
2019-07-09 01:22:18.593 UTC [67] LOG: aborting any active transactions
2019-07-09 01:22:18.599 UTC [67] LOG: worker process: logical replication launcher (PID 76) exited with exit code 1
2019-07-09 01:22:18.599 UTC [71] LOG: shutting down
2019-07-09 01:22:18.629 UTC [67] LOG: database system is shut down
183:M 09 Jul 2019 01:22:18.645 # User requested shutdown...
183:M 09 Jul 2019 01:22:18.645 * Saving the final RDB snapshot before exiting.
183:M 09 Jul 2019 01:22:18.672 * DB saved on disk
183:M 09 Jul 2019 01:22:18.672 # 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 366 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
cbaaf74d12f5c22faf7f054d391f3570b5e7d8dd3b8bce421c57ef17c4b43c55
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one
编辑:完整日志中唯一的错误是以下这些:
I, [2019-07-09T01:21:35.162142 #13] INFO -- : > su postgres -c 'createdb discourse' || true
2019-07-09 01:21:35.330 UTC [80] postgres@postgres ERROR: database "discourse" already exists
2019-07-09 01:21:35.330 UTC [80] postgres@postgres STATEMENT: CREATE DATABASE discourse;
createdb: database creation failed: ERROR: database "discourse" already exists
I, [2019-07-09T01:21:35.332706 #13] INFO -- :
I, [2019-07-09T01:21:35.333101 #13] INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2019-07-09 01:21:35.444 UTC [91] postgres@discourse ERROR: role "discourse" already exists
2019-07-09 01:21:35.444 UTC [91] postgres@discourse STATEMENT: create user discourse;
ERROR: role "discourse" already exists
我注意到它在“Optimizing Site Icons…”之后便退出了——也许这里存在问题?