2.3.5에서 2.4.2로 업그레이드 중입니다 (bitnami docker 컨테이너, 구글 클라우드 환경).
2.3.5 백업 아카이브를 새 2.4.2 환경에 복원하려 했으나 실패했습니다.
아카이브를 압축 해제하여 pg_dump 파일을 추출한 뒤 새 데이터베이스에 로드했습니다. 대부분은 문제가 없어 보였지만 두 가지 오류가 발생했습니다:
> ERROR: schema "discourse_functions" does not exist
> ERROR: schema "discourse_functions" does not exist
뭔가 누락된 것 같습니다…
그래도 시도해 보았습니다…
> /opt/bitnami/apps/discourse/htdocs$ sudo bin/rake db:migrate RAILS_ENV=production
> rake aborted!
> PG::InsufficientPrivilege: ERROR: permission denied for table site_settings
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/mini_sql-0.2.4/lib/mini_sql/postgres/connection.rb
> :118:in `exec'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/mini_sql-0.2.4/lib/mini_sql/postgres/connection.rb
> :118:in `run'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/mini_sql-0.2.4/lib/mini_sql/postgres/connection.rb
> :82:in `query'
> /opt/bitnami/apps/discourse/htdocs/lib/site_settings/db_provider.rb:19:in `all'
> /opt/bitnami/apps/discourse/htdocs/lib/site_settings/defaults_provider.rb:29:in `db_all'
> /opt/bitnami/apps/discourse/htdocs/lib/site_setting_extension.rb:277:in `block in refresh!'
> /opt/bitnami/apps/discourse/htdocs/lib/site_setting_extension.rb:274:in `synchronize'
> /opt/bitnami/apps/discourse/htdocs/lib/site_setting_extension.rb:274:in `refresh!'
> /opt/bitnami/apps/discourse/htdocs/lib/site_setting_extension.rb:495:in `block in setup_methods'
> /opt/bitnami/apps/discourse/htdocs/config/initializers/004-message_bus.rb:120:in `<top (required)>'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencie
> s.rb:319:in `load'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencie
> s.rb:319:in `block in load'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencie
> s.rb:291:in `load_dependency'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencie
> s.rb:319:in `load'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/engine.rb:667:in `block i
> n load_config_initializer'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/notificatio
> ns.rb:182:in `instrument'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/engine.rb:666:in `load_co
> nfig_initializer'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/engine.rb:624:in `block (
> 2 levels) in <class:Engine>'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/engine.rb:623:in `each'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/engine.rb:623:in `block i
> n <class:Engine>'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:32:in `i
> nstance_exec'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:32:in `r
> un'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:61:in `b
> lock in run_initializers'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:50:in `e
> ach'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:50:in `t
> sort_each_child'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:60:in `r
> un_initializers'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/application.rb:363:in `in
> itialize!'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/railtie.rb:190:in `public
> _send'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/railtie.rb:190:in `method
> _missing'
> /opt/bitnami/apps/discourse/htdocs/config/environment.rb:7:in `<top (required)>'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.2/lib/zeitwerk/kernel.rb:23:in `requi
> re'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.2/lib/zeitwerk/kernel.rb:23:in `requi
> re'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencie
> s.rb:325:in `block in require'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencie
> s.rb:291:in `load_dependency'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencie
> s.rb:325:in `require'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/application.rb:339:in `re
> quire_environment!'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/application.rb:515:in `bl
> ock in run_tasks_blocks'
> /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
> Tasks: TOP => db:migrate => db:load_config => environment
> (See full trace by running task with --trace)
방향성에 대한 조언을 부탁드립니다.
Stephen
(Stephen)
5월 1, 2020, 5:16오후
2
죄송하지만 bitnami 패키지는 여기서 지원되지 않습니다. 이 패키지는 서드파티 패키지이며, 계속 사용하시려면 지원과 관련된 사항은 해당 업체에 직접 문의하셔야 합니다.
전체 백업을 수행한 후, 지원되는 표준 설치 방법 을 사용하여 재설치하는 것을 권장합니다.
스티븐, 안녕하세요.
2.3.5 백업 아카이브를 표준 2.4.2 설치 환경에 복원하는 작업이 문제없이 수행될까요?
Stephen
(Stephen)
5월 1, 2020, 5:33오후
4
그렇길 바라지만, 내 말만 믿고 대체 전략 없이 두지는 마세요. 현재 지원되지 않는 설치 환경을 사용하고 있으므로, 더 지원이 잘 되는 환경으로 전환하는 방법에 대한 조언은 드릴 수 있지만, Bitnami 설치 환경은 문제가 많 습니다. 최악의 상황을 대비해 두는 것이 좋습니다.
별도의 서버에서 빌드하면, 기존 설치 환경에 되돌릴 수 없는 변경을 가하기 전에 이를 테스트할 수 있습니다.
간단한 배경 설명을 드리겠습니다:
현재 Amazon에서 2.3.5 버전을 실행 중입니다.
Google Cloud와 로컬의 VirtualBox에서 Ubuntu 18.0.4 LTS VM을 사용하여 Docker로 표준 설치 패키지를 빌드해 보았지만, 동일한 문제가 발생했습니다.
v2.3.5 Discourse Docker(내장 Postgres/Redis)도, v2.3.10도 빌드할 수 없었습니다. 두 버전 모두 Google Cloud와 Ubuntu 18.0.4가 설치된 VirtualBox VM에서 Postgres 권한 관련 문제로 실패했습니다.
안정판(2.4.2)은 빌드는 가능하지만, Google Cloud의 Docker 2.4.2 이미지도 VirtualBox의 이미지도 로드되지 않습니다. 두 경우 모두 “discourse functions” 빌드 시점에 실패합니다.
보내주신 링크에 따라 빌드 과정을 시도해 보고 결과를 보고하겠습니다. 각 환경별 시도를 별도의 주제로 등록해야 할까요?
그렇게 하면 각 환경이 구체적으로 어디에서 멈추는지 게시할 수 있습니다. 만약 멈추는 경우가 있다면요.
Google Cloud의 Ubuntu 18.0.4 인스턴스는 지원되나요? 그리고 해당 SQL도 지원되나요?
Stephen
(Stephen)
5월 1, 2020, 6:01오후
7
네, 지원되지만 DigitalOcean보다 환경 설정이 더 복잡한 편입니다. DigitalOcean에서 설치하는 과정은 최대 30분이면 충분하며, ACL 및 네트워크 정책을 별도로 걱정할 필요가 없습니다.
pfaffman
(Jay Pfaffman)
5월 1, 2020, 6:07오후
8
외부 데이터베이스를 사용하는 예시를 보려면 /var/discourse/templates/web_only.yml (또는 유사한 파일, 기억에 의존합니다)을 참고하세요.
빈 사이트를 설정한 후에는 discourse restore 명령으로 백업을 복원할 수 있습니다.
우분투 18.0.4 VM에서 2.3.5 버전의 discourse를 구축하려고 시도했습니다. app.yml에 version: "v2.3.5"를 추가했는데 여기에서 실패합니다:
> FAILED--------------------Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development' failed with return #<Process::Status: pid 353 exit 1>Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development'"]}a3cebbd8e5a24b8a2b248886f0fa195f401720a6dc7084ad78af6cee345de9a9** 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.
DigitalOcean을 사용해야 할까요, 아니면 외부 데이터베이스를 사용해야 할까요?
google all in one 18.0.4 LTS 인스턴스에 v2.3.5 discourse 컨테이너를 설치하는 중이었는데 여기에서 죽었습니다:
> [2020-05-01T18:54:20.903566 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development'/usr/local/lib/ruby/site_ruby/2.6.0/rubygems.rb:275:in `find_spec_for_exe': Could not find 'bundler' (1.17.3) required by your /var/www/discourse/Gemfile.lock. (Gem::GemNotFoundException)To update to the latest version installed on your system, run `bundle update --bundler`.To install the missing version, run `gem install bundler:1.17.3` from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems.rb:294:in `activate_bin_path' from /usr/local/bin/bundle:23:in `<main>'I, [2020-05-01T18:54:21.234673 #1] INFO -- : I, [2020-05-01T18:54:21.235321 #1] INFO -- : Terminating async processesI, [2020-05-01T18:54:21.235582 #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/10/bin/postmaster -D /etc/postgresql/10/main pid: 64I, [2020-05-01T18:54:21.235838 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 1812020-05-01 18:54:21.236 UTC [64] LOG: received fast shutdown request181:signal-handler (1588359261) Received SIGTERM scheduling shutdown...2020-05-01 18:54:21.241 UTC [64] LOG: aborting any active transactions2020-05-01 18:54:21.248 UTC [64] LOG: worker process: logical replication launcher (PID 73) exited with exit code 12020-05-01 18:54:21.248 UTC [68] LOG: shutting down181:M 01 May 2020 18:54:21.268 # User requested shutdown...181:M 01 May 2020 18:54:21.269 * Saving the final RDB snapshot before exiting.181:M 01 May 2020 18:54:21.271 * DB saved on disk181:M 01 May 2020 18:54:21.271 # Redis is now ready to exit, bye bye...2020-05-01 18:54:21.288 UTC [64] LOG: database system is shut down
Stephen
(Stephen)
5월 1, 2020, 7:24오후
12
stable를 빌드해서 그 안으로 복원하는 것을 테스트해 보는 것은 어떨까요?
네, 그 방법을 시도해서 에러 내용을 알려드리겠습니다.
명령줄 명령을 사용할까요, 아니면 UI의 복원 작업을 사용할까요?
mkitezr
(Basil Baluta)
5월 4, 2020, 7:01오후
16
그래서 2.4.2 환경을 구축하는 데 성공했습니다. 다만 백업은 S3가 설정된 Amazon 배포 환경에서 수행되었습니다. 비-Amazon 환경으로 복원하는 과정에서 일부 S3 스크립트에서 실패하고 있습니다.
> Reconnecting to the database...
> Reloading site settings...
> Disabling outgoing emails for non-staff users...
> Disabling readonly mode...
> Clearing category cache...
> Clearing emoji cache...
> Clear theme cache
> Remapping uploads...
> Restoring uploads, this may take a while...
> Migrating uploads to S3 for 'default'...
> Uploading files to S3...
> - Listing local files
> => 3 files
> - Listing S3 files
> . => 3 files
> - Syncing files to S3
> ...
> Updating the URLs in the database...
> Removing old optimized images...
> Flagging all posts containing lightboxes for reb
> 182 posts were flagged for a rebake
> EXCEPTION: 215 of 295 uploads are not migrated to S3. S3 migration failed for db 'default'.
> /var/www/discourse/lib/file_store/to_s3_migration.rb:131:in `raise_or_log'
> /var/www/discourse/lib/file_store/to_s3_migration.rb:78:in `migration_successful?'
> /var/www/discourse/lib/file_store/to_s3_migration.rb:351:in `migrate_to_s3'
> /var/www/discourse/lib/file_store/to_s3_migration.rb:65:in `migrate'
> /var/www/discourse/lib/file_store/s3_store.rb:203:in `copy_from'
> /var/www/discourse/lib/backup_restore/uploads_restorer.rb:48:in `restore_uploads'
> /var/www/discourse/lib/backup_restore/uploads_restorer.rb:30:in `restore'
> /var/www/discourse/lib/backup_restore/restorer.rb:59:in `run'
> script/discourse:143:in `restore'
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
> script/discourse:284:in `<top (required)>'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `load'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:in `run'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in `exec'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invok
> e_command'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
> /usr/local/bin/bundle:23:in `load'
> /usr/local/bin/bundle:23:in `<main>'
> Trying to rollback...
> Rolling back...
> Cleaning stuff up...
> Dropping functions from the discourse_functions schema...
> Removing tmp '/var/www/discourse/tmp/restores/default/2020-05-01-230400' directory...
> Unpausing sidekiq...
> Marking restore as finished...
> Notifying 'system' of the end of the restore...
> Finished!
> [FAILED]
> Restore done.
이제 어떻게 해야 하나요?
pfaffman
(Jay Pfaffman)
5월 4, 2020, 9:00오후
18
데이터베이스만 백업 및 복원하고 로컬 에셋은 수동으로 이동하세요.
해당 문제가 발생하는 사이트들은 에셋이 서로 다른 두 개의 S3 버킷에 저장되어 있습니다.