تثبيت Discourse على الإنترانت - فشل bootstrap مع رمز الخروج 17

مرحباً،

أقوم بتثبيت Discourse في بيئة إنترانت. يحدث أحيانًا أن أواجه هذا الخطأ أثناء عملية إعادة البناء:

Pups::ExecError: cd /var/www/discourse && su discourse -c ‘bundle install --retry 3 --jobs 4’ failed with return #<Process::Status: pid 645 exit 17>
الموقع الذي فشل فيه: /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”=>“bundle_exec”, “cmd”=>[“su discourse -c ‘bundle config --local deployment true’”, “su discourse -c ‘bundle config --local without \"development test\"’”, “su discourse -c ‘bundle install --retry 3 --jobs 4’”]}
bootstrap failed with exit code 17
** 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.
6ef3d42536c82021bdb1f24980cbd860572869f207e4eb2001e59e8923b182cf
root@wpyb3816:/var/discourse# cat /etc/docker/daemon.json

هل يعرف أحد ما يمكن أن يكون؟
شكراً.

هل تحصل على أي رسائل خطأ أخرى في وقت سابق في سجل البناء الخاص بك؟

3 إعجابات

I, [2024-03-29T14:58:21.260866 #1] INFO – :
I, [2024-03-29T14:58:21.261079 #1] INFO – : > su postgres -c ‘createdb discourse’ || true
2024-03-29 14:58:21.298 UTC [55] postgres@postgres ERROR: database “discourse” already exists
2024-03-29 14:58:21.298 UTC [55] postgres@postgres STATEMENT: CREATE DATABASE discourse;
createdb: error: database creation failed: ERROR: database “discourse” already exists
I, [2024-03-29T14:58:21.299606 #1] INFO – :
I, [2024-03-29T14:58:21.299710 #1] INFO – : > su postgres -c ‘psql discourse -c “create user discourse;”’ || true
2024-03-29 14:58:21.334 UTC [59] postgres@discourse ERROR: role “discourse” already exists
2024-03-29 14:58:21.334 UTC [59] postgres@discourse STATEMENT: create user discourse;
ERROR: role “discourse” already exists

and then another error before the crash …

[2024-03-29T14:59:48.410149 #1] INFO – : > cd /var/www/discourse & su discourse -c ‘bundle install --retry 3 --jobs 4’
Retrying fetcher due to error (2/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn’t have the CA certificates needed for verification. For information about OpenSSL certificates, see OpenSSL Errors and Rails – Certificate Verify Failed · RailsApps.
Retrying fetcher due to error (3/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn’t have the CA certificates needed for verification. For information about OpenSSL certificates, see OpenSSL Errors and Rails – Certificate Verify Failed · RailsApps.
Retrying fetcher due to error (4/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn’t have the CA certificates needed for verification. For information about OpenSSL certificates, see OpenSSL Errors and Rails – Certificate Verify Failed · RailsApps.
Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most
likely your system doesn’t have the CA certificates needed for verification. For
information about OpenSSL certificates, see
OpenSSL Errors and Rails – Certificate Verify Failed · RailsApps.
I, [2024-03-29T14:59:49.328710 #1] INFO – : Fetching source index from https://rubygems.org/

هذه هي المشكلة. يبدو أن الإنترنت الخاص بك يمنع الوصول إلى rubygems.

يتطلب Discourse https ويجب أن يكون التثبيت القياسي قابلاً للوصول عبر عنوان IP عام للحصول على شهادة. من المحتمل أن تواجه مشكلة بسبب هذا أيضًا.

إعجاب واحد (1)

حسناً، لقد قمت بطلب داخلي لفتح عنوان URL هذا… حيث إن جميع عناوين URL مغلقة افتراضيًا في بيئة إنترانت.
بمجرد الانتهاء من ذلك، سأعلمك بالنتيجة. شكراً لك.

نفس الخطأ مع فتح الرابط https://rubygems.org/

إذا لم تتمكن من فتح الخادم لجميع المواقع، فسيتعين عليك قراءة الرسائل بنفسك وفتح كل موقع يتم تحميله واحدًا تلو الآخر. مع فترة إنجاز مدتها 6 أيام، أتوقع أن يستغرق الأمر شهرًا أو شهرين.

إن جعل Discourse يعمل على شبكة إنترانت خاصة لا يمكنها الوصول إلى الإنترنت غير مدعوم حقًا. قد تتمكن من بناء صورة في مكان آخر ثم محاولة تشغيلها على شبكة الإنترانت الخاصة بك. لا يزال يتعين عليك إيجاد طريقتك الخاصة للحصول على شهادات https.

إعجاب واحد (1)

مرحباً،

إليك ما قمت به:

  • لقد قمت بإنشاء صورة من خارج الإنترانت على جهاز الكمبيوتر الخاص بي
  • لقد قمت بتحميلها إلى مستودع
  • لقد قمت بسحب الصورة على الجهاز الافتراضي على الإنترانت ثم بدأت حاوية
    ./launcher start app --run-image my image

الحاوية تعمل بشكل جيد ولكن يبدو أن المنافذ 80/443 غير قابلة للوصول (لقد تحققت باستخدام nmap وهي مفتوحة!). لا يمكنني الوصول إلى التطبيق من المتصفح. عندما أكتب: curl -v localhost:80 أحصل على هذا الخطأ.

* Uses proxy env variable no_proxy == 'localhost,127.0.0.1,.laposte.fr'
*   Trying 127.0.0.1:80...
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host: localhost
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer

تخميني هو أنه ليس لديك شهادات وأن nginx يفشل. تحتاج إلى إزالة قوالب ssl و let’s encrypt وإنشاء صورة جديدة. ثم ستحتاج إلى وكيل عكسي يحتوي على شهادة.

قد تتمكن بدلاً من ذلك من استخدام شهادة قمت بإنشائها بنفسك. أعتقد أنه لا يزال هناك موضوع حول كيفية القيام بذلك (من قبل وجود let’s encrypt).

يمكنك النظر في سجلات nginx لرؤية الأخطاء.

لم أقم بتفعيل قالب letsencrypt في ملف app.yml الخاص بي، لذلك لا ينبغي أن أقلق بشأن طلب الإزالة هذا، أليس كذلك؟ أستخدم واجهة أمامية VIP مع شهادتها الخاصة.