New Serverへの移行トラブル

I am moving my discourse installation to a new server, DNS etc is all already patched up, valid SSL certificates on the server I copied the /var/discourse folder from server A to server B and trying to rebuild it but i’m having some issues.

I looked at the install notes which recommend The default of 1 GB RAM works fine for small Discourse communities. We recommend 2 GB RAM for larger communities. which all lines up with my server.

I have a 4GB DO instance that’s using about 30% of RAM right now so should have plenty of RAM, though this is dying on building the container.

Any help would be appreciated.

/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli.rb:35:in `dispatch'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli.rb:29:in `start'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/exe/bundle:28:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/exe/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
rake aborted!
ActiveRecord::ConnectionNotEstablished: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory (ActiveRecord::ConnectionNotEstablished)
	Is the server running locally and accepting connections on that socket?
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:69:in `rescue in new_client'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:57:in `new_client'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:982:in `connect'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:994:in `reconnect'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:662:in `block in reconnect!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:661:in `reconnect!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:763:in `block in verify!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:754:in `verify!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:771:in `connect!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:977:in `block in with_raw_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:976:in `with_raw_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/quoting.rb:128:in `quote_string'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/quoting.rb:76:in `quote'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/quoting.rb:122:in `quote'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1099:in `quoted_scope'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1076:in `data_source_sql'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:60:in `table_exists?'
/var/www/discourse/config/initializers/006-ensure_login_hint.rb:8:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:407:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:407:in `block in make_lambda'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:179:in `block in call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:668:in `block (2 levels) in default_terminator'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:667:in `catch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:667:in `block in default_terminator'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:180:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `block in invoke_before'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `invoke_before'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:109:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/reloader.rb:96:in `prepare!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:32:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:32:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:60:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application.rb:435:in `initialize!'
/var/www/discourse/config/environment.rb:7:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:34:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application.rb:411:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application.rb:559:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'

