알 수 없는 기본 키

로그인 시도를 하면 다음과 같은 오류가 발생합니다:

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'

또 다른 주제(Topic)를 열려고 할 때도 다음과 같은 오류가 발생합니다:

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’s가 마이그레이션되지 않았나요?

다음 명령어를 시도해 보세요.

rake db:migrate

skip post migrations 설정을 하지 않았나요? 표준 설치 환경인가요?

Docker 설정을 사용하고 있었으며, Discourse는 정상적으로 실행 중이었습니다. Docker 컨테이너를 내보낸 후 /var/discourse 디렉터리와 함께 다른 서버에 가져와 실행한 것 외에는 별다른 조치가 없었습니다.
rake db:migrate 명령도 실행해 보았지만, 문제는 해결되지 않았습니다.

백업을 복원했나요?

재구성을 시도해 보았나요?

데이터베이스 파일이 컨테이너 안에 있지 않다고 생각합니다. 따라서 PostgreSQL은 discourse 데이터베이스, 또는 데이터베이스 파일 전체를 누락했을 가능성이 높습니다.

복원(restore)을 수행하면 해결될 것입니다. 표준 PostgreSQL 복원 절차는 discourse 데이터베이스를 자동으로 생성하기 때문입니다. (만약 실패할 경우, 먼저 데이터베이스를 생성한 다음 복원을 시도해 보세요.)

Move your Discourse Instance to a Different Server 의 올바른 방법이 아니며, 절대 작동하지 않습니다.