別々のRedisの設定でエラー

ローカルネットワーク内でPostgreSQLを実行している半ば怠惰なデータベースサーバーがあり、Discourseにも使用したいと考えていました。その理由は、Webサーバーは前述のデータベースサーバーよりもはるかに負荷が高く、まだ多くの未使用のリソース/潜在能力があるためです。DiscourseのPostgreSQLのリダイレクトは、このフォーラムのいくつかのスレッド()に従って比較的簡単でした。しかし、Redisについても同様のことを試みると:

  • - "templates/redis.template.yml" をコメントアウトする
  • 代わりに DISCOURSE_REDIS_HOST を設定する

常に以下のエラーが発生します:

Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 582 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1

launcher rebuild app で再構築しようとするたびに発生します。

これは既知の問題ですか?コンテナ化されていないRedisでDiscourseを実行することに成功した人はいますか?

それがまさにあなたが必要なものです。完全な再構築エラーを貼り付けていただけますか?パスワードが必要な場合、必須の TLS がある場合、または到達不可能なドメインがある可能性があります。再構築ログでどちらであるかが明確になるはずです。

「いいね!」 1

それは基本的にすべてです。ログの上の方にいくつか警告があります。

warning " @mixer/parallel-prettier@2.0.3" has unmet peer dependency "prettier@^2.0.0".
warning "eslint-config-discourse > eslint-plugin-lodash@7.1.0" has unmet peer dependency "lodash@>=4".
warning " > babel-plugin-debug-macros@0.4.0-pre1" has unmet peer dependency "@babel/core@^7.0.0".
warning "workspace-aggregator-3fff36d0-9fd8-4d1a-ac4c-d10694a59627 > discourse > @uppy/aws-s3@3.0.6" has incorrect peer dependency "@uppy/core@^3.1.2".
warning "workspace-aggregator-3fff36d0-9fd8-4d1a-ac4c-d10694a59627 > discourse > @uppy/aws-s3-multipart@3.1.3" has incorrect peer dependency "@uppy/core@^3.1.2".
warning "workspace-aggregator-3fff36d0-9fd8-4d1a-ac4c-d10694a59627 > discourse > @uppy/xhr-upload@3.1.1" has incorrect peer dependency "@uppy/core@^3.1.2".

しかし、これらはコンテナ化されたRedisで再構築した場合でも存在します。

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 581 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
2533af220cc44d8c77bc12c17ed7635dee49ba7f280[...]

UPDATE:

エラーではなく INFO とマークされた行が見つかりました。これが原因かもしれません。

I, [2023-04-06T18:44:02.460059 #1]  INFO -- : > cd /var/www/discourse & su discourse -c 'LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all'
I, [2023-04-06T18:44:04.581741 #1]  INFO -- : docker_manager is already at latest compatible version

I, [2023-04-06T18:44:04.581929 #1]  INFO -- : > cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate'
Discourse requires Redis 6.2.0 or up
I, [2023-04-06T18:44:05.937604 #1]  INFO -- :

そして、かなり新しい Ubuntu 22.04.2 LTS は以下を提供します。

Package: redis-server
Architecture: amd64
Version: 5:6.0.16-1ubuntu1

ああ…このバージョンを使用するチャンスはありませんよね?

Discourse は 6.2 で導入された Redis コマンドの一部を使用していると思われます。

Redis の公式 APT リポジトリを使用してインストールすることもできます。

https://redis.io/docs/getting-started/installation/install-redis-on-linux/

「いいね!」 3

はい、まさにその通りです。ありがとうございます。そのメッセージがINFO(他にも多くのINFOメッセージがありましたが)ではなくERRORとしてマークされ、すぐに停止されていればよかったのにと思います。多くの時間をデバッグに費やし、この行に気づきませんでした。

Redis はリソースをあまり消費せず、複数のサーバーと共有することはできません。すでに動作していた Discourse のものをそのまま使用するべきです。