重建失败,正在运行 2.8.9

您好,

一段时间以来,我们的实例无法升级,重建失败。正在Docker中运行Discourse 2.8.9。已尝试升级到2.8.10和2.8.13。

./launcher rebuild app
...
I, [2022-12-01T12:10:27.197669 #1]  INFO -- : cd /var/www/discourse && su discourse -c 'bundle exec rake plugin:pull_compatible_all'
bundler: failed to load command: rake (/var/www/discourse/vendor/bundle/ruby/2.7.0/bin/rake)
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/runtime.rb:308:in `check_for_activated_spec!': You have already activated uri 0.10.0, but your Gemfile requires uri 0.11.0. Since uri is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports uri as a default gem. (Gem::LoadError)
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/runtime.rb:25:in `block in setup'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/spec_set.rb:155:in `each'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/spec_set.rb:155:in `each'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/runtime.rb:24:in `map'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/runtime.rb:24:in `setup'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler.rb:162:in `setup'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/setup.rb:20:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/ui/shell.rb:136:in `with_level'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/ui/shell.rb:88:in `silence'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/setup.rb:20:in `<top (required)>'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:56:in `require_relative'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:56:in `kernel_load'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:23:in `run'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli.rb:486:in `exec'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli.rb:31:in `dispatch'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli.rb:25:in `start'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/exe/bundle:48:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/exe/bundle:36:in `<top (required)>'
	from /usr/local/bin/bundle:23:in `load'
	from /usr/local/bin/bundle:23:in `<main>'
I, [2022-12-01T12:10:27.537797 #1]  INFO -- : 
I, [2022-12-01T12:10:27.538882 #1]  INFO -- : cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
bundler: failed to load command: rake (/var/www/discourse/vendor/bundle/ruby/2.7.0/bin/rake)
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/runtime.rb:308:in `check_for_activated_spec!': You have already activated uri 0.10.0, but your Gemfile requires uri 0.11.0. Since uri is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports uri as a default gem. (Gem::LoadError)
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/runtime.rb:25:in `block in setup'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/spec_set.rb:155:in `each'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/spec_set.rb:155:in `each'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/runtime.rb:24:in `map'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/runtime.rb:24:in `setup'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler.rb:162:in `setup'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/setup.rb:20:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/ui/shell.rb:136:in `with_level'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/ui/shell.rb:88:in `silence'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/setup.rb:20:in `<top (required)>'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:56:in `require_relative'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:56:in `kernel_load'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:23:in `run'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli.rb:486:in `exec'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli.rb:31:in `dispatch'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli.rb:25:in `start'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/exe/bundle:48:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/exe/bundle:36:in `<top (required)>'
	from /usr/local/bin/bundle:23:in `load'
	from /usr/local/bin/bundle:23:in `<main>'
I, [2022-12-01T12:10:27.859901 #1]  INFO -- : 
I, [2022-12-01T12:10:27.861085 #1]  INFO -- : Terminating async processes
I, [2022-12-01T12:10:27.861874 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 31
31:signal-handler (1669896627) Received SIGTERM scheduling shutdown...
31:M 01 Dec 2022 12:10:27.961 # User requested shutdown...
31:M 01 Dec 2022 12:10:27.963 * Saving the final RDB snapshot before exiting.
31:M 01 Dec 2022 12:10:28.025 * DB saved on disk
31:M 01 Dec 2022 12:10:28.027 # 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 4804 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'"]}
fde0a026f0cd2470f6fa579009db125a783db4115eab6d151389446042e22119
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.

2.8.10之前的升级都没有问题。一些进一步的信息:

系统:
Debian 11 Bullseye
8GB 内存
充足的可用磁盘空间
Postgres 通过 PGDG 仓库安装,不在容器中运行。
插件:仅预装的 docker_manager, styleguide
组件:Custom Header Links

app.yml


templates:
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"

version: stable

app.yml 使用了 standalone.yml 模板

这意味着您有一个不兼容的插件。可以分享您的插件列表吗?

from app.yml

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git

那么我可以直接删除这一行然后重试吗?

1 个赞

从未见过此错误,也没有任何非捆绑插件,这很奇怪。可以分享一下重建的完整日志吗?

您是否运行的是独立的 Web 和数据容器?

今年早些时候,我曾遇到过一个类似的错误,当时数据容器已过时,Redis 需要升级。

哪个版本?我们绝对需要有关您安装的更多信息。

1 个赞

作为新用户,我无法上传附件,并且日志比允许的帖子长度长。你能给我上传附件的权限吗?

你是否运行独立的 Web 和数据容器?

不,只有一个应用程序容器。

哪个版本?我们绝对需要更多关于你的安装信息。

当然。我们使用 PostgreSQL 13。

感谢快速回复。

当 bundler 或 rubygems 的版本过旧时,就会发生此错误。

这是标准安装吗?
您是否执行了命令行重建?
git 是否拉取了新版本?
git 拉取的是 main 而不是 master 吗?

2 个赞

这是 标准安装 吗?

大部分是。我们使用 Nginx 作为反向代理。

您是否执行了命令行重建?

是的

git 是否拉取了新版本?

是的

git 是否拉取的是 main 而不是 master

它从 master 拉取的。我已将其更改为 main,但构建错误相同。

更新:我犯了一个错误。更改远程分支解决了问题。非常感谢!

4 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.