تحديث PostgreSQL 18 لمستخدمي الاستضافة الذاتية

:warning: تحذير! إذا كانت قاعدة البيانات لديك كبيرة جداً، ستحتاج إلى مساحة إضافية كبيرة على القرص (3 أضعاف حجم قاعدة البيانات) ويجب أن تكون حذراً للغاية أثناء هذا التحديث!

لقد قمنا بتطبيق التغييرات اللازمة لترقية صورة Docker إلى PostgreSQL 18. أي مسؤول موقع يقوم بإعادة بناء Discourse من سطر الأوامر سيتم ترقية موقعه من PostgreSQL 15 السابق إلى PostgreSQL 18. يرجى ملاحظة أنه إذا كنت قد امتنعت عن الترقية عندما حدث تحديث PostgreSQL 15 في عام 2025، يمكنك تخطي تلك الترقية والانتقال مباشرة إلى PostgreSQL 18.

إذا كنت قد امتنعت عن الترقية سابقاً، قم بتغيير قالب PostgreSQL في ملف app.yml من templates/postgres.13.template.yml إلى templates/postgres.template.yml.

وكما هو الحال مع أي ترقية، يُنصح بقوة بأخذ نسخة احتياطية قبل القيام بأي شيء.

تغييرات اللغة والإعدادات المحلية (Locale)

في السابق، كنا نشهد حدوث تلف في الفهارس عند تحديث glibc، مثلما يحدث أثناء ترقية نظام التشغيل. منذ PostgreSQL 17، يوجد مزود إعدادات محلية مدمج جديد، وهو مستقل عن glibc الخاص بنظام التشغيل وبالتالي يكون مستقراً عبر الإصدارات. كجزء من هذه الترقية، نحن نتحول إلى استخدام هذا المزود المدمج باستخدام إعداد اللغة C.UTF-8. يستخدم هذا الإعداد ترتيب نقاط الرموز، ونوصي به لأسباب الاستقرار المذكورة أعلاه.

من أجل إنجاز تغيير إعدادات اللغة، نحتاج أولاً إلى إنشاء مجموعة قواعد البيانات (DB cluster) الجديدة باستخدام مزود الإعدادات المحلية المدمج، ثم نقوم بتصدير واستعادة قاعدة البيانات في هذه المجموعة. لهذا السبب، تكون متطلبات مساحة القرص أكبر من الترقيات السابقة حيث كنا نقوم بترقية في الموقع (in-place).

التحديث

دليل التثبيت الرسمي (حاوية واحدة)

في المرة القادمة التي تقوم فيها بإعادة البناء، ستظهر لك هذه الرسالة في النهاية:

-------------------------------------------------------------------------------------
اكتملت ترقية PostgreSQL

قاعدة البيانات القديمة (الإصدار 15) مخزنة في /shared/postgres_data_old

لاستكمال الترقية، قم بإعادة البناء مرة أخرى باستخدام:

./launcher rebuild app
-------------------------------------------------------------------------------------

هذا يعني أن كل شيء سار على ما يرام أثناء الترقية! تحتاج فقط إلى إصدار أمر إعادة بناء جديد لجعل موقعك يعمل مرة أخرى.

تثبيت حاوية البيانات

إذا كنت تشغل إعداداً يعتمد على حاوية بيانات مخصصة بناءً على العينة المقدمة في مستودع discourse_docker الخاص بنا، فأنت تريد التأكد من أنك تقوم بإيقاف تشغيل PostgreSQL بطريقة آمنة ونظيفة.

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

./launcher stop web_only
./launcher stop data
./launcher rebuild data
./launcher rebuild data
./launcher rebuild web_only

قبل إصدار أمر إعادة البناء الأول لحاوية البيانات، يمكنك تتبع سجل PostgreSQL (tail) لمعرفة ما إذا كان قد تم إيقافه بشكل صحيح.

تشغيل أمر tail -f shared/standalone/log/var-log/postgres/current يجب أن يعطيك السجل التالي إذا كان الإيقاف نظيفاً:

2025-01-24 09:19:06.437 UTC [37] LOG:  received smart shutdown request
2025-01-24 09:19:06.444 UTC [37] LOG:  background worker "logical replication launcher" (PID 54) exited with exit code 1
2025-01-24 09:19:06.446 UTC [49] LOG:  shutting down
2025-01-24 09:19:06.468 UTC [37] LOG:  database system is shut down

تأجيل التحديث

إذا كنت بحاجة إلى تأجيل التحديث أثناء إعادة البناء القادمة، يمكنك تبديل قالب PostgreSQL في ملف app.yml الخاص بك عن طريق تغيير "templates/postgres.template.yml" إلى "templates/postgres.15.template.yml".

لا يُنصح بذلك، حيث قد ينسى بعض مسؤولي المواقع عكس هذا التغيير لاحقاً.

مهام اختيارية بعد التحديث

تحسين إحصائيات PostgreSQL

بعد التحديث، لن تكون إحصائيات الجداول متاحةً في PostgreSQL الجديد. يمكنك إنشاؤها باستخدام:

docker exec -u postgres app \
	/usr/lib/postgresql/18/bin/vacuumdb -d discourse --analyze-in-stages

تنظيف البيانات القديمة

للتثبيت القياسي، يمكنك حذف البيانات القديمة بتنسيق PG15 باستخدام الأمر التالي:

cd /var/discourse
./launcher cleanup

