バックアップ復元の問題

[開始]
「user1」がリストアを開始しました!
リストアを「実行中」としてマーク中…
/workspace/discourse/tmp/restores/default/2026-04-29-211652 の存在を確認中…
アーカイブを tmp ディレクトリにコピー中…
ダンプファイルを展開中…
メタデータを検証中…
現在のバージョン: 20260420014648
リストアされたバージョン: 20260420014648
読み取り専用モードを有効化中…
Sidekiq を一時停止中…
Sidekiq が実行中のジョブを完了するまで最大 60 秒待機中…
I, [2026-04-29T21:16:58.919008 #394429]  INFO – : 死んだワーカー 394502 を検出、再起動中…
I, [2026-04-29T21:16:59.708195 #396907]  INFO – : プロセス ID 396907 で Sidekiq を読み込み中
E, [2026-04-29T21:16:59.731189 #396907] ERROR – : Sidekiq の起動中にエラーが発生しました: [Discourse::Utils::CommandError] renice -n 5 -p 396907
renice: プロセス ID 396907 の優先度設定に失敗しました: 権限がありません

/workspace/discourse/lib/discourse.rb:177:in 'Discourse::Utils::CommandRunner#execute_command'
/workspace/discourse/lib/discourse.rb:143:in 'Discourse::Utils::CommandRunner#exec'
/workspace/discourse/lib/discourse.rb:33:in 'Discourse::Utils.execute_command'
/workspace/discourse/lib/demon/sidekiq.rb:133:in 'Demon::Sidekiq#after_fork'
/workspace/discourse/lib/demon/base.rb:188:in 'block in Demon::Base#run'
/workspace/discourse/lib/demon/base.rb:184:in 'Kernel#fork'
/workspace/discourse/lib/demon/base.rb:184:in 'Demon::Base#run'
/workspace/discourse/lib/demon/base.rb:177:in 'Demon::Base#start'
/workspace/discourse/lib/demon/base.rb:163:in 'Demon::Base#ensure_running'
/workspace/discourse/lib/demon/base.rb:44:in 'block in Demon::Base.ensure_running'
/workspace/discourse/lib/demon/base.rb:44:in 'Array#each'
/workspace/discourse/lib/demon/base.rb:44:in 'Demon::Base.ensure_running'
/workspace/discourse/config/pitchfork.conf.rb:136:in 'block (2 levels) in Pitchfork::Configurator#load'
discourse_functions スキーマ内の欠落関数を作成中…
ダンプファイルをリストア中…(時間がかかる場合があります)
SET
SET
SET
SET
SET
set_config

(1 行)
SET
SET
SET
SET
ERROR: 型 "ai_moderation_setting_type" は既に存在します
EXCEPTION: psql が失敗しました: ERROR: 型 "ai_moderation_setting_type" は既に存在します
/workspace/discourse/lib/backup_restore/database_restorer.rb:95:in 'BackupRestore::DatabaseRestorer#restore_dump'
/workspace/discourse/lib/backup_restore/database_restorer.rb:26:in 'BackupRestore::DatabaseRestorer#restore'
/workspace/discourse/lib/backup_restore/restorer.rb:61:in 'BackupRestore::Restorer#run'
/workspace/discourse/script/spawn_backup_restore.rb:20:in 'Object#restore'
/workspace/discourse/script/spawn_backup_restore.rb:33:in 'block in '
/workspace/discourse/script/spawn_backup_restore.rb:4:in 'Kernel#fork'
/workspace/discourse/script/spawn_backup_restore.rb:4:in ''
ロールバックを試行中…
ロールバックの必要はありませんでした
クリーンアップ中…
discourse_functions スキーマから関数を削除中…
tmp ディレクトリ '/workspace/discourse/tmp/restores/default/2026-04-29-211652' を削除中…
Sidekiq の一時停止を解除中…
リストアを「完了」としてマーク中…
リストアの終了を「user1」に通知中…
I, [2026-04-29T21:17:01.099411 #397017]  INFO – : プロセス ID 397017 で Sidekiq を読み込み中
E, [2026-04-29T21:17:01.108527 #397017] ERROR – : Sidekiq の起動中にエラーが発生しました: [Discourse::Utils::CommandError] renice -n 5 -p 397017
renice: プロセス ID 397017 の優先度設定に失敗しました: 権限がありません

/workspace/discourse/lib/discourse.rb:177:in 'Discourse::Utils::CommandRunner#execute_command'
/workspace/discourse/lib/discourse.rb:143:in 'Discourse::Utils::CommandRunner#exec'
/workspace/discourse/lib/discourse.rb:33:in 'Discourse::Utils.execute_command'
/workspace/discourse/lib/demon/sidekiq.rb:133:in 'Demon::Sidekiq#after_fork'
/workspace/discourse/lib/demon/base.rb:188:in 'block in Demon::Base#run'
/workspace/discourse/lib/demon/base.rb:184:in 'Kernel#fork'
/workspace/discourse/lib/demon/base.rb:184:in 'Demon::Base#run'
/workspace/discourse/lib/demon/base.rb:177:in 'Demon::Base#start'
/workspace/discourse/lib/demon/base.rb:95:in 'Demon::Base#restart'
/workspace/discourse/lib/demon/sidekiq.rb:40:in 'block in Demon::Sidekiq.heartbeat_check'
/workspace/discourse/lib/demon/sidekiq.rb:31:in 'Array#each'
/workspace/discourse/lib/demon/sidekiq.rb:31:in 'Demon::Sidekiq.heartbeat_check'
/workspace/discourse/config/pitchfork.conf.rb:137:in 'block (2 levels) in Pitchfork::Configurator#load'
完了!
[失敗]
I, [2026-04-29T21:17:08.359107 #393481]  INFO – : 不明なサブプロセス #<Process::Status: pid 396553 exit 0> を回収しました

これの原因がわかりません。何か助けはありますか?

こんにちは @ziln :wave: discourse meta へようこそ :slight_smile:

ターゲットインスタンスがクリーンではないか、すでにデータが含まれていて、オブジェクトの衝突が発生しているように見えます。

これが標準的なインストールであると仮定して、クリーンな新しいデータベースをドロップして作成し、その後マイグレーションを実行してみてください。

pfaffman さんもここで同様の問題に直面していました:

わからないね。あの人はあまりよくわかってなさそうだよね。:wink: