خطأ ترحيل في 'rename_discourse_rewind_disabled_to_enabled'

فشل إعادة البناء (rebuild) ~ السجلات كما يلي:

discourse -c 'bundle exec rake db:migrate'
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled: (StandardError)
You must drop a column's default value before marking it as readonly
I, [2026-01-08T16:18:49.016491 #1]  INFO -- : Terminating async processes
I, [2026-01-08T16:18:49.018961 #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/15/bin/postmaster -D /etc/postgresql/15/main pid: 46
I, [2026-01-08T16:18:49.020147 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 113
2026-01-08 16:18:49.019 UTC [46] LOG:  received fast shutdown request
113:signal-handler (1767889129) Received SIGTERM scheduling shutdown...
2026-01-08 16:18:49.023 UTC [46] LOG:  aborting any active transactions
2026-01-08 16:18:49.034 UTC [46] LOG:  background worker "logical replication launcher" (PID 60) exited with exit code 1
2026-01-08 16:18:49.040 UTC [55] LOG:  shutting down
2026-01-08 16:18:49.042 UTC [55] LOG:  checkpoint starting: shutdown immediate
2026-01-08 16:18:49.057 UTC [55] LOG:  checkpoint complete: wrote 32 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.007 s, sync=0.004 s, total=0.017 s; sync files=16, longest=0.002 s, average=0.001 s; distance=180 kB, estimate=180 kB
2026-01-08 16:18:49.067 UTC [46] LOG:  database system is shut down
113:M 08 Jan 2026 16:18:49.108 # User requested shutdown...
113:M 08 Jan 2026 16:18:49.108 * Saving the final RDB snapshot before exiting.
113:M 08 Jan 2026 16:18:49.123 * DB saved on disk
113:M 08 Jan 2026 16:18:49.123 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 4483 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.3.0/lib/pups/exec_command.rb:131:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "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.
إعجاب واحد (1)

عذرًا، هذا خطئي. لقد وضعت قيود القيمة الافتراضية / الفارغة في الترحيل بترتيب خاطئ :man_facepalming:

4 إعجابات

لا بأس، سننتظرك حتى تصلحه. هيا، هيا~~~

إعجابَين (2)

لدي نفس المشكلة بعد آخر تحديث.

تم الآن تفعيل إصلاح @zogstrip لتلك الترحيلة في latest، لذا فإن تشغيل ترقية أخرى يجب أن يعيد الأمور إلى العمل مرة أخرى.

إعجابَين (2)

أعدت البناء للتو، ولا يزال لا يعمل

هل هناك حقًا أي اختبار لـ “الإصلاحات” المزعومة قبل اعتبار الأمور ثابتة؟

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

لقد جربت للتو إعادة البناء (rebuild) وما زال الفشل، ما هو السبب؟

I, [2026-01-09T05:09:31.402079 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2026-01-09T05:09:31.409979 #1]  INFO -- : > sleep 10
4481:C 09 Jan 2026 05:09:31.416 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
4481:C 09 Jan 2026 05:09:31.416 # Redis version=7.0.15, bits=64, commit=00000000, modified=0, pid=4481, just started
4481:C 09 Jan 2026 05:09:31.416 # Configuration loaded
4481:M 09 Jan 2026 05:09:31.417 * monotonic clock: POSIX clock_gettime
4481:M 09 Jan 2026 05:09:31.418 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
4481:M 09 Jan 2026 05:09:31.418 # Failed listening on port 6379 (TCP), aborting.
I, [2026-01-09T05:09:41.418357 #1]  INFO -- : 
I, [2026-01-09T05:09:41.421210 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled: (StandardError)
You must drop a column's default value before marking it as readonly
/var/www/discourse/lib/migration/column_dropper.rb:15:in `mark_readonly'
/var/www/discourse/plugins/discourse-rewind/db/migrate/20260105171115_rename_discourse_rewind_disabled_to_enabled.rb:15:in `up'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-8.0.4/lib/active_record/migration.rb:993:in `public_send'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-8.0.4/lib/active_record/migration.rb:993:in `exec_migration'
/var/www/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `block in exec_migration'
I, [2026-01-09T05:09:52.683547 #1]  INFO -- : Terminating async processes
I, [2026-01-09T05:09:52.684945 #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/15/bin/postmaster -D /etc/postgresql/15/main pid: 45
112I, [2026-01-09T05:09:52.685640 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 112
:signal-handler (1767935392) Received SIGTERM scheduling shutdown...
2026-01-09 05:09:52.686 UTC [45] LOG:  received fast shutdown request
2026-01-09 05:09:52.691 UTC [45] LOG:  aborting any active transactions
2026-01-09 05:09:52.708 UTC [45] LOG:  background worker "logical replication launcher" (PID 59) exited with exit code 1
2026-01-09 05:09:52.713 UTC [54] LOG:  shutting down
2026-01-09 05:09:52.716 UTC [54] LOG:  checkpoint starting: shutdown immediate
112:M 09 Jan 2026 05:09:52.718 # User requested shutdown...
112:M 09 Jan 2026 05:09:52.718 * Saving the final RDB snapshot before exiting.
2026-01-09 05:09:52.734 UTC [54] LOG:  checkpoint complete: wrote 17 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.007 s, sync=0.004 s, total=0.020 s; sync files=14, longest=0.002 s, average=0.001 s; distance=71 kB, estimate=71 kB
2026-01-09 05:09:52.750 UTC [45] LOG:  database system is shut down
112:M 09 Jan 2026 05:09:52.763 * DB saved on disk
112:M 09 Jan 2026 05:09:52.763 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 4484 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.3.0/lib/pups/exec_command.rb:131:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "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.
إعجاب واحد (1)

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

إذا كنت قد أجريت أي تغييرات على ملفات Discourse، فأنا أعلم أن ذلك يمكن أن يسبب مشاكل في المستقبل. أو إذا قمت بإضافة/تثبيت أي إضافات (plugins) يدويًا.

انتظر، تحلَّ بالصبر وأولئك الذين يعرفون أكثر مني سيساعدون. هذا أحد الأسباب التي تجعلني أحب هذا النظام وأنتقل إليه، المجتمع، هذا ما يجعله أعظم.

تعديل:
ومع ذلك، في المنتدى الثالث الخاص بي، لم ينجح إعادة البناء.
فشل (FAILED)

Pups::ExecError: cd /var/www/discourse && su discourse -c ‘bundle exec rake db:migrate’ failed with return #<Process::Status: pid 4466 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.3.0/lib/pups/exec_command.rb:131:in `spawn’
exec failed with the params {“cd”=>“$home”, “tag”=>“migrate”, “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.
63e30cde8c7295d25def35eef74dea30714627609c3d38b49a8f80865e5759cf

والآن يتم إعادة التوجيه إلى المنتدى الثاني الخاص بي… ماذا… ماذا… :rofl:

شكراً لردك. لم أقم بأي تعديلات ولم أقم بتثبيت أي إضافات إضافية.

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

ليس لدي أيضًا أي إضافات مثبتة يدويًا على منتدى الثالث الخاص بي، ولكن بعد إعادة البناء الفاشلة، وإعادة التوجيه إلى منتدى الثاني الخاص بي… تحققت أيضًا من ملف التكوين (nano containers/app.yml) وكل شيء على ما يرام هناك… ما الذي يحدث؟ :smiley:

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

إعادة البناء ناجحة

إعجابَين (2)

ليس بالنسبة لي :frowning: لحسن الحظ لدي نقطة استعادة خادم من 2026/05/01. للمرة الثانية، لا يمكنني تحديث أو إعادة بناء Discourse. الآن سأقوم باستعادته مرة أخرى، وشيء واحد واضح:

  1. عمل نسخة احتياطية لجميع المواضيع/المقالات في ملف نصي.
  2. آمل أن يتم حل هذا إما بتثبيت جديد لـ Discourse، أو بنظام آخر (وهو ما لا أريد القيام به).

هناك شيء ما في مكان ما فاتني ولا أعرف ما هو، وهذا يجنني. ولكن يبدو أن اليورانيوم الرجعي له رأيه. في الوقت الحالي سأترك الأمور على حالها، وسأذهب لتنظيف بعض الأخطاء في HELLDIVERS 2 لأنني حزين :rofl:

أتفهم إحباطكم وأعتذر. لقد اختبرت “إصلاحاتي” محليًا على قاعدة بيانات التطوير الخاصة بي، ثم على قاعدة بيانات جديدة تمامًا وكلاهما عمل بشكل جيد. بعد ذلك، اختبرت على نسخة مستضافة أديرها لمجتمع أديره وكانت تعمل بشكل جيد هناك أيضًا. كما اجتازت جميع اختبارات التكامل المستمر (CI) العامة لدينا (على GitHub) بالإضافة إلى اختبارات التكامل المستمر والاختبارات السريعة الداخلية لدينا.

كما حدث، لم يكن لدى أي من قواعد البيانات تلك بيانات تأثرت بتلك الترحيلة :expressionless_face:

أنا آسف لأنكم مررتم بتجربة سيئة وسأكون أكثر حذرًا في المرة القادمة.

4 إعجابات

إذًا… هل من الآمن المحاولة الآن أم أنها ستزيد الأمر سوءًا؟ لدي نفس المشكلة ولم أحاول إعادة البناء بعد رؤية هذا

بعد إعادة البناء، لاحظت أن البيانات ليست الأحدث، ثم أجريت عملية استعادة من النسخة الاحتياطية التي أُنشئت قبل يومين من لوحة الإدارة. لم يتم العثور على أي مشاكل حتى الآن.

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

يبدو أنه عمل بشكل جيد ويتم التحميل بشكل طبيعي لأي شخص آخر يتساءل

@here لمن يواجهون مشاكل، أعتقد أنا و @david أننا قد وجدنا السبب الجذري ولكن من الصعب إعادة إنتاجه محليًا.

هل يمكن لأي منكم تشغيل استعلامات SQL التالية والإبلاغ عن النتائج هنا؟

الاستعلام رقم 1

SELECT table_schema, column_name, column_default
FROM information_schema.columns
WHERE table_name = 'user_options' 
AND column_name = 'discourse_rewind_disabled'
ORDER BY table_schema;

الاستعلام رقم 2

SELECT n.nspname, n.oid
FROM pg_namespace n
JOIN pg_class c ON c.relnamespace = n.oid
WHERE c.relname = 'user_options'
ORDER BY n.oid;

الاستعلام رقم 3

SELECT table_schema, column_default IS NOT NULL as has_default
FROM information_schema.columns
WHERE table_name = 'user_options'
AND column_name = 'discourse_rewind_disabled';

الاستعلام رقم 4

SELECT nspname, oid FROM pg_namespace
WHERE nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast', 'public')
AND nspname NOT LIKE 'pg_temp%'
AND nspname NOT LIKE 'pg_toast_temp%'
ORDER BY oid;

شكرًا :folded_hands:

3 إعجابات

حسناً، لا مشكلة، أنا بالخارج حالياً، سأتحقق من الأمر عندما أعود.

هل يجب تشغيل هذه الأوامر داخل الحاوية؟ ما هي كلمة المرور الافتراضية لـ discourse و postsql عند النشر باستخدام docker؟