Caused by:
PG::ConnectionBad: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory (PG::ConnectionBad)
	Is the server running locally and accepting connections on that socket?
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.9/lib/pg/connection.rb:837:in `connect_start'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.9/lib/pg/connection.rb:837:in `connect_to_hosts'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.9/lib/pg/connection.rb:772:in `new'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.9/lib/pg.rb:63:in `connect'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:58:in `new_client'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:982:in `connect'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:994:in `reconnect'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:662:in `block in reconnect!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:661:in `reconnect!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:763:in `block in verify!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:754:in `verify!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:771:in `connect!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:977:in `block in with_raw_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:976:in `with_raw_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/quoting.rb:128:in `quote_string'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/quoting.rb:76:in `quote'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/quoting.rb:122:in `quote'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1099:in `quoted_scope'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1076:in `data_source_sql'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:60:in `table_exists?'
/var/www/discourse/config/initializers/006-ensure_login_hint.rb:8:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:407:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:407:in `block in make_lambda'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:179:in `block in call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:668:in `block (2 levels) in default_terminator'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:667:in `catch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:667:in `block in default_terminator'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:180:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `block in invoke_before'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `invoke_before'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:109:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/reloader.rb:96:in `prepare!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:32:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:32:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:60:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application.rb:435:in `initialize!'
/var/www/discourse/config/environment.rb:7:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:34:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application.rb:411:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application.rb:559:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
I, [2025-03-09T13:54:08.054466 #1]  INFO -- : gem install ruby-openid -v 2.9.2 -i /var/www/discourse/plugins/discourse-steam-login/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed ruby-openid-2.9.2
1 gem installed
gem install rack-openid -v 1.4.2 -i /var/www/discourse/plugins/discourse-steam-login/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed rack-openid-1.4.2
1 gem installed
gem install omniauth-openid -v 2.0.1 -i /var/www/discourse/plugins/discourse-steam-login/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed omniauth-openid-2.0.1
1 gem installed
gem install omniauth-steam -v 1.0.6 -i /var/www/discourse/plugins/discourse-steam-login/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed omniauth-steam-1.0.6
1 gem installed

I, [2025-03-09T13:54:08.055390 #1]  INFO -- : Terminating async processes
I, [2025-03-09T13:54:08.055580 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 89
89:signal-handler (1741528448) Received SIGTERM scheduling shutdown...
89:M 09 Mar 2025 13:54:08.131 # User requested shutdown...
89:M 09 Mar 2025 13:54:08.131 * Saving the final RDB snapshot before exiting.
89:M 09 Mar 2025 13:54:08.166 * DB saved on disk
89:M 09 Mar 2025 13:54:08.166 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 1159 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "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.
b4a4fd37f9af5ae13eba2baa024dd57c418ad1279e34d59ed7aae45f08d8128c

It complains about the PSQL server socket, and the redis port but I have a feeling that neither of those is the root of the problem. Any suggestion on what to look at?

I’m using a web socket pattern, if that makes any difference.

app.yml snippet

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
#  - "templates/web.ssl.template.yml"
#  - "templates/web.letsencrypt.ssl.template.yml"
  - "templates/web.socketed.template.yml"

これが問題の根本原因であるかどうかはわかりませんが、異なるスペックのサーバーに移動した後、それに応じていくつかの設定(スワップ、共有バッファ、ユニコーンワーカーなど)を行うために再度 ./discourse-setup を実行することが推奨されると信じています。
もし私が間違っていたら専門家が訂正してくれるでしょう :face_with_peeking_eye:

「いいね!」 2

興味深いですね。それは予期せぬことですが、試してみてどうなるか見てみます。

さて、アップデートです。

セットアップを実行しても何も変わりませんでした。ホストを尋ねられ、いくつかの簡単な設定を調整しただけです。今のところ、まだうまくいきません。再構築でも同じエラーが発生します。ドクターを実行してみましたが、効果はありませんでした。

セットアップでは、指定されたポートでホストが到達不能であると不満を言われましたが、それは真実ではありません。

nginxプロキシ経由で提供しています。


  location / {
    error_page 502 =502 /errors/discourse-offline.html;
    proxy_intercept_errors on;
    proxy_headers_hash_max_size 1024;
    proxy_headers_hash_bucket_size 128;
    proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
    proxy_set_header Host $http_host;
    proxy_http_version 1.1;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Real-IP $remote_addr;
  }
}

これは調整が必要かもしれませんが、ビルドに失敗している場合、まだウェブサーバーの問題であるべきではありません。

専門家ではありませんが、app.yml に競合する nginx の設定や古いリダイレクトはありますか?

「いいね!」 2

ディスコースフォルダは、以前機能していたものから直接コピーしたものです。サーバー、リソース、Dockerのバージョンなどが異なることは認識しています。ほとんどの部分はDockerコンテナに抽象化されるべきであり、2つの環境の唯一の本当の違いはDockerとリソース/メモリであると仮定しています。

Nginxが機能していなくても、コンテナのビルドは機能するはずです。単に考えているだけですが、ポート80または443の競合は、適切に設定されていない場合の後の問題になるはずです。これではコンテナを開始することさえできません。

Nginxの設定はDiscourseの例から取ったもののようですが、新しい更新されたバージョンを見つけて、それが何か変更されるか試してみます。

参考までに、Ubuntu 24.10 Oracular Orioleを使用しています。

Linux forumhost 6.11.0-19-generic #19-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 12 21:43:43 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

24.10 のような LTS バージョンを使用しないと、すぐにまた同じことをすることになります。

サーバーに別の postgres はありますか?

postgres を rsync で転送しましたか、それともクリーンインストールから始めますか?クリーンな場合は、/shared/standalone/postgres_* を削除して、もう一度やり直してください。その後、データベースを復元します。

「いいね!」 1

データを保持したいです。現時点では、Postgres、Redisなど、すべてのデータを含む /var/discourse のデータをすべてコピーしました。

Discourse を推奨されている Docker で実行していますか、それともサーバーに直接実行していますか?

公式コミュニティのサーバー移行チュートリアルに従うことを強くお勧めします。/var/discourse フォルダを直接コピーするのではなく。

「いいね!」 1

はい、Dockerパターンです。そのため、コンテナの再構築に関するコメントに問題があります。

そのドキュメントへの参照はありますか?前回はこれでうまくいったと思ったので、今回これほど苦労していることに驚いています。

新しいサーバーに新しいDiscourseインスタンスをインストールし、バックアップを復元することで、すべてがシームレスに動作するようになります。私はこの方法を、公式ガイドラインに従って、少なくとも5回サーバーを移行するために使用しましたが、問題に遭遇したことはありません。

「いいね!」 1

rsyncを使用してDiscourseサイトを別のVPSに移動するを参照してください。

ただし、データベースをコピーせずに、古いサーバーでバックアップを作成し、新しいサーバーに復元すれば、2つのコピーを持つ必要はありません。

「いいね!」 2

何か他に原因があると思います。

ステップ 1. ポートの競合を避けるために nginx を停止します (最終的には nginx がソケットにプロキシしますが、シンプルに保ちます)。
ステップ 2. git clone GitHub - discourse/discourse_docker: A Docker image for Discourse /var/discourse
ステップ 3. cd /var/discourse & chmod 700 containers
ステップ 4. ./discourse-setup
ステップ 5. ビルド失敗

...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
I, [2025-03-10T14:17:49.762301 #1]  INFO -- : Building
Environment: production
The setting 'staticAddonTrees' will default to true in the next version of Embroider and can't be turned off. To prepare for this you should set 'staticAddonTrees: true' in your Embroider config.
The setting 'staticAddonTestSupportTrees' will default to true in the next version of Embroider and can't be turned off. To prepare for this you should set 'staticAddonTestSupportTrees: true' in your Embroider config.
building... 
undefined
 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command was killed with SIGKILL (Forced termination): ember build -prod

I, [2025-03-10T14:17:49.768097 #1]  INFO -- : Terminating async processes
I, [2025-03-10T14:17:49.768368 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/15/bin/postmaster -D /etc/postgresql/15/main pid: 59
126:signal-handler (1741616269) Received SIGTERM scheduling shutdown...
I, [2025-03-10T14:17:49.769541 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 126
2025-03-10 14:17:49.774 UTC [59] LOG:  received fast shutdown request
2025-03-10 14:17:49.779 UTC [59] LOG:  aborting any active transactions
2025-03-10 14:17:49.812 UTC [59] LOG:  background worker "logical replication launcher" (PID 73) exited with exit code 1
126:M 10 Mar 2025 14:17:49.812 # User requested shutdown...
126:M 10 Mar 2025 14:17:49.812 * Saving the final RDB snapshot before exiting.
2025-03-10 14:17:49.817 UTC [68] LOG:  shutting down
126:M 10 Mar 2025 14:17:49.819 * DB saved on disk
2025-03-10 14:17:49.820 UTC [68] LOG:  checkpoint starting: shutdown immediate
126:M 10 Mar 2025 14:17:49.820 # Redis is now ready to exit, bye bye...
2025-03-10 14:17:50.013 UTC [68] LOG:  checkpoint complete: wrote 2461 buffers (1.9%); 0 WAL file(s) added, 0 removed, 1 recycled; write=0.082 s, sync=0.098 s, total=0.196 s; sync files=2470, longest=0.002 s, average=0.001 s; distance=17659 kB, estimate=17659 kB
2025-03-10 14:17:50.038 UTC [59] LOG:  database system is shut down

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle exec rake assets:precompile:build' failed with return #<Process::Status: pid 801 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"build", "hook"=>"assets_precompile_build", "cmd"=>["su discourse -c 'bundle exec rake assets:precompile:build'"]}
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.
ed8a47c0a48fcf3eed3a152f69b7f5730fadb166e331ffff1361c7ee54bb7a81

これは新品のインストールで、状態は一切ありません。サーバーに discourse をセットアップしようとしているだけです。

\n\n\n free -h \n\n\nは何を示していますか? スワップはありますか?

「いいね!」 2

先日、これを数回入手しました。その日の後半に再試行したところ、うまくいきました。

それが原因でした。ファイルベースのスワップを作成して有効にしたところ、問題がすべて解決しました!

すべてを機能させるために、新しいインストールとバックアップからの復元を行いましたが、すべて正常に動作しています。ご協力ありがとうございました。

「いいね!」 6