多站点/多容器Discourse实例升级问题

你好,

我正在尝试将一个 Discourse 实例从 2.8.0.beta8 (0ededb1454) 升级到 2.9.0.beta4。

到目前为止一切顺利,但这次,我在尝试引导我的新 web_only 容器时遇到了一个错误。

这是一个多站点安装和多容器(web_onlydata)设置。

它卡在以下位置:

I, [2022-05-13T05:52:47.051709 #1]  INFO -- : > cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite: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-13T05:52:47.425596 #1]  INFO -- : 

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse &amp;&amp; sudo -E -u discourse bundle exec rake multisite:migrate failed with return #&lt;Process::Status: pid 6089 exit 1&gt;
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params "cd /var/www/discourse &amp;&amp; sudo -E -u discourse bundle exec rake multisite:migrate"
df18312b372c1b6866b4219c5f8678dbcab50711a643f7ed8d627cae998d59e9
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.

./discourse-doctor 关于插件和容器的摘录:

==================== DOCKER INFO ====================
DOCKER VERSION: Docker version 19.03.13, build 4484c46d9d

DOCKER PROCESSES (docker ps -a)

CONTAINER ID        IMAGE                      COMMAND             CREATED             STATUS              PORTS                      NAMES
ef7f5c75b666        local_discourse/web_only   “/sbin/boot”        7 months ago        Up 2 months         127.0.0.1:8800->80/tcp     web_only
418c82bdeb7b        local_discourse/data       “/sbin/boot”        14 months ago       Up 2 months         127.0.0.1:5432->5432/tcp   data

ef7f5c75b666        local_discourse/web_only   “/sbin/boot”        7 months ago        Up 2 months         127.0.0.1:8800->80/tcp     web_only

Discourse container web_only is running


==================== PLUGINS ====================
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-solved.git
          - git clone https://github.com/discourse/discourse-bbcode.git
          - git clone https://github.com/discourse/discourse-whos-online.git
          - git clone https://github.com/discoursehosting/discourse-migratepassword.git
          - git clone https://github.com/discourse/discourse-github.git

No non-official plugins detected.

有什么解决办法吗?

谢谢!

1 个赞

可能与以下内容相关

https://github.com/rubygems/rubygems/issues/5016#issuecomment-951808558

1 个赞

您在使用 pg13 吗?

您大概可以移除 migrate password 插件。

但其他建议的问题可能是原因所在。

1 个赞

嘿,感谢您的回复 @pfaffman

是的:

psql (13.2 (Debian 13.2-1.pgdg100+1))

我尝试注释掉 migratepassword 插件,但错误相同。

有什么办法可以解决这个问题吗?

我的理解是,所有的依赖项都在构建的容器内完成,所以我不知道为什么它会卡在这里:

/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)

而且我不明白 uri 的引用,因为它不在 Gemfile 中

1 个赞

在流程开始时,我们有

