我目前正在将我的 Discourse 论坛从一台服务器迁移到另一台服务器。两台服务器都运行 Linux CentOS 7.9。
我已按照使用 ./launcher bootstrap app 来引导应用程序的步骤进行操作,但遇到了以下错误:
I, [2023-06-17T17:15:58.122571 #1] INFO -- : cd /var/www/discourse && su discourse -c 'LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all'
I, [2023-06-17T17:16:00.306019 #1] INFO -- : docker_manager is already at latest compatible version
I, [2023-06-17T17:16:00.307142 #1] INFO -- : cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
[docker_manager] Handlebars templates can no longer be included via `register_asset`.
Any hbs files under `assets/javascripts` will be automatically compiled and included."
/var/www/discourse/lib/plugin/instance.rb:638:in `register_asset'
...
看起来 Docker Manager 插件和 handlebars 模板存在问题。我不确定如何继续并解决此错误。有人能指导我如何修复吗?
与此同时,我决定将 local_discourse/app 镜像从原始服务器复制到新服务器。我使用了 ./launcher start app 来启动应用程序,但遇到了另一个错误:
I, [2023-06-18T11:24:51.537970 #1] INFO -- : Reading from stdin
/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/config.rb:14:in `block in initialize': undefined method `has_key?' for nil:NilClass (NoMethodError)
['env_template', 'env', 'labels', 'params'].each { |key| @config[key] = {} unless @config.has_key?(key) }
...
看起来 Pups 配置与 env_template、env、labels 和 params 键有关。此错误阻止应用程序正常启动。
我感到很卡住,不知道如何继续。如果有人在 Discourse 迁移或应用程序启动过程中遇到类似问题,我将非常感谢您的帮助。如果您有任何建议或解决方案,请告诉我。
提前感谢您的帮助!
引导应用:
I, [2023-06-17T17:15:58.122571 #1] INFO -- : cd /var/www/discourse && su discourse -c 'LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all'
I, [2023-06-17T17:16:00.306019 #1] INFO -- : docker_manager is already at latest compatible version
I, [2023-06-17T17:16:00.307142 #1] INFO -- : cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
[docker_manager] Handlebars templates can no longer be included via `register_asset`.
Any hbs files under `assets/javascripts` will be automatically compiled and included."
/var/www/discourse/lib/plugin/instance.rb:638:in `register_asset'
/var/www/discourse/plugins/docker_manager/plugin.rb:29:in `activate!'
/var/www/discourse/lib/plugin/instance.rb:730:in `instance_eval'
/var/www/discourse/lib/plugin/instance.rb:730:in `activate!'
/var/www/discourse/lib/discourse.rb:346:in `block in activate_plugins!'
/var/www/discourse/lib/discourse.rb:343:in `each'
/var/www/discourse/lib/discourse.rb:343:in `activate_plugins!'
/var/www/discourse/config/application.rb:215:in `block in <class:Application>'
/var/www/discourse/lib/plugin.rb:6:in `initialization_guard'
/var/www/discourse/config/application.rb:215:in `<class:Application>'
/var/www/discourse/config/application.rb:75:in `<module:Discourse>'
/var/www/discourse/config/application.rb:74:in `<top (required)>'
/var/www/discourse/Rakefile:7:in `require'
/var/www/discourse/Rakefile:7:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
(See full trace by running task with --trace)
I, [2023-06-17T17:16:01.381158 #1] INFO -- :
I, [2023-06-17T17:16:01.382053 #1] INFO -- : Terminating async processes
I, [2023-06-17T17:16:01.382604 #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/13/bin/postmaster -D /etc/postgresql/13/main pid: 42
I, [2023-06-17T17:16:01.383169 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 103
2023-06-17 17:16:01.383 UTC [42] LOG: received fast shutdown request
103:signal-handler (1687022161) Received SIGTERM scheduling shutdown...
2023-06-17 17:16:01.396 UTC [42] LOG: aborting any active transactions
2023-06-17 17:16:01.400 UTC [42] LOG: background worker "logical replication launcher" (PID 51) exited with exit code 1
2023-06-17 17:16:01.401 UTC [46] LOG: shutting down
2023-06-17 17:16:01.411 UTC [42] LOG: database system is shut down
103:M 17 Jun 2023 17:16:01.435 # User requested shutdown...
103:M 17 Jun 2023 17:16:01.436 * Saving the final RDB snapshot before exiting.
103:M 17 Jun 2023 17:16:01.439 * DB saved on disk
103:M 17 Jun 2023 17:16:01.439 # Redis is now ready to exit, bye bye...
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 814 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117: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.
./discourse-doctor may help diagnose the problem.
启动应用:
I, [2023-06-18T11:24:51.537970 #1] INFO -- : Reading from stdin
/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/config.rb:14:in `block in initialize': undefined method `has_key?' for nil:NilClass (NoMethodError)
['env_template', 'env', 'labels', 'params'].each { |key| @config[key] = {} unless @config.has_key?(key) }
^^^^^^^^^
from /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/config.rb:14:in `each'
from /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/config.rb:14:in `initialize'
from /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/cli.rb:55:in `new'
from /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/cli.rb:55:in `run'
from /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/bin/pups:9:in `<main>'
from /usr/local/bin/pups:25:in `load'
from /usr/local/bin/pups:25:in `<main>'