Beta/tests-passed サンプルコンテナが起動しない

この旅に乗り出す前に、この問題はすでにフォーラムで2回(12)言及されているにもかかわらず、「データコンテナの再構築」という解決策が機能しなかったことに注意してください。私は完全に空のデータで作業しており、試行ごとにすべてのコンテナ/ボリューム/ストレージフォルダを削除しています。

また、提供されたサンプルファイルに基づいてテストを行っていることにも注意してください。これはプラグインではなく、すべてのプラグインを削除してみました。


最新の tests-passed および beta ブランチの 空の コンテナの起動に問題があります。Stable は期待どおりに動作します。エラーは standalone または web-only(もちろん data を起動した後)で発生します。

設定エラーを除外するために、次の手順を実行しました。

  • samples/standalone.yml ファイルを containers/ にコピーしました。
  • ファイル内で 次のもののみ を変更しました。
    • SMTPアドレスをダミー値に変更しました。
    • ディスコースアドレスをダミー値に変更しました。
    • 共有データの場所を変更しました。
    • 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`

Gemfileと.gemspecが適切に制限されており、3.0がリリースされたときに予期しない破損が発生しないようにしてください(例:~> 2.3.0)。詳細については、https://github.com/rubyzip/rubyzip を参照してください。チェンジログには、バージョン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 -- : 

2つのコンテナアプローチ(dataweb_only)も試しましたが、web_only は同じ問題を抱えています。

各試行の間、すべてのコンテナを停止・削除し、すべてのデータフォルダも削除しています。

Stableブランチは正常に動作します。これは予期されたことではないと思います。


文脈を説明するために、私はかなりまずい状況にいます。
数日中に現在のサーバーがシャットダウンされるため、現在のサーバーから新しいサーバーへDiscourseのインストールを緊急に移行する必要があります。

現在のサーバーは 2.9.0.beta7 です。新しいサーバーを 2.8.6 で起動することはできますが、ダウングレードであるため、現在のサーバーからのバックアップを新しいサーバーに適用することはできません。また、2.9.0.beta7 で新しい空のサーバーを起動することもできません。上記のエラーが発生するだけです。

現在のサーバーのデータフォルダは十分に大きいですが、ディスクに容量がなく、それを圧縮してどこかにコピーすることはできません。たとえできたとしても、より新しいベータ版のデータを使用すると古いバージョンで問題が発生すると想定されます。念のため、現在のサーバーを「ダウングレード」しようとしましたが、サポートされていないことは承知しており、いずれにしても機能しませんでした。

なぜダウングレードを強制されるのですか?ターゲットホストを最新の状態にできないのはなぜですか?

「いいね!」 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
  - exec:
      cd: $home
      cmd:
        - su discourse -c 'gem update uri'

の約160行目の bundle install と書かれた行の下に、以下の行をコピーしてください。

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.yml でも standalone.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.