إذا كانت لديك حاوية بيانات منفصلة، ستحتاج إلى إزالة النسخة الاحتياطية على النحو التالي:

rm -fr /var/discourse/shared/data/postgres_data_old/

الأسئلة الشائعة

لم يتم إيقاف تشغيل المجموعة المصدرية بشكل نظيف

إذا واجهت فشل في الترقية مع الرسالة أعلاه، يمكنك محاولة نهج أبسط لإعادة الوضع إلى حالة أفضل.

أعد تشغيل الحاوية القديمة باستخدام ./launcher start app. انتظر بضع دقائق حتى تعود للعمل.

الآن قم بإيقافها مرة أخرى باستخدام ./launcher stop app. بعد ذلك، تابع السجلات (tail logs) لمعرفة ما إذا كان الإيقاف نظيفاً:

tail -f shared/standalone/log/var-log/postgres/current
2025-01-24 09:19:06.437 UTC [37] LOG:  received smart shutdown request
2025-01-24 09:19:06.444 UTC [37] LOG:  background worker "logical replication launcher" (PID 54) exited with exit code 1
2025-01-24 09:19:06.446 UTC [49] LOG:  shutting down
2025-01-24 09:19:06.468 UTC [37] LOG:  database system is shut down

إذا لم تدل السجلات بأن قاعدة البيانات قد أُوقفت، يمكنك إعادة تشغيل الحاوية القديمة مرة أخرى، الدخول إليها باستخدام ./launcher enter app، تشغيل هذه الأوامر، ثم متابعة السجلات مرة أخرى عند الانتهاء.

export SVWAIT=300
sv stop nginx
sv stop unicorn
sv stop postgres
exit

إذا بدت السجلات كما هو موضح أعلاه، يمكنك الآن محاولة الترقية مرة أخرى باستخدام ./launcher rebuild app.

قيم lc_collate لقاعدة البيانات “postgres” غير متطابقة

يحدث هذا الخطأ إذا كنت تستخدم إعدادات لغة غير افتراضية لقاعدة البيانات. تم الإبلاغ عن أنك بحاجة إلى 3 متغيرات لكي تنجح العملية. تأكد من أن قسم env: في ملف app.yml الخاص بك يحتوي على الأسطر الثلاثة التالية:

  LC_ALL: en_US.UTF-8
  LANG: en_US.UTF-8
  LANGUAGE: en_US.UTF-8

مع تغيير en_US.UTF-8 إلى إعداد اللغة الخاص بك.

كل عملية إعادة بناء تقوم بالترقية مرة أخرى (حلقة ترقية)

عند حدوث ذلك، ستحتوي سجلات الترقية الخاصة بك على

mv: cannot move '/shared/postgres_data' to '/shared/postgres_data_old/postgres_data': Directory not empty
mv: cannot move '/shared/postgres_data_new' to '/shared/postgres_data/postgres_data_new': Directory not empty

هذا يعني أن هناك ملفات من الترقية الأخيرة لا تزال موجودة. قم بنقلها إلى مكان آخر قبل المتابعة.

لقد تخطيت تحديث PostgreSQL 15، ماذا أفعل الآن؟

يمكنك اتباع التعليمات القياسية في أعلى هذا الدليل، وسيقوم بالترقية من إصدارك إلى 18 دون أي مشاكل.

9 إعجابات

رائع، شكراً كريس!

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

ما نوع الفشل الأمل في أن يكون أنيقاً الذي سيحدث إذا لم يكن هناك مساحة كافية على القرص؟ من المؤكد أن شخصاً ما سيتخذ هذا المسار!

بالنسبة لأولئك الذين لا يملكون مساحة كافية على القرص، هل سيعمل أخذ نسخة احتياطية ثم استعادتها في تثبيت جديد كوسيلة للتحويل؟

(في هذه الحالة، قد يكون الوقت مناسباً أيضاً للترقية إلى إصدار LTS جديد من نظام التشغيل. إن أوبونتو 26.04 جديد نسبياً؛ ومن المتوقع ظهور الإصدار 26.04.1 قريباً جداً. قد يكون تثبيت نظام التشغيل الجديد أقل إزعاجاً من محاولة الترقية في المكان نفسه.)

3 إعجابات

كانت ستحدث لي، لولا أنني تلقيت إشعارًا عبر البريد الإلكتروني حول هذا المنشور :raised_back_of_hand: :flushed_face:

فقط للتأكد، هل هذا مطبق الآن؟

إذا قمت بالتحديث من سطر الأوامر لاحقاً هذا الصباح، هل سيحدث كل هذا؟

سيقوم سكريبت الترقية بالتحقق من المساحة الحرة ولن يواصل العمل إلا إذا كان ذلك آمناً.

هناك خطوتان خلال العملية حيث قد تصبح مساحة القرص حرجة. إذا تجاوزت فحص المساحة الحرة، فهذه هي النقاط التي قد تواجه فيها مشكلات:

  1. عند تشغيل pg_dump لاستخراج البيانات من قاعدة البيانات القديمة (يُطلب ضعف مساحة تخزين قاعدة البيانات في هذه المرحلة).
  2. عند تشغيل pg_restore لإدراج البيانات مرة أخرى في قاعدة البيانات الجديدة (يُطلب ثلاثة أضعاف مساحة تخزين قاعدة البيانات في هذه المرحلة).

للانتعاش من هذه الحالة، ستحتاج إلى إزالة /shared/postgres_dump و /shared/postgres_data_new.

