Discourse 插件安装的问题

最近在把 Discourse 升级到最新版本的时候提示了下面的问题:

/var/www/discourse/plugins
/var/discourse


sv start redis || exit 1 in /etc/service/unicorn/run
I, [2025-07-29T19:50:24.831730 #1]  INFO -- : > cd /var/www/discourse/plugins && git clone https://github.com/discourse/docker_manager.git
Cloning into 'docker_manager'...
I, [2025-07-29T19:50:25.731802 #1]  INFO -- : 
I, [2025-07-29T19:50:25.732019 #1]  INFO -- : > cd /var/www/discourse/plugins && sudo -E -u discourse git clone https://src.isharkfly.com/discourse/discourse-matomo-analytics.git
Cloning into 'discourse-matomo-analytics'...
warning: unable to access '/root/.config/git/ignore': Permission denied
warning: unable to access '/root/.config/git/attributes': Permission denied
I, [2025-07-29T19:50:26.226275 #1]  INFO -- : 
I, [2025-07-29T19:50:26.226507 #1]  INFO -- : > cd /var/www/discourse/plugins && sudo -E -u discourse git clone https://src.isharkfly.com/discourse/discourse-adplugin.git
fatal: destination path 'discourse-adplugin' already exists and is not an empty directory.
I, [2025-07-29T19:50:26.241205 #1]  INFO -- : 
I, [2025-07-29T19:50:26.242279 #1]  INFO -- : Terminating async processes
I, [2025-07-29T19:50:26.242387 #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/15/bin/postmaster -D /etc/postgresql/15/main pid: 45
I, [2025-07-29T19:50:26.242498 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 112
2025-07-29 19:50:26.242 UTC [45] LOG:  received fast shutdown request
112:signal-handler (1753818626) Received SIGTERM scheduling shutdown...
112:M 29 Jul 2025 19:50:26.293 # User requested shutdown...
112:M 29 Jul 2025 19:50:26.294 * Saving the final RDB snapshot before exiting.
2025-07-29 19:50:26.296 UTC [45] LOG:  aborting any active transactions
2025-07-29 19:50:26.300 UTC [45] LOG:  background worker "logical replication launcher" (PID 59) exited with exit code 1
2025-07-29 19:50:26.306 UTC [54] LOG:  shutting down
2025-07-29 19:50:26.363 UTC [54] LOG:  checkpoint starting: shutdown immediate
112:M 29 Jul 2025 19:50:26.723 * DB saved on disk
112:M 29 Jul 2025 19:50:26.723 # Redis is now ready to exit, bye bye...
2025-07-29 19:50:26.987 UTC [54] LOG:  checkpoint complete: wrote 9 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.149 s, sync=0.080 s, total=0.681 s; sync files=7, longest=0.036 s, average=0.012 s; distance=26 kB, estimate=26 kB
2025-07-29 19:50:27.016 UTC [45] LOG:  database system is shut down


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse/plugins && sudo -E -u discourse git clone https://src.isharkfly.com/discourse/discourse-adplugin.git failed with return #<Process::Status: pid 283 exit 128>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.3.0/lib/pups/exec_command.rb:131:in `spawn'
exec failed with the params {"cd"=>"$home/plugins", "cmd"=>["git clone https://github.com/discourse/docker_manager.git", "sudo -E -u discourse git clone https://src.isharkfly.com/discourse/discourse-matomo-analytics.git", "sudo -E -u discourse git clone https://src.isharkfly.com/discourse/discourse-adplugin.git", "sudo -E -u discourse git clone https://src.isharkfly.com/discourse/discourse-rewind.git"]}
bootstrap failed with exit code 128
** 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.
d9611faf24384b39bdfa642fd16626c6ba64fcbda0dfb0dc99ecfe466bb0aa8f

问题和解决

这个问题的原因还是插件的干扰。

有些插件在已经合并到 Core 里面了。

对合并后的插件不能通过修改 app.yml 配置文件中的内容进行安装。

需要从里面给删掉。

比如说的这个 AI 的配置,现在已经是集成到 Core 里,在配置文件中的仓库配置地址就必须要删除。

否则就显示编译不通过。

如果在代码中看到上面的内容,就表示官方已经处理了。

1 Like

相关官网说明

1 Like

这次升级算是一次主要升级。

有不少问题,主要还是插件问题,看来官方的态度应该是只要官方维护的插件就直接集成进来吧。

今天把论坛升级了,唯一出问题的地方是https://gems.ruby-china.com/ 的ssl证书今天过期,上午还没有更换,所以无法下载gems包。

更换ustc源或者清华源 报错 ERROR: Could not find a valid gem ‘bundler’ (= 2.5.18) in any repository

可能是因为机器分配没有ipv6地址,而容器内解析到镜像站ipv6的ip。

ustc源和清华源都支持ipv4,ruby-china只支持ipv4。

关闭docker的ipv6或许能解决问题,但是我不想站点下线,所以等下午ruby-china镜像配置完新证书之后再升级,一次成功。

看了下,确实 SSL 是昨天才更新的。

做为一个这么打的网站来说没有关注到 SSL,现在很多 SSL 都是自动更新的,而且使用 HTTPS 是标准配置了。

还是有点不应该。