فشل البناء بسبب هذا. لقد قمت بإزالة متغير البيئة وأعدت البناء بدونه. ثم انتقلت إلى التصحيح داخل الحاوية. حيث قمت بإضافة المفتاح إلى discourse.conf، وما زال يفشل.
(لحسن الحظ، فعلت هذا قبل أن أخبر العميل أنهم أعطوني مفتاحًا غير صالح!)
لقد أضفت puts إلى مهمة rake لطباعة عنوان URL الذي يحاول تنزيل قاعدة البيانات منه بهذا الشكل:
url =
"https://download.maxmind.com/app/geoip_download?license_key=#{GlobalSetting.maxmind_license_key}&edition_id=#{name}&suffix=tar.gz"
gz_file =
FileHelper.download(
url,
max_file_size: 100.megabytes,
tmp_file_name: "#{name}.gz",
validate_uri: false,
follow_redirect: false,
)
if gz_file.nil?
puts "no gzfile"
end
puts "Got file #{gz_file} for #{url}"
filename = File.basename(gz_file.path)
الآن أحصل على هذا:
root@web-only:/var/www/discourse# rake maxminddb:get
Plugin name is 'discourse-topic-voting', but plugin directory is named 'discourse-voting'
Downloading MaxMindDb's GeoLite2-City...
no gzfile
Got file for https://download.maxmind.com/app/geoip_download?license_key=VALID_KEY_IS_HERE&edition_id=GeoLite2-City&suffix=tar.gz
rake aborted!
NoMethodError: undefined method `path' for nil:NilClass (NoMethodError)
filename = File.basename(gz_file.path)
^^^^^
/var/www/discourse/lib/discourse_ip_info.rb:52:in `mmdb_download'
/var/www/discourse/lib/tasks/maxminddb.rake:9:in `block (2 levels) in <main>'
/var/www/discourse/lib/tasks/maxminddb.rake:7:in `each'
/var/www/discourse/lib/tasks/maxminddb.rake:7:in `block in <main>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => maxminddb:get
(See full trace by running task with --trace)
كان هناك موضوع آخر كانت المشكلة فيه هي أن الموقع كان محظورًا بواسطة Maxmind، لذلك حاولت، ونجحت في تنزيل هذا العنوان باستخدام wget من داخل الحاوية على الخادم المعني.
يبدو لي أن FileHelper.download ليست Helper حقًا، بل تعيد nil بصمت بدلاً من ملف. الملف هو 44 ميجابايت فقط، لذا هذه ليست المشكلة. عندما أتحقق من الرؤوس الكاملة باستخدام wget، لا أرى إعادة توجيه.
أي أفكار حول ما يمكن أن يكون السبب؟
هل هناك سبب لعدم التقاط هذا الخطأ والسماح للبناء بالانتهاء بمفتاح غير صالح؟ ربما مجرد طباعة تحذير؟
Downloading MaxMindDB...
Compressing Javascript and Generating Source Maps
I, [2024-03-26T13:27:38.305597 #1] INFO -- : Terminating async processes
I, [2024-03-26T13:27:38.307312 #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, [2024-03-26T13:27:38.307891 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 111
111:signal-handler (1711459658) Received SIGTERM scheduling shutdown...
2024-03-26 13:27:38.307 UTC [42] LOG: received fast shutdown request
2024-03-26 13:27:38.314 UTC [42] LOG: aborting any active transactions
2024-03-26 13:27:38.321 UTC [42] LOG: background worker "logical replication launcher" (PID 51) exited with exit code 1
2024-03-26 13:27:38.322 UTC [46] LOG: shutting down
111:M 26 Mar 2024 13:27:38.353 # User requested shutdown...
111:M 26 Mar 2024 13:27:38.353 * Saving the final RDB snapshot before exiting.
2024-03-26 13:27:38.415 UTC [42] LOG: database system is shut down
111:M 26 Mar 2024 13:27:39.896 * DB saved on disk
111:M 26 Mar 2024 13:27:39.896 # Redis is now ready to exit, bye bye...
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 3889 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"=>"assets_precompile", "cmd"=>["su discourse -c 'bundle exec rake themes:update assets:precompile'"]}
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.
fe4eec7726fdbe08aaa2691e806bb17423a8f4eaedb8414397e3097d725e04c7
كملاحظة لاحقة، لم أقم بربط الموقع الذي حدث فيه هذا، لأن أحد أعضاء الفريق كان يختبر خطأ في النواة في حاوية منفصلة على نفس الخادم، وقام بتعطيل الخادم بأكمله عن طريق الخطأ، لذا فإن ربط الموقع لن يساعد على الإطلاق.