不明なプライマリキー

ログインしようとすると、次のエラーが表示されます。

Started POST "/session" for <IP> at 2023-04-07 20:57:15 +0000
Processing by SessionController#create as */*
  Parameters: {"login"=>"<user>", "password"=>"[FILTERED]", "second_factor_method"=>"1", "timezone"=>"<TIME_ZONE>"}
start
done
Completed 500 Internal Server Error in 161ms (ActiveRecord: 0.0ms | Allocations: 154577)
ActiveRecord::UnknownPrimaryKey (Unknown primary key for table posts in model Post.)
lib/freedom_patches/ams_include_without_root.rb:49:in `include!'
app/controllers/application_controller.rb:496:in `serialize_data'
app/controllers/application_controller.rb:505:in `render_serialized'
app/controllers/session_controller.rb:714:in `login'
app/controllers/session_controller.rb:341:in `create'
app/controllers/application_controller.rb:397:in `block in with_resolved_locale'
app/controllers/application_controller.rb:397:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:358:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
lib/middleware/request_tracker.rb:198:in `call'

また、他のトピックを開こうとすると、次のエラーが表示されます。

Started GET "/t/le-numerique-alternatif-et-ecologique-murena-e-os-fairphone-telecoop-commown/48638" for <IP> at 2023-04-07 20:56:40 +0000
Processing by TopicsController#show as HTML
  Parameters: {"slug"=>"le-numerique-alternatif-et-ecologique-murena-e-os-fairphone-telecoop-commown", "topic_id"=>"48638"}
Completed 500 Internal Server Error in 11ms (ActiveRecord: 0.0ms | Allocations: 3093)
ActiveRecord::UnknownPrimaryKey (Unknown primary key for table posts in model Post.)
lib/freedom_patches/fast_pluck.rb:59:in `pluck'
lib/freedom_patches/fast_pluck.rb:52:in `pluck'
lib/topic_view.rb:143:in `initialize'
app/controllers/topics_controller.rb:89:in `new'
app/controllers/topics_controller.rb:89:in `show'
app/controllers/application_controller.rb:397:in `block in with_resolved_locale'
app/controllers/application_controller.rb:397:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:356:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
lib/middleware/request_tracker.rb:198:in `call'

Satan が移行されなかったのではないでしょうか?

rake db:migrate を試すことができます。

ポストマイグレーションをスキップする設定になっていませんか? 標準的なインストールですか?

Dockerの設定で、Discourseは正常に動作していました。Dockerコンテナをエクスポートし、/var/discourseと共に別のサーバーにインポートして起動しただけです。
rake db:migrateも実行しましたが、効果はありませんでした。

バックアップを復元しましたか?

再構築を試しましたか?

データベースファイルがコンテナ内にないため、PostgreSQL はディスクリートデータベース全体がなくても、ディスクリートデータベースを欠いている可能性が高いです。

リストアで修正されるはずです。標準の PostgreSQL リストアでディスクリートデータベースが作成されるはずです。(しかし、それが失敗した場合は、データベースを作成してからリストアを試してください。)

これはMove your Discourse Instance to a Different Server

「いいね!」 3