几个月前遇到了一些问题,最终不得不回退到 2.9.0.beta1,当时无法进一步更新。
由于各种特殊情况,我不得不暂时搁置这个项目,现在才得以重新开始。我发现根本问题在于 PostgreSQL 数据库服务器未得到充分且正确的升级,现在这个问题已解决,它运行在 PostgresQL 14.x 版本,Discourse 也正在使用此版本的数据库。
不幸的是,当我尝试通过常规的 Web 管理员升级用户界面进行升级时,它显示 fatal: HEAD does not point to a branch(完整错误在此):
fatal: HEAD does not point to a branch
Docker Manager: FAILED TO UPGRADE
#<RuntimeError: RuntimeError>
/var/www/discourse/plugins/docker_manager/lib/docker_manager/upgrader.rb:203:in `run'
...
我曾以为也许可以执行 /var/discourse/launcher rebuild app,但结果也未能奏效,只是重新启动了相同的版本,但我确实注意到了以下输出:
$ ./launcher rebuild app
x86_64 arch detected.
WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed
Please be patient
2.0.20220818-0047: Pulling from discourse/base
1efc276f4ff9: Pull complete
1b880e64942b: Pull complete
794f6dc9a2ff: Pull complete
Digest: sha256:7734701087766821ffb2ddcef423754798bd345c2ac0d550131c6e6905c268e8
Status: Downloaded newer image for discourse/base:2.0.20220818-0047
docker.io/discourse/base:2.0.20220818-0047
...
I, [2022-09-13T02:09:12.828649 #1] INFO -- : Replacing # redis with sv start redis || exit 1 in /etc/service/unicorn/run
I, [2022-09-13T02:09:12.829826 #1] INFO -- : > cd /var/www/discourse/plugins && git clone https://github.com/discourse/docker_manager.git
Cloning into 'docker_manager'...
I, [2022-09-13T02:09:13.957219 #1] INFO -- :
I, [2022-09-13T02:09:13.958187 #1] INFO -- : > cd /var/www/discourse && git fetch --depth=1 origin tag v2.9.0.beta2 --no-tags
From https://github.com/discourse/discourse
* [new tag] v2.9.0.beta2 -> v2.9.0.beta2
I, [2022-09-13T02:09:18.214516 #1] INFO -- :
I, [2022-09-13T02:09:18.215535 #1] INFO -- : > cd /var/www/discourse && git checkout v2.9.0.beta2
Note: switching to 'v2.9.0.beta2'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 88a85843 FIX: Cooking custom emojis should not use a secure URL (#15929)
I, [2022-09-13T02:09:19.557296 #1] INFO -- :
...
我最终通过恢复备份撤销了这些更改,并认为我应该先在这里寻求一些建议,关于如何才能以及应该如何将 Discourse 正确地重新连接到 main 上的 HEAD 并开始使用最新的测试版进行构建——然后在我终于将它更新到最新版本后,我想在未来将其锁定到一个稳定的版本更新。我曾使用测试版来解决过去一年中遇到的问题,但这对我来说已经是一次足够的冒险了。![]()