I, [2022-05-13T18:22:51.511137 #1]  INFO -- : Running `bundle install --deployment --jobs 4 --retry 3 --verbose --without \"test\" \"development\"` with bundler 2.3.13
Frozen, using resolution from the lockfile
The definition is missing [\"bootsnap-1.11.1\", \"actionmailer-7.0.3\", \"actionpack-7.0.3\", \"actionview-7.0.3\", \"activemodel-7.0.3\", \"activerecord-7.0.3\", \"activesupport-7.0.3\", \"railties-7.0.3\", \"sprockets-rails-3.4.2\", \"json-2.6.1\", \"mail-2.8.0.rc1\", \"mini_mime-1.1.2\", \"mini_suffix-0.3.3\", \"redis-4.5.1\", \"redis-namespace-1.8.2\", \"discourse-fonts-0.0.9\", \"message_bus-4.2.0\", \"rails_multisite-4.0.1\", \"fastimage-2.2.6\", \"aws-sdk-s3-1.114.0\", \"aws-sdk-sns-1.53.0\", \"excon-0.92.3\", \"image_optim-0.31.1\", \"nokogiri-1.13.6-x86_64-linux\", \"loofah-2.17.0\", \"css_parser-1.11.0\", \"omniauth-facebook-9.0.0\", \"omniauth-oauth2-1.7.2\", \"oj-3.13.11\", \"pg-1.3.5\", \"mini_sql-1.4.0\", \"rake-13.0.6\", \"thor-1.2.1\", \"sidekiq-6.4.2\", \"mini_racer-0.6.2\", \"rack-protection-2.2.0\", \"addressable-2.8.0\", \"json_schemer-0.2.21\", \"fast_blank-1.0.1\", \"rack-mini-profiler-3.0.0\", \"unicorn-6.1.0\", \"puma-5.6.4\", \"rss-0.2.9\", \"stackprof-0.2.19\", \"cppjieba_rb-0.4.2\", \"lograge-0.12.0\", \"logster-2.11.2\", \"rqrcode-2.1.1\", \"rubyzip-2.3.2\", \"sanitize-6.0.0\", \"rails_failover-0.8.1\", \"net-http-0.2.2\", \"msgpack-1.5.1\", \"activejob-7.0.3\", \"net-imap-0.2.3\", \"net-pop-0.1.1\", \"net-smtp-0.3.1\", \"rails-html-sanitizer-1.4.2\", \"concurrent-ruby-1.1.10\", \"i18n-1.10.0\", \"minitest-5.15.0\", \"zeitwerk-2.5.4\", \"ffi-1.15.5\", \"aws-sdk-core-3.130.2\", \"aws-sdk-kms-1.56.0\", \"aws-sigv4-1.5.0\", \"unf_ext-0.0.8.1\", \"image_size-3.0.1\", \"in_threads-1.6.0\", \"racc-1.6.0\", \"hashie-5.0.0\", \"jwt-2.3.0\", \"libv8-node-16.10.0.0-x86_64-linux\", \"public_suffix-4.0.7\", \"ecma-re-validator-0.4.0\", \"regexp_parser-2.4.0\", \"raindrops-0.20.0\", \"nio4r-2.5.8\", \"rexml-3.2.5\", \"request_store-1.5.1\", \"rqrcode_core-1.2.0\", \"uri-0.11.0\", \"globalid-1.0.0\", \"digest-3.1.0\", \"net-protocol-0.1.3\", \"strscan-3.0.3\", \"timeout-0.2.0\", \"aws-eventstream-1.2.0\", \"aws-partitions-1.583.0\", \"jmespath-1.6.1\", \"oauth-0.5.10\", \"faraday-1.10.0\", \"openssl-2.2.1\", \"faraday-httpclient-1.0.1\", \"faraday-multipart-1.0.3\", \"faraday-net_http_persistent-1.2.0\", \"faraday-patron-1.0.0\", \"faraday-rack-1.0.0\", \"faraday-retry-1.0.3\", \"ruby2_keywords-0.0.5\", \"ipaddr-1.2.4\"]

"uri-0.11.0"

该死,这让我抓狂 :triumph:

会不会是 bundler 的版本冲突?

/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13

以及 Gemfile 中的 2.9.0.beta4

BUNDLED WITH
   2.3.5
1 个赞

您好 Jean,

它是在这里引入的:

1 个赞

您好 @Benjamin_D,感谢您的提示,

我通过手动将提交引用 a9a643bcdc5808802a5a0d73f107cc3a63e2e095 写入我的 .yml 中的 params: version:,成功升级到了 2.8.3

我将尝试分步升级。

2 个赞

尝试升级到 2.9.0.beta4(非多站点)时出现完全相同的错误。

1 个赞

升级到 beta2 是可以的。


升级到 beta3 不行。


经过调查,我需要重建我的 data 容器来升级 Redis 到 6.2。

4 个赞

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