غير قادر على تثبيت Discourse Question Answer: ON CONFLICT DO NOTHING

فشل تثبيت Discourse Question Answer

== 20211020062413 CreateQuestionAnswerVotes: migrating =======
-- create_table(:question_answer_votes, {})
   -> 0.0478s
-- add_index(:question_answer_votes, [:post_id, :user_id], {:unique=>true})
   -> 0.0024s
-- execute("INSERT INTO question_answer_votes (post_id, user_id, created_at)
SELECT
  X.post_id AS post_id,
  (X.value>>'user_id')::int AS user_id,
  (X.value>>'created_at')::timestamp AS created_at
FROM (
  SELECT
    post_id,
    jsonb_array_elements(value::jsonb) AS value
  FROM post_custom_fields WHERE name = 'vote_history'
) AS X
WHERE (X.value>>'action') != 'destroy'
ORDER BY (X.value>>'created_at')::timestamp DESC
ON CONFLICT DO NOTHING
")

I, [2022-09-05T08:36:29.418247 #1]  INFO -- : Terminating async processes
I, [2022-09-05T08:36:29.418302 #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: 41
ds WHERE name = 'vote_history'
) AS X
WHERE (X.value>>'action') != 'destroy'
ORDER BY (X.value>>'created_at')::timestamp DESC
ON CONFLICT DO NOTHING
")

I, [2022-09-05T08:36:29.418247 #1]  INFO -- : Terminating async processes
I, [2022-09-05T08:36:29.418302 #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: 41
I, [2022-09-05T08:36:29.418383 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 102
2022-09-05 08:36:29.418 CST [41] LOG:  received fast shutdown request
102:signal-handler (1662338189) Received SIGTERM scheduling shutdown...
2022-09-05 08:36:29.419 CST [41] LOG:  aborting any active transactions
2022-09-05 08:36:29.422 CST [41] LOG:  background worker "logical replication launcher" (PID 50) exited with exit code 1
2022-09-05 08:36:29.426 CST [45] LOG:  shutting down
102:M 05 Sep 2022 08:36:29.437 # User requested shutdown...
102:M 05 Sep 2022 08:36:29.437 * Saving the final RDB snapshot before exiting.
2022-09-05 08:36:29.466 CST [41] LOG:  database system is shut down
102:M 05 Sep 2022 08:36:29.896 * DB saved on disk
102:M 05 Sep 2022 08:36:29.896 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse &amp;&amp; su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 790 exit 1>
Location of failure: /usr/local/lib/ruby/gems/2.7.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.
e3d5cb6cab0a78a5d9b12c2fb6f5dac60c4e1182509b163f1a4fbdf207578f04

لقد قمت بتثبيت إضافة Question Answer الخاصة بـ Pavilion وقمت بإزالتها منذ فترة طويلة

كما تقول الرسالة…

عذرًا، هذا هو السجل الكامل:

https://paste.ubuntu.com/p/pmQfNzSk3J/

يبدو أن هناك مشكلة في حقل ‘vote_history’:

I, [2022-09-05T19:39:21.422820 #1]  INFO -- : > cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate'
2022-09-05 19:39:34.506 CST [819] discourse@discourse ERROR:  cannot extract elements from a scalar
2022-09-05 19:39:34.506 CST [819] discourse@discourse STATEMENT:  INSERT INTO question_answer_votes (post_id, user_id, created_at)
        SELECT
          X.post_id AS post_id,
          (X.value->>'user_id')::int AS user_id,
          (X.value->>'created_at')::timestamp AS created_at
        FROM (
          SELECT
            post_id,
            jsonb_array_elements(value::jsonb) AS value
          FROM post_custom_fields WHERE name = 'vote_history'
        ) AS X
        WHERE (X.value->>'action') != 'destroy'
        ORDER BY (X.value->>'created_at')::timestamp DESC
        ON CONFLICT DO NOTHING

rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

كان هناك تقرير آخر عن خطأ مماثل مؤخرًا - Bootstrap failed with exit code 1 على الرغم من عدم وجود حل منشور هناك بعد.

ربما يكون هذا تعارضًا مع تثبيت إضافة Pavilion سابقًا؟ @Hifihedgehog، هل كان موقعك قد قام بتثبيت هذه الإضافة سابقًا أيضًا؟

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

الخطأ في السطر 586.

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

تعديل: يبدو أن إزالة إجابة السؤال ستحل المشكلة على المدى القصير.

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