FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 741 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132: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.
데이터베이스 호스트는 위 정보로 접근 가능합니다. 여기서 무슨 일이 일어나고 있는지 아이디어가 있을까요? 표준 데이터베이스 컨테이너를 사용한 동일한 빌드는 성공적으로 완료됩니다.
…
docker_manager is already at latest compatible version
wp-discourse is already at latest compatible version
I, [2023-11-10T21:08:17.388213 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
Plugin name is 'discourse-topic-voting', but plugin directory is named 'discourse-voting'
rake aborted!
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: permission denied for table users (ActiveRecord::StatementInvalid)
좋습니다! 데이터베이스 연결은 정상적으로 이루어지고 있으며, 데이터베이스 권한을 조정해야 하는 문제입니다.
… 알겠습니다, 여기에도 권한 문제가 있는 것 같습니다. /var/log/postgresql/postgresql-13-main.log 파일을 확인해 주세요:
2023-11-10 22:07:58.371 UTC [196127] postgres@postgres STATEMENT: ALTER DEFAULT PRIVILEGES IN SCHEMA 'public' GRANT ALL ON TABLES TO 'discourse';
2023-11-10 22:10:18.270 UTC [196160] discourse@discourse ERROR: permission denied for table site_settings
2023-11-10 22:10:18.270 UTC [196160] discourse@discourse STATEMENT: SELECT name, data_type, value FROM site_settings
2023-11-10 22:10:18.313 UTC [196160] discourse@discourse ERROR: permission denied for table users
2023-11-10 22:10:18.313 UTC [196160] discourse@discourse STATEMENT: SELECT COUNT(*) FROM (SELECT 1 AS one FROM "users" LIMIT 20) subquery_for_count
postgres에 이미 discourse 데이터베이스가 있었지만, discourse 사용자/역할에 필요한 모든 권한이 부여되어 있지 않았습니다. 그리고 mariadb와 postgres 간의 몇 가지 중요한 ‘동작상’ 차이점을 놓치고 있었습니다 …
이제 사용자, 데이터베이스, 사용자/역할에 대한 권한을 모두 다시 생성했습니다. (이 사용자가 미래에 생성할 테이블에 적용하기 위해 ALTER DEFAULT PRIVILEGES FOR ROLE discourse IN SCHEMA public GRANT ALL ON TABLES TO "discourse"; 포함)
빌드가 완료되었고, 원격 postgres 서버와 함께 인스턴스가 정상적으로 실행되고 있으므로, 이전 인스턴스의 백업을 가져오는 준비가 끝났습니다.