Beta/tests-passed 样本容器未启动

在我陪你踏上这段旅程之前,请注意,虽然此错误已在此论坛中提及两次(一次两次),但“重建数据容器”的解决方案并未奏效。我使用的是完全空白的数据,并且在每次尝试之间删除所有容器/卷/存储文件夹。

另请注意,我的测试基于提供的示例文件。这不是插件,我尝试删除了所有插件。


我在启动最新的 tests-passedbeta 分支的 空白 容器时遇到问题。Stable 按预期工作。错误发生在 standaloneweb-only(当然,在启动 data 之后)。

为了排除配置错误,我执行了以下步骤:

  • samples/standalone.yml 文件复制到 containers/
  • 更改了文件中的以下内容:
    • 将 SMTP 地址更改为虚拟值
    • 将 discourse 地址更改为虚拟值
    • 更改了共享数据的存储位置
    • 删除了 443,并更改了端口 80 映射。这是结果 standalone.yml
    • 运行 ./laucher rebuild standalone。这是完整的日志 rebuilding_standalone.txt

我收到了以下错误:

RubyZip 3.0 is coming!
**********************

一些 RubyZip 类的公共 API 已现代化,以使用命名参数作为可选参数。请检查您对以下类的使用情况:
  * `Zip::File`
  * `Zip::Entry`
  * `Zip::InputStream`
  * `Zip::OutputStream`

请确保您的 Gemfiles 和 .gemspecs 具有足够的限制性,以避免在 3.0 发布时出现意外中断(例如,~> 2.3.0)。
有关详细信息,请参阅 https://github.com/rubyzip/rubyzip。Changelog 还列出了自 2.3.0 版本以来已实现的其它增强功能和错误修复。

