Rebuild 失败并出现错误

我的论坛运行了一段时间,在尝试从当前版本 2.8.0.beta7 升级时,出现了错误:


I, [2022-05-17T07:29:17.860652 #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.13/lib/bundler/runtime.rb:309: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.13/lib/bundler/runtime.rb:25:in `block in setup'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/spec_set.rb:136:in `each'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/spec_set.rb:136:in `each'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/runtime.rb:24:in `map'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/runtime.rb:24:in `setup'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler.rb:151:in `setup'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/setup.rb:20:in `block in <top (required)>'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/ui/shell.rb:136:in `with_level'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/ui/shell.rb:88:in `silence'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/setup.rb:20:in `<top (required)>'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/cli/exec.rb:56:in `require_relative'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/cli/exec.rb:56:in `kernel_load'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/cli/exec.rb:23:in `run'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/cli.rb:483:in `exec'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/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.13/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/cli.rb:31:in `dispatch'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/cli.rb:25:in `start'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/exe/bundle:48:in `block in <top (required)>'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
        from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/exe/bundle:36:in `<top (required)>'
        from /usr/local/bin/bundle:23:in `load'
        from /usr/local/bin/bundle:23:in `<main>'
I, [2022-05-17T07:29:18.139287 #1]  INFO -- :

我不确定为什么依赖 gem 不一致。

这是我所做的:

  1. 登录服务器并执行 github pull
  2. 执行 ./launcher rebuild app
    2.1 除了 docker-manager 之外没有其他插件。
  3. 我尝试了几次,也尝试了 ./discourse-docter,但出现了相同的错误。
  4. 我有一个容器 data 来存储数据。

请帮忙,因为网站已离线 :frowning:

尝试重建数据容器,然后重建 Web 容器。

谢谢回复。

我尝试重建数据容器,但仍然是同样的错误。

您也许可以尝试运行

  ./launcher start app

来重启论坛

抱歉,那行不通,因为没有应用程序容器。

不过,我已将版本从 tests-passed 更改为 stable,然后就可以安装所有 gem 了。论坛已恢复在线。不确定有什么区别,以及为什么会这样。

1 个赞

那么你应该使用你的容器的名称。

    ./launcher start web_only

但你的解决方案奏效了!

抱歉,我的意思是将 yml 文件设置为 data.yml,所以可以是
./launcher start data
但是,在构建过程中出现了错误,docker 容器无法构建。所以我认为无法通过上述命令行启动。
无论如何,如果有人看到类似的情况,或者找到解决方案,请在此分享。
谢谢。

请分享您的 app.yml 插件列表。您有一个插件与最新的 Discourse 冲突。

1 个赞

但你没有尝试过吗?如果重新构建失败,通常可以重新启动旧的/现有的容器。

这很难理解。

看起来这是一个插件问题,但他也说:

但是自从

所以,他似乎又恢复在线了。

2 个赞

你说得对,./launcher start app 会启动旧容器。

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

这是我唯一的插件。

我再次尝试,只使用此插件,我可以确认如果我将版本更改为 tests-passed,它将以上述错误失败。但如果我更改为 stable,它工作正常。

实际上,当我添加更多版本为 stable 的插件时,我仍然能够构建应用程序。所以我不认为这确实是我的插件问题。