لاحظ أنه في نهاية الترقية، نقوم بإزالة ملفات pg_dump المؤقتة، لكننا نحتفظ ببيانات قاعدة البيانات ما قبل الترقية في /shared/postgres_data_old احتياطياً. بمجرد رضاك عن أن كل شيء يعمل بشكل صحيح، قد ترغب في إزالة هذا المجلد لاستعادة مساحة القرص.

لقد اختبرت أخذ نسخة احتياطية من Discourse على موقع PG15 واستعادتها على موقع PG18. لقد نجحت لدي، لكن كن على علم بأن هذه الطريقة غير مدعومة رسمياً. اختبرها بشكل شامل أولاً على شيء غير إنتاجي وتأكد من وجود مسار للرجوع!

أوصي بدراسة العملية المستخدمة من قبل سكريبت الترقية. إذا كانت لديك متطلبات تخزين خاصة، فيجب أن تكون قادراً على تكييفها مع احتياجاتك. مرة أخرى، اختبر أولاً:

هذا موجود الآن في discourse_docker، نعم. إذا قمت بسحب main أو تشغيل ./launcher rebuild app، فستحصل عليه.

إيقاف discourse_docker عن الفرع main سيساعد في منع الترقيات العرضية إذا أردت تأجيلها.

إعجابَين (2)

هل يمكنك تقديم تفاصيل محددة حول ما تعنيه عبارة “كبير جدًا”؟

أفهم هذا على أنه يتطلب مساحة احتياطية لقاعدة البيانات أكبر بثلاث مرات، بغض النظر عن حجمها؟

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

عذراً، كانت تلك التحذيرات مُصاغة بشكل سيء وغير صحيحة.

إلى جانب قاعدة البيانات الموجودة على القرص، ستحتاج إلى مساحة حرة كافية لإخراج ملف التفريغ (dump) والنسخة الجديدة من قاعدة البيانات أثناء استعادتها. عادةً ما يكون حجم مخرجات pg_dump أصغر من دليل بيانات قاعدة البيانات، لذا يجب أن تكون مساحة حرة تعادل ضعف حجم قاعدة البيانات الحالية كافية. سأقوم بتصحيح ذلك في سكريبت الترقية.

تعديل: تم الآن تحديث فحص المساحة الحرة للبحث عن ضعف حجم قاعدة البيانات بدلاً من ثلاثة أضعاف.

3 إعجابات

يبدو أنه على الآلة الافتراضية ذات النواة الواحدة، يجب البقاء على PG15 postgres.15.template.yml بسبب هذا القيد:

pg_dump: error: -j/--jobs must be in range 1..2147483647

أو تعديل web.template.yml إلى -j1 لاستخدام معالج واحد. (ستعيد عملية إعادة البناء التالية القيمة الافتراضية).

نعم، توجد مثل هذه التكوينات! :blob_wave:

لقد واجهت هذه الخطأ بسبب طريقة حساب nproc (أنا أعمل على vCPU واحد): يجب أن يكون -j/–jobs في النطاق 1..2147483647 (إنه يحاول -j0 لأن $(($(nproc) - 1)) = 1 - 1 = 0)

ربما يجب تحديث سكريبت التحديث إلى شيء مثل -j$(( $(nproc) > 1 ? $(nproc) - 1 : 1 ))

إعجابَين (2)

واجهت هذه المشكلة على أحد الخوادم:

عالجت هذه المشكلة عن طريق نقل هذه الأدلة:

cd /var/discourse/shared/standalone
mv postgres_data_older postgres_data_oldest
mv postgres_data_old postgres_data_older

ثم اكتملت عملية ./launcher rebuild app بـ:

-------------------------------------------------------------------------------------
اكتملت ترقية POSTGRES

قاعدة البيانات القديمة 15 مخزنة في /shared/postgres_data_old

لإكمال الترقية، أعد البناء مرة أخرى باستخدام:

./launcher rebuild app
-------------------------------------------------------------------------------------

على خادم آخر، لدي خطأ مع pg_dump:

x86_64 arch detected.
Ensuring launcher is up to date
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 600 app
app
2.0.20260803-0122: Pulling from discourse/base
Digest: sha256:ab1e7217470759e63313a16bc5b71b9f2dd7d3ae8303286e5985f563ad12b7b3
Status: Image is up to date for discourse/base:2.0.20260803-0122
docker.io/discourse/base:2.0.20260803-0122
/usr/local/lib/ruby/gems/3.4.0/gems/pups-1.4.0/lib/pups.rb
/usr/local/bin/pups --stdin
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
I, [2026-08-03T09:02:29.698631 #1]  INFO -- : Reading from stdin
I, [2026-08-03T09:02:29.724575 #1]  INFO -- : File > /etc/service/postgres/run  chmod: +x  chown: 
I, [2026-08-03T09:02:29.737296 #1]  INFO -- : File > /etc/service/postgres/log/run  chmod: +x  chown: 
I, [2026-08-03T09:02:29.750650 #1]  INFO -- : File > /etc/runit/3.d/99-postgres  chmod: +x  chown: 
I, [2026-08-03T09:02:29.763301 #1]  INFO -- : File > /root/install_postgres  chmod: +x  chown: 
I, [2026-08-03T09:02:29.775620 #1]  INFO -- : File > /root/upgrade_postgres  chmod: +x  chown: 
I, [2026-08-03T09:02:29.777021 #1]  INFO -- : Replacing data_directory = '/var/lib/postgresql/18/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.778673 #1]  INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.780140 #1]  INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.781699 #1]  INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.783144 #1]  INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.784461 #1]  INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.785820 #1]  INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.787120 #1]  INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.788468 #1]  INFO -- : Replacing (?-mix:#?log_min_duration_statement *=.*) with log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.789816 #1]  INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres  peer in /etc/postgresql/18/main/pg_hba.conf
I, [2026-08-03T09:02:29.790932 #1]  INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/18/main/pg_hba.conf
I, [2026-08-03T09:02:29.792274 #1]  INFO -- : Replacing (?-mix:^host.*all.*all.*::1\/128.*$) with host all all ::/0 md5 in /etc/postgresql/18/main/pg_hba.conf
I, [2026-08-03T09:02:29.793638 #1]  INFO -- : > if [ -f /root/install_postgres ]; then
  /root/install_postgres && rm -f /root/install_postgres
elif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then
  socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
fi

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
Generating locales (this might take a while)...
  en_GB.UTF-8... done
  en_US.UTF-8... done
Generation complete.
2026/08/03 09:02:33 socat[35] E connect(, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): Connection refused
Upgrading PostgreSQL from version 15 to 18
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with this locale configuration:
  locale provider:   builtin
  default collation: C.UTF-8
  LC_COLLATE:  C.UTF-8
  LC_CTYPE:    C.UTF-8
  LC_MESSAGES: C.UTF-8
  LC_MONETARY: C.UTF-8
  LC_NUMERIC:  C.UTF-8
  LC_TIME:     C.UTF-8
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /shared/postgres_data_new ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default "max_connections" ... 100
selecting default "shared_buffers" ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /usr/lib/postgresql/18/bin/pg_ctl -D /shared/postgres_data_new -l logfile start

Get:1 http://deb.debian.org/debian bookworm-backports InRelease [59.4 kB]
Hit:2 http://deb.debian.org/debian bookworm InRelease
Get:3 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Hit:4 http://deb.debian.org/debian-security bookworm-security InRelease
Hit:5 https://deb.nodesource.com/node_22.x nodistro InRelease
Hit:6 https://dl.yarnpkg.com/debian stable InRelease
Hit:7 https://apt.postgresql.org/pub/repos/apt bookworm-pgdg InRelease
Fetched 115 kB in 1s (77.2 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  postgresql-15 postgresql-15-pgvector
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.2 MB of archives.
After this operation, 52.6 MB of additional disk space will be used.
Get:1 https://apt.postgresql.org/pub/repos/apt bookworm-pgdg/main amd64 postgresql-15 amd64 15.18-1.pgdg12+1 [15.0 MB]
Get:2 https://apt.postgresql.org/pub/repos/apt bookworm-pgdg/main amd64 postgresql-15-pgvector amd64 0.8.6-1.pgdg12+1 [271 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 15.2 MB in 1s (29.8 MB/s)
Selecting previously unselected package postgresql-15.
(Reading database ... 32784 files and directories currently installed.)
Preparing to unpack .../postgresql-15_15.18-1.pgdg12+1_amd64.deb ...
Unpacking postgresql-15 (15.18-1.pgdg12+1) ...
Selecting previously unselected package postgresql-15-pgvector.
Preparing to unpack .../postgresql-15-pgvector_0.8.6-1.pgdg12+1_amd64.deb ...
Unpacking postgresql-15-pgvector (0.8.6-1.pgdg12+1) ...
Setting up postgresql-15 (15.18-1.pgdg12+1) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Setting up postgresql-15-pgvector (0.8.6-1.pgdg12+1) ...
Processing triggers for postgresql-common (293.pgdg12+1) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
Creating new PostgreSQL cluster 15/main ...
/usr/lib/postgresql/15/bin/initdb -D /var/lib/postgresql/15/main --auth-local peer --auth-host scram-sha-256 --no-instructions
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_GB.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/15/main ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
Stopping PostgreSQL 15 database server: main.
Stopping PostgreSQL 18 database server: main.
waiting for server to start....2026-08-03 09:02:47.642 UTC [1145] LOG:  starting PostgreSQL 15.18 (Debian 15.18-1.pgdg12+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14+deb12u1) 12.2.0, 64-bit
2026-08-03 09:02:47.643 UTC [1145] LOG:  listening on IPv6 address "::1", port 5432
2026-08-03 09:02:47.644 UTC [1145] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2026-08-03 09:02:47.647 UTC [1145] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2026-08-03 09:02:47.664 UTC [1148] LOG:  database system was interrupted; last known up at 2026-08-03 08:59:02 UTC
2026-08-03 09:02:48.205 UTC [1148] LOG:  database system was not properly shut down; automatic recovery in progress
2026-08-03 09:02:48.212 UTC [1148] LOG:  invalid record length at 12/F5C779B0: wanted 24, got 0
2026-08-03 09:02:48.213 UTC [1148] LOG:  redo is not required
2026-08-03 09:02:48.218 UTC [1146] LOG:  checkpoint starting: end-of-recovery immediate wait
2026-08-03 09:02:48.230 UTC [1146] LOG:  checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.004 s, sync=0.002 s, total=0.013 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB
2026-08-03 09:02:48.252 UTC [1145] LOG:  database system is ready to accept connections
 done
server started
pg_dump: error: -j/--jobs must be in range 1..2147483647
-------------------------------------------------------------------------------------
UPGRADE OF POSTGRES FAILED
Failed on: su postgres -c "/usr/lib/postgresql/${PG_MAJOR_OLD}/bin/pg_dump -Fd -j$(($(nproc) - 1)) discourse -f /shared/postgres_dump/discourse"

Please visit https://meta.discourse.org/t/postgresql-18-update/406194 for support.

You can run ./launcher start app to restart your app in the meantime
-------------------------------------------------------------------------------------


FAILED
--------------------
Pups::ExecError: if [ -f /root/install_postgres ]; then
  /root/install_postgres && rm -f /root/install_postgres
elif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then
  socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
fi
 failed with return #<Process::Status: pid 18 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.4.0/gems/pups-1.4.0/lib/pups/exec_command.rb:138:in 'Pups::ExecCommand#spawn'
exec failed with the params {"tag" => "db", "cmd" => "if [ -f /root/install_postgres ]; then\n  /root/install_postgres && rm -f /root/install_postgres\nelif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then\n  socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1\nfi\n"}
bootstrap failed with exit code 1
---
HINT: The plugin 'discourse-calendar' is now bundled with Discourse and should not be included in your container configuration.
Remove the line 'git clone https://github.com/discourse/discourse-calendar' from your containers/app.yml file, then try again.
For more information, see https://meta.discourse.org/t/373574
---
---
HINT: The plugin 'discourse-templates' is now bundled with Discourse and should not be included in your container configuration.
Remove the line 'git clone https://github.com/discourse/discourse-templates' from your containers/app.yml file, then try again.
For more information, see https://meta.discourse.org/t/373574
---
---
HINT: The plugin 'discourse-policy' is now bundled with Discourse and should not be included in your container configuration.
Remove the line 'git clone https://github.com/discourse/discourse-policy' from your containers/app.yml file, then try again.
For more information, see https://meta.discourse.org/t/373574
---
** 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.
d2f4b0c8ce1d67917f88c87da7d3fd8886b2b3c93800e30ae6d8ceeeb131a419

هل هذا هو نفس الخطأ المذكور أعلاه؟ ما هو نص الترقية الذي يحتاج إلى التعديل لإصلاح هذا؟ @Nacho_Caballero

إعجابَين (2)

بيئة التطوير المحلية docker، سحب أحدث فرع release/2026.7

d/shutdown_dev

d/boot_dev

ثم تشغيل

d/rails s

واجهت الخطأ أدناه، ماذا أفعل؟

singi@GL-D-009011A:~/discourse$ d/rails s
Starting Pitchfork...
Starting CSS change watcher
URGENT: Failed to initialize site default: ActiveRecord::ConnectionNotEstablished connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?
connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?
connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?

/src/config/initializers/000-pg_connection_patch.rb:35:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.new_client'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql_adapter.rb:944:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#connect'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql_adapter.rb:956:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#reconnect'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:670:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:1224:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#attempt_configure_connection'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:669:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:668:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:778:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#verify!'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:766:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#verify!'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:786:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#connect!'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:992:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:991:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql/quoting.rb:128:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::Quoting#quote_string'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract/quoting.rb:76:in 'ActiveRecord::ConnectionAdapters::Quoting#quote'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql/quoting.rb:122:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::Quoting#quote'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1142:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#quoted_scope'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1119:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#data_source_sql'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract/schema_statements.rb:60:in 'ActiveRecord::ConnectionAdapters::SchemaStatements#table_exists?'
/src/lib/site_settings/db_provider.rb:58:in 'SiteSettings::DbProvider#table_exists?'
/src/lib/site_settings/db_provider.rb:14:in 'SiteSettings::DbProvider#all'
/src/lib/site_setting_extension.rb:1286:in 'SiteSettingExtension#fetch_setting_hash_from_provider'
/src/lib/site_setting_extension.rb:602:in 'block in SiteSettingExtension#refresh!'
/src/lib/site_setting_extension.rb:598:in 'Thread::Mutex#synchronize'
/src/lib/site_setting_extension.rb:598:in 'SiteSettingExtension#refresh!'
/src/config/initializers/005-site_settings.rb:19:in 'block (2 levels) in ,<main>'
/src/lib/freedom_patches/rails_multisite.rb:15:in 'block in RailsMultisite::ConnectionManagement.safe_each_connection'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/rails_multisite-7.0.0/lib/rails_multisite/connection_management/null_instance.rb:49:in 'RailsMultisite::ConnectionManagement::NullInstance#with_connection'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/rails_multisite-7.0.0/lib/rails_multisite/connection_management/null_instance.rb:36:in 'RailsMultisite::ConnectionManagement::NullInstance#each_connection'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/rails_multisite-7.0.0/lib/rails_multisite/connection_management.rb:17:in 'RailsMultisite::ConnectionManagement.each_connection'
/src/lib/freedom_patches/rails_multisite.rb:9:in 'RailsMultisite::ConnectionManagement.each_active_connection'
/src/lib/freedom_patches/rails_multisite.rb:14:in 'RailsMultisite::ConnectionManagement.safe_each_connection'
/src/config/initializers/005-site_settings.rb:18:in 'block in <main>'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:406:in 'BasicObject#instance_exec'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:406:in 'block in ActiveSupport::Callbacks::CallTemplate::InstanceExec0#make_lambda'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:178:in 'block in ActiveSupport::Callbacks::Filters::Before#call'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:668:in 'block (2 levels) in ActiveSupport::Callbacks::CallbackChain#default_terminator'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:667:in 'Kernel#catch'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:667:in 'block in ActiveSupport::Callbacks::CallbackChain#default_terminator'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:179:in 'ActiveSupport::Callbacks::Filters::Before#call'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:559:in 'block in ActiveSupport::Callbacks::CallbackSequence#invoke_before'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:559:in 'Array#each'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:559:in 'ActiveSupport::Callbacks::CallbackSequence#invoke_before'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:108:in 'ActiveSupport::Callbacks#run_callbacks'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/reloader.rb:96:in 'ActiveSupport::Reloader.prepare!'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/application/finisher.rb:73:in 'block in <module:Finisher>'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/initializable.rb:32:in 'BasicObject#instance_exec'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/initializable.rb:32:in 'Rails::Initializable::Initializer#run'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/initializable.rb:61:in 'block in Rails::Initializable#run_initializers'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:231:in 'block in TSort.tsort_each'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:353:in 'block (2 levels) in TSort.each_strongly_connected_component'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:434:in 'TSort.each_strongly_connected_component_from'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:352:in 'block in TSort.each_strongly_connected_component'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:350:in 'Rails::Initializable::Collection#each'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:350:in 'Method#call'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:350:in 'TSort.each_strongly_connected_component'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:229:in 'TSort.tsort_each'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:208:in 'TSort#tsort_each'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/initializable.rb:60:in 'Rails::Initializable#run_initializers'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/application.rb:444:in 'Rails::Application#initialize!'
/src/config/environment.rb:7:in '<top (required)>'
/usr/local/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
/usr/local/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
config.ru:8:in 'block in <main>'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/rack-2.2.23/lib/rack/builder.rb:125:in 'BasicObject#instance_eval'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/rack-2.2.23/lib/rack/builder.rb:125:in 'Rack::Builder#initialize'
config.ru:3:in 'Class#new'
config.ru:3:in '<main>'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:91:in 'Kernel#eval'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:91:in 'block in Pitchfork.builder'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:1160:in 'Pitchfork::HttpServer#build_app!'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:694:in 'block in Pitchfork::HttpServer#spawn_initial_mold'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:170:in 'block in Pitchfork.clean_fork'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:168:in 'Kernel#catch'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:168:in 'Pitchfork.clean_fork'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:690:in 'Pitchfork::HttpServer#spawn_initial_mold'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:176:in 'Pitchfork::HttpServer#start'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/exe/pitchfork:110:in '<top (required)>'
/src/bin/pitchfork:58:in 'Kernel#load'
/src/bin/pitchfork:58:in 'block in <main>'
/src/bin/pitchfork:58:in 'Kernel#fork'
/src/bin/pitchfork:58:in '<main>'
/src/config/initializers/000-pg_connection_patch.rb:35:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.new_client': فشل الاتصال بالخادم على المقبس "/var/run/postgresql/.s.PGSQL.5432": لا يوجد مثل هذا الملف أو الدليل (ActiveRecord::ConnectionNotEstablished)
        هل الخادم يعمل محليًا ويقبل الاتصالات على ذلك المقبس؟
فشل الاتصال بالخادم على المقبس "/run/postgresql/.s.PGSQL.5432": لا يوجد مثل هذا الملف أو الدليل
        هل الخادم يعمل محليًا ويقبل الاتصالات على ذلك المقبس؟
فشل الاتصال بالخادم على المقبس "/tmp/.s.PGSQL.5432": لا يوجد مثل هذا الملف أو الدليل
        هل الخادم يعمل محليًا ويقبل الاتصالات على ذلك المقبس؟

        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql_adapter.rb:944:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#connect'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql_adapter.rb:956:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#reconnect'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:670:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:1224:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#attempt_configure_connection'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:669:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:668:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:778:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#verify!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:766:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#verify!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:786:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#connect!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:992:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:991:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql/quoting.rb:128:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::Quoting#quote_string'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract/quoting.rb:76:in 'ActiveRecord::ConnectionAdapters::Quoting#quote'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql/quoting.rb:122:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::Quoting#quote'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1142:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#quoted_scope'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1119:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#data_source_sql'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract/schema_statements.rb:45:in 'ActiveRecord::ConnectionAdapters::SchemaStatements#data_source_exists?'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/schema_migration.rb:102:in 'block in ActiveRecord::SchemaMigration#table_exists?'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/schema_migration.rb:101:in 'ActiveRecord::SchemaMigration#table_exists?'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/migration.rb:1282:in 'ActiveRecord::MigrationContext#get_all_versions'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/migration.rb:1299:in 'ActiveRecord::MigrationContext#pending_migration_versions'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/migration.rb:1295:in 'ActiveRecord::MigrationContext#needs_migration?'
        from /src/config/initializers/100-flags.rb:6:in 'block in <main>'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:406:in 'BasicObject#instance_exec'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:406:in 'block in ActiveSupport::Callbacks::CallTemplate::InstanceExec0#make_lambda'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:178:in 'block in ActiveSupport::Callbacks::Filters::Before#call'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:668:in 'block (2 levels) in ActiveSupport::Callbacks::CallbackChain#default_terminator'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:667:in 'Kernel#catch'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:667:in 'block in ActiveSupport::Callbacks::CallbackChain#default_terminator'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:179:in 'ActiveSupport::Callbacks::Filters::Before#call'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:559:in 'block in ActiveSupport::Callbacks::CallbackSequence#invoke_before'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:559:in 'Array#each'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:559:in 'ActiveSupport::Callbacks::CallbackSequence#invoke_before'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:108:in 'ActiveSupport::Callbacks#run_callbacks'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/reloader.rb:96:in 'ActiveSupport::Reloader.prepare!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/application/finisher.rb:73:in 'block in <module:Finisher>'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/initializable.rb:32:in 'BasicObject#instance_exec'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/initializable.rb:32:in 'Rails::Initializable::Initializer#run'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/initializable.rb:61:in 'block in Rails::Initializable#run_initializers'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:231:in 'block in TSort.tsort_each'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:353:in 'block (2 levels) in TSort.each_strongly_connected_component'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:434:in 'TSort.each_strongly_connected_component_from'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:352:in 'block in TSort.each_strongly_connected_component'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:350:in 'Rails::Initializable::Collection#each'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:350:in 'Method#call'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:350:in 'TSort.each_strongly_connected_component'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:229:in 'TSort.tsort_each'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:208:in 'TSort#tsort_each'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/initializable.rb:60:in 'Rails::Initializable#run_initializers'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/application.rb:444:in 'Rails::Application#initialize!'
        from /src/config/environment.rb:7:in '<top (required)>'
        from /usr/local/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
        from /usr/local/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
        from config.ru:8:in 'block in <main>'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/rack-2.2.23/lib/rack/builder.rb:125:in 'BasicObject#instance_eval'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/rack-2.2.23/lib/rack/builder.rb:125:in 'Rack::Builder#initialize'
        from config.ru:3:in 'Class#new'
        from config.ru:3:in '<main>'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:91:in 'Kernel#eval'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:91:in 'block in Pitchfork.builder'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:1160:in 'Pitchfork::HttpServer#build_app!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:694:in 'block in Pitchfork::HttpServer#spawn_initial_mold'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:170:in 'block in Pitchfork.clean_fork'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:168:in 'Kernel#catch'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:168:in 'Pitchfork.clean_fork'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:690:in 'Pitchfork::HttpServer#spawn_initial_mold'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:176:in 'Pitchfork::HttpServer#start'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/exe/pitchfork:110:in '<top (required)>'
        from /src/bin/pitchfork:58:in 'Kernel#load'
        from /src/bin/pitchfork:58:in 'block in <main>'
        from /src/bin/pitchfork:58:in 'Kernel#fork'
        from /src/bin/pitchfork:58:in '<main>'
/home/discourse/.bundle/gems/ruby/3.4.0/gems/pg-1.6.3-x86_64-linux/lib/pg/connection.rb:944:in 'PG::Connection.connect_start': فشل الاتصال بالخادم على المقبس "/var/run/postgresql/.s.PGSQL.5432": لا يوجد مثل هذا الملف أو الدليل (PG::ConnectionBad)
        هل الخادم يعمل محليًا ويقبل الاتصالات على ذلك المقبس؟
فشل الاتصال بالخادم على المقبس "/run/postgresql/.s.PGSQL.5432": لا يوجد مثل هذا الملف أو الدليل
        هل الخادم يعمل محليًا ويقبل الاتصالات على ذلك المقبس؟
فشل الاتصال بالخادم على المقبس "/tmp/.s.PGSQL.5432": لا يوجد مثل هذا الملف أو الدليل
        هل الخادم يعمل محليًا ويقبل الاتصالات على ذلك المقبس؟

        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pg-1.6.3-x86_64-linux/lib/pg/connection.rb:944:in 'PG::Connection.connect_to_hosts'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pg-1.6.3-x86_64-linux/lib/pg/connection.rb:871:in 'PG::Connection.new'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pg-1.6.3-x86_64-linux/lib/pg.rb:88:in 'PG.connect'
        from /src/config/initializers/000-pg_connection_patch.rb:5:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.new_client'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql_adapter.rb:944:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#connect'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql_adapter.rb:956:in 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#reconnect'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:670:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:1224:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#attempt_configure_connection'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:669:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:668:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:778:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#verify!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:766:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#verify!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:786:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#connect!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:992:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:991:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql/quoting.rb:128:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::Quoting#quote_string'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract/quoting.rb:76:in 'ActiveRecord::ConnectionAdapters::Quoting#quote'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql/quoting.rb:122:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::Quoting#quote'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1142:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#quoted_scope'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1119:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#data_source_sql'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract/schema_statements.rb:45:in 'ActiveRecord::ConnectionAdapters::SchemaStatements#data_source_exists?'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/schema_migration.rb:102:in 'block in ActiveRecord::SchemaMigration#table_exists?'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/schema_migration.rb:101:in 'ActiveRecord::SchemaMigration#table_exists?'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/migration.rb:1282:in 'ActiveRecord::MigrationContext#get_all_versions'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/migration.rb:1299:in 'ActiveRecord::MigrationContext#pending_migration_versions'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activerecord-8.0.5/lib/active_record/migration.rb:1295:in 'ActiveRecord::MigrationContext#needs_migration?'
        from /src/config/initializers/100-flags.rb:6:in 'block in <main>'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:406:in 'BasicObject#instance_exec'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:406:in 'block in ActiveSupport::Callbacks::CallTemplate::InstanceExec0#make_lambda'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:178:in 'block in ActiveSupport::Callbacks::Filters::Before#call'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:668:in 'block (2 levels) in ActiveSupport::Callbacks::CallbackChain#default_terminator'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:667:in 'Kernel#catch'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:667:in 'block in ActiveSupport::Callbacks::CallbackChain#default_terminator'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:179:in 'ActiveSupport::Callbacks::Filters::Before#call'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:559:in 'block in ActiveSupport::Callbacks::CallbackSequence#invoke_before'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:559:in 'Array#each'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:559:in 'ActiveSupport::Callbacks::CallbackSequence#invoke_before'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/callbacks.rb:108:in 'ActiveSupport::Callbacks#run_callbacks'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/activesupport-8.0.5/lib/active_support/reloader.rb:96:in 'ActiveSupport::Reloader.prepare!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/application/finisher.rb:73:in 'block in <module:Finisher>'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/initializable.rb:32:in 'BasicObject#instance_exec'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/initializable.rb:32:in 'Rails::Initializable::Initializer#run'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/initializable.rb:61:in 'block in Rails::Initializable#run_initializers'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:231:in 'block in TSort.tsort_each'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:353:in 'block (2 levels) in TSort.each_strongly_connected_component'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:434:in 'TSort.each_strongly_connected_component_from'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:352:in 'block in TSort.each_strongly_connected_component'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:350:in 'Rails::Initializable::Collection#each'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:350:in 'Method#call'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:350:in 'TSort.each_strongly_connected_component'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:229:in 'TSort.tsort_each'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/tsort-0.2.0/lib/tsort.rb:208:in 'TSort#tsort_each'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/initializable.rb:60:in 'Rails::Initializable#run_initializers'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/railties-8.0.5/lib/rails/application.rb:444:in 'Rails::Application#initialize!'
        from /src/config/environment.rb:7:in '<top (required)>'
        from /usr/local/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
        from /usr/local/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
        from config.ru:8:in 'block in <main>'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/rack-2.2.23/lib/rack/builder.rb:125:in 'BasicObject#instance_eval'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/rack-2.2.23/lib/rack/builder.rb:125:in 'Rack::Builder#initialize'
        from config.ru:3:in 'Class#new'
        from config.ru:3:in '<main>'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:91:in 'Kernel#eval'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:91:in 'block in Pitchfork.builder'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:1160:in 'Pitchfork::HttpServer#build_app!'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:694:in 'block in Pitchfork::HttpServer#spawn_initial_mold'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:170:in 'block in Pitchfork.clean_fork'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:168:in 'Kernel#catch'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:168:in 'Pitchfork.clean_fork'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:690:in 'Pitchfork::HttpServer#spawn_initial_mold'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:176:in 'Pitchfork::HttpServer#start'
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/exe/pitchfork:110:in '<top (required)>'
        from /src/bin/pitchfork:58:in 'Kernel#load'
        from /src/bin/pitchfork:58:in 'block in <main>'
        from /src/bin/pitchfork:58:in 'Kernel#fork'
        from /src/bin/pitchfork:58:in '<main>'
mold gen=0 pid=189 reaped (#<Process::Status: pid 189 exit 1>)
/home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:179:in 'Pitchfork::HttpServer#start': فشل بدء تشغيل النموذج الأولي (Pitchfork::BootFailure)
        from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/exe/pitchfork:110:in '<top (required)>'
        from /src/bin/pitchfork:58:in 'Kernel#load'
        from /src/bin/pitchfork:58:in 'block in <main>'
        from /src/bin/pitchfork:58:in 'Kernel#fork'
        from /src/bin/pitchfork:58:in '<main>'

من المرجح أن يكون السبب هو الترقية من pg15 إلى pg18.

أعتقد أنني واجهت نفس المشكلة.

في /var/discourse/templates/web.template.yml، السطر الذي يجب تعديله هو سطر مهام تثبيت الحزمة (حوالي السطر 209):

قبل (يفشل على أجهزة ذات معالج واحد):

- su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'

بعد التعديل:

- su discourse -c 'bundle install --jobs 1 --retry 3'

أي استخدام --jobs 1، وليس -j1. يستخدم Bundler الخيار --jobs؛ أما -j فهو مخصص لـ pg_dump / pg_restore في templates/postgres.template.ymlpostgres.18.template.yml)، على سبيل المثال، قم بتغيير -j$(($(nproc) - 1)) إلى -j1 هناك إذا واجهت فشلًا في ترقية Postgres مرة أخرى.

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

لقد حللت المشكلة بالطريقة التالية.

d/shutdown_dev

# حذف قاعدة البيانات المحلية
sudo rm -rf ~/discourse/data/postgres

# إعادة تهيئة قاعدة البيانات
d/boot_dev -i

ستفقد بيانات التطوير المحلية!!! فكر في استعادتها من بيئة الاختبار.

يتم العمل على إصلاح مشكلة عدد النوى. لم أدرك أننا لدينا العديد من المستخدمين الذين يستخدمون معالجًا واحدًا فقط، آسف لذلك!

3 إعجابات

(تم حذف المنشور بواسطة الكاتب)

لقد قمت بتحديث اكتشاف عدد النوى لاستخدام nproc --ignore=1.

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

اكتملت أول ترقية بنجاح، على الرغم من أنني واجهت بعض الأخطاء الغريبة في اتصال الحاويات المؤقتة، والتي تم حلها بإعادة بناء البيانات مرة أخرى.

(هذا إعداد يتكون من حاويتين).

ولكن كل شيء انتهى بشكل جيد.

شكرًا جزيلاً لك على العمل الجاد في هذا المشروع!

إعجابَين (2)