I, [2022-07-24T01:58:05.415957 #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.18/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.18/lib/bundler/runtime.rb:25:in `block in setup'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/spec_set.rb:140:in `each'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/spec_set.rb:140:in `each'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/runtime.rb:24:in `map'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/runtime.rb:24:in `setup'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler.rb:162:in `setup'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/setup.rb:20:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/ui/shell.rb:136:in `with_level'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/ui/shell.rb:88:in `silence'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/setup.rb:20:in `<top (required)>'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/cli/exec.rb:56:in `require_relative'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/cli/exec.rb:56:in `kernel_load'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/cli/exec.rb:23:in `run'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/cli.rb:483:in `exec'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/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.18/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/cli.rb:31:in `dispatch'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/cli.rb:25:in `start'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/exe/bundle:48:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/exe/bundle:36:in `<top (required)>'
	from /usr/local/bin/bundle:23:in `load'
	from /usr/local/bin/bundle:23:in `<main>'
I, [2022-07-24T01:58:05.702191 #1]  INFO -- : 
I, [2022-07-24T01:58:05.702665 #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.18/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.18/lib/bundler/runtime.rb:25:in `block in setup'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/spec_set.rb:140:in `each'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/spec_set.rb:140:in `each'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/runtime.rb:24:in `map'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/runtime.rb:24:in `setup'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler.rb:162:in `setup'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/setup.rb:20:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/ui/shell.rb:136:in `with_level'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/ui/shell.rb:88:in `silence'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/setup.rb:20:in `<top (required)>'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/cli/exec.rb:56:in `require_relative'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/cli/exec.rb:56:in `kernel_load'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/cli/exec.rb:23:in `run'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/cli.rb:483:in `exec'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/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.18/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/cli.rb:31:in `dispatch'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/cli.rb:25:in `start'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/exe/bundle:48:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
	from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/exe/bundle:36:in `<top (required)>'
	from /usr/local/bin/bundle:23:in `load'
	from /usr/local/bin/bundle:23:in `<main>'
I, [2022-07-24T01:58:05.953429 #1]  INFO -- : 

我还尝试了两种容器的方法,使用 dataweb_only。Web only 遇到了同样的问题。

在每次尝试之间,我都会停止并移除所有容器,并且还移除所有数据文件夹。

Stable 分支工作正常。我不认为这是预期的。


为了提供背景信息,我现在处境相当糟糕。
我需要_紧急_将我的 discourse 安装从当前服务器迁移到新服务器,因为当前服务器将在几天内关闭。
当前服务器是 2.9.0.beta7。我可以启动一个 2.8.6 的新服务器,但我无法将当前服务器的备份应用到新服务器,因为这是降级。而且我无法在 2.9.0.beta7 上启动一个全新的空服务器,因为它会报上述错误。
我当前服务器的数据文件夹足够大,以至于我没有足够的磁盘空间来压缩它并将其复制到别处;即使我做了,我也假设将来自较新 beta 版本的数据用于旧版本会有后果。我也尝试“降级”当前服务器,以防万一,但我知道这是不受支持的,而且它根本不起作用。

您为什么被迫降级?为什么不能确保目标主机是最新的?

2 个赞

我不想降级。但根据我在此帖子中提供的错误消息,我无法在 2.9.0.beta7 上启动新服务器。我只能在 2.8.6 上启动新服务器。我尝试了基于示例文件和我的自己文件的几种不同配置,但 betatests-passed 都无法启动。不确定这些信息在第一条消息、容器文件或日志文件中是否足够清晰。

公平地说,我只需要确保我能将数据从一个服务器迁移到另一个服务器。具体版本并不重要,但我需要一个新服务器启动并运行,然后将旧数据迁移到新服务器。

旧服务器目前是 2.9.0.beta7。所以,我需要一个新服务器能够启动最新版本(目前不起作用),或者我需要一种方法将数据迁移到新的 2.8.6,这是我唯一能启动它的版本。

1 个赞

明白了。所以需要关注那个错误吗?

理想情况下是这样。获取最新版本的服务器对我来说是最简单、最容易的。

但如果出于任何原因不可行,如果还有其他我能使用的解决方法,我也很乐意。我无法坚持版本纯粹性。

另外,如果这对您有帮助,这是服务器上的 docker 信息:

# docker info
Client:
 Context:    default
 Debug Mode: false

Server:
 Containers: 2
  Running: 0
  Paused: 0
  Stopped: 2
 Images: 5
 Server Version: 20.10.12
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: nvidia runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
 Default Runtime: runc
 Init Binary: docker-init
 containerd version:
 runc version:
 init version:
 Security Options:
  apparmor
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.15.0-41-generic
 Operating System: Ubuntu 22.04 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 5.797GiB
 Name: maji
 ID: OIRP:TYAE:HIPS:SIF3:NZRF:22QI:GO5A:64A4:OP2O:ALVA:PPLN:4TOH
 Docker Root Dir: /data/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

我以 root 用户的身份运行启动器。现在,我已经在配置相同的机器上运行了各种 docker 容器,并且没有遇到任何问题。

现在,我不确定问题是否可能是文件权限,错误根本没有让我这样认为。

/opt/discourse# ls -la
total 140
drwxr-xr-x 14 root root  4096 Jul 24 01:26 .
drwxr-xr-x  7 root root  4096 Jul 15 07:23 ..
drwxr-xr-x  8 root root  4096 Jul 24 02:30 .git
drwxr-xr-x  3 root root  4096 Jul 15 07:23 .github
-rw-r--r--  1 root root   309 Jul 15 07:23 .gitignore
-rw-r--r--  1 root root  1099 Jul 15 07:23 LICENSE
-rw-r--r--  1 root root  8285 Jul 15 07:23 README.md
drwxr-xr-x  2 root root  4096 Jul 15 07:23 bin
drwxr-xr-x  2 root root  4096 Jul 24 02:34 cids
drwxr-xr-x  2 root root  4096 Jul 24 02:30 containers
-rwxr-xr-x  1 root root 11956 Jul 15 07:23 discourse-doctor
-rwxr-xr-x  1 root root 27053 Jul 15 07:23 discourse-setup
drwxr-xr-x  8 root root  4096 Jul 15 07:23 image
-rwxr-xr-x  1 root root 22547 Jul 15 07:23 launcher
drwxr-xr-x  2 root root  4096 Jul 24 01:39 samples
drwxr-xr-x  2 root root  4096 Jul 15 07:23 scripts
drwxr-xr-x  2 root root  4096 Jul 15 07:23 shared
drwxr-xr-x  3 root root  4096 Jul 15 07:23 templates
drwxr-xr-x  2 root root  4096 Jul 15 07:23 tests
/opt/discourse# ls -la containers/
total 16
drwxr-xr-x  2 root root 4096 Jul 24 02:30 .
drwxr-xr-x 14 root root 4096 Jul 24 01:26 ..
-rw-r--r--  1 root root    0 Jul 15 07:23 .gitkeep
-rw-r--r--  1 root root 1258 Jul 24 02:08 data.yml
-rw-r--r--  1 root root 3542 Jul 24 02:30 web.yml
/opt/discourse# cd /data/discourse/
/data/discourse# ls -la
total 16
drwxr-xr-x 4 root root 4096 Jul 24 02:06 .
drwxr-xr-x 5 root root 4096 Jul 23 11:58 ..
drwxr-xr-x 6 root root 4096 Jul 24 02:09 data
drwxr-xr-x 7 root root 4096 Jul 24 02:34 web

尝试将以下行复制到 bundle install 行下方(大约在第 160 行)

  - exec:
      cd: $home
      cmd:
        - su discourse -c 'gem update uri'

我尝试在 run 块中 exec: echo \"Beginning of custom commands\" 的下方添加,但似乎太晚了。

所以我将其添加到了 hooks: -> after_code:

我得到了这个:

I, [2022-07-24T12:13:24.641982 #1]  INFO -- : > cd /var/www/discourse & su discourse -c 'gem update uri'
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/local/lib/ruby/gems/2.7.0 directory.
I, [2022-07-24T12:13:29.392041 #1]  INFO -- : Updating installed gems
Updating uri

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'gem update uri' failed with return #<Process::Status: pid 132 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "cmd"=>["su discourse -c 'gem update uri'"]}

我继续并删除了 su discourse,以防万一有帮助。这似乎进展顺利,然后我遇到了另一个错误:

I, [2022-07-24T12:21:17.497935 #1]  INFO -- : > cd /var/www/discourse & su discourse -c 'bundle exec rake themes:update assets:precompile'
sh: 1: yarn: not found
I, [2022-07-24T12:21:19.397390 #1]  INFO -- :


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 5373 exit 127>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'

我以为我应该手动安装 yarn?我删除了所有插件,包括 docker_manager,以防万一。它仍然要求 yarn,所以我想我还是应该安装它:

I, [2022-07-24T12:37:42.295754 #1]  INFO -- : > cd /var/www/discourse & su discourse -c 'bundle exec rake plugin:pull_compatible_all'
WARNING: Plugins were activated before running `rake plugin:pull_compatible_all`
  You should prefix this command with LOAD_PLUGINS=0
I, [2022-07-24T12:37:44.807237 #1]  INFO -- :
I, [2022-07-24T12:37:44.807548 #1]  INFO -- : > cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate'
I, [2022-07-24T12:37:48.578845 #1]  INFO -- :
I, [2022-07-24T12:37:48.579098 #1]  INFO -- : > cd /var/www/discourse & su discourse -c 'bundle exec rake themes:update assets:precompile'
error Command "ember" not found.
I, [2022-07-24T12:37:50.795001 #1]  INFO -- : yarn run v1.22.19
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.



FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 5409 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"assets_precompile", "cmd"=>["su discourse -c 'bundle exec rake themes:update assets:precompile'"]}

所以它开始抱怨 ember。即使我尝试手动安装它。

这是我目前的 after_code 配置:

hooks:
  after_code:
    - exec:
        cd: $home
        cmd:
          - gem update uri
          - npm install -g yarn
          - npm install -g ember
        #- exec:
        # cd: $home/plugins
        #cmd:
            #- git clone https://github.com/discourse/docker_manager.git

我不确定这是否是正确的路径。

好消息是,这个命令现在似乎正在执行。

我之前注意到缺少 LOAD_PLUGINS,但没有提及。您是删除了它吗?它在原始模板中。如果您修改了模板,最好看看还有哪些地方您做了更改。或者您可能使用的是旧版本。您在重建应用程序之前执行了 git pull 吗?

3 个赞

我没动那个。我在 web_only.ymlstandalone.yml 示例文件中都找不到它。我没有添加它,但那只是一个警告,我猜?

我遇到的错误与 ember 有关,与插件无关。


说实话,我执行了无数次的 git pull,但它相当稳定,没有拉取新的提交。

当我获取提交的确切链接时,我意识到我的自动化检出了 master 分支,我猜那甚至不会给出警告或任何东西。只要我检出了 main,它就起作用了。它似乎是去年更改的。

1 个赞

我知道,但缺少 LOAD_PLUGINS=0 是我判断你正在运行一个旧版本仓库的信号。

1 个赞

启动器开头应该有一个日志行,说明我正在运行的是旧版分支。这将节省大量精力。

我不知道启动器是否期望它会自动更改 git 分支,但对我来说肯定没有发生。

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