أنا حاليًا في طور ترحيل منتدى 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>'
هل قمت بحل هذه المشكلة على الإطلاق؟ أنا أواجه نفس المشكلة