レビューで投稿を承認する際に「500内部サーバーエラー」が発生

こんにちは、

Discourse のバージョン 2.5.1 を使用しており、レビューで投稿を承認すると「500 Internal Server Error」が発生します。

/logs に表示されたエラーは以下の通りです:

Message (7 copies reported)

ActiveRecord::StatementInvalid (PG::InFailedSqlTransaction: ERROR:  current transaction is aborted, commands ignored until end of transaction block
)
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-2.0.2/lib/patches/db/pg.rb:72:in `exec_params'

Backtrace

rack-mini-profiler-2.0.2/lib/patches/db/pg.rb:72:in `exec_params'
rack-mini-profiler-2.0.2/lib/patches/db/pg.rb:72:in `exec_params'
activerecord-6.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:675:in `block (2 levels) in exec_no_cache'
activesupport-6.0.3.1/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
activesupport-6.0.3.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
activesupport-6.0.3.1/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
activerecord-6.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:674:in `block in exec_no_cache'
activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract_adapter.rb:722:in `block (2 levels) in log'
activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract_adapter.rb:721:in `block in log'
activesupport-6.0.3.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract_adapter.rb:712:in `log'
activerecord-6.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:673:in `exec_no_cache'
activerecord-6.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:654:in `execute_and_clear'
activerecord-6.0.3.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:111:in `exec_delete'
activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:180:in `delete'
activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `delete'
activerecord-6.0.3.1/lib/active_record/relation.rb:587:in `delete_all'
/var/www/discourse/app/models/topic_link.rb:376:in `cleanup_entries'
/var/www/discourse/app/models/topic_link.rb:139:in `extract_from'
/var/www/discourse/lib/post_creator.rb:576:in `extract_links'
/var/www/discourse/lib/post_creator.rb:180:in `block in create'
/var/www/discourse/lib/post_creator.rb:359:in `block in transaction'
activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in `transaction'
activerecord-6.0.3.1/lib/active_record/transactions.rb:212:in `transaction'
/var/www/discourse/lib/post_creator.rb:358:in `transaction'
/var/www/discourse/lib/post_creator.rb:174:in `create'
/var/www/discourse/app/models/reviewable_queued_post.rb:80:in `perform_approve_post'
/var/www/discourse/app/models/reviewable.rb:355:in `public_send'
/var/www/discourse/app/models/reviewable.rb:355:in `block in perform'
「いいね!」 1

カミーユが説明したのと同じ状況で、私どもも同様の問題が発生しています。

まず投稿を編集し、その後承認を試みましたが、問題は解消されませんでした。

解決策はございますでしょうか?

よろしくお願いいたします。

「いいね!」 1

v2.5.2 +2 バージョンでも同じ問題が発生しています。
「最初の投稿で高速タイピングユーザーを自動沈黙させる」オプションが有効な投稿で問題が起きているようです。

こんにちは @CamilleRoux さん!

ローカル環境では再現できませんでしたので、何か見落としているのかもしれません。これは、キューイングされた投稿を承認しようとする際に常に発生するのでしょうか、それとも特定の投稿でのみ発生するのでしょうか?

レビューには他のメッセージがありません。もっと情報を提供するにはどうすればよいでしょうか?

「信頼レベルが最大の場合、新しいトピックを承認する」設定を最大値に設定したところ、新しいトピックを投稿すると 500 エラーが発生するようになりました。これは非常に似たエラーのようです:

ActiveRecord::StatementInvalid (PG::InFailedSqlTransaction: ERROR:  current transaction is aborted, commands ignored until end of transaction block
)
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-2.0.2/lib/patches/db/pg.rb:72:in `exec_params'

バックトレース

rack-mini-profiler-2.0.2/lib/patches/db/pg.rb:72:in `exec_params'
rack-mini-profiler-2.0.2/lib/patches/db/pg.rb:72:in `exec_params'
activerecord-6.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:675:in `block (2 levels) in exec_no_cache'
activesupport-6.0.3.1/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
activesupport-6.0.3.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
activesupport-6.0.3.1/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
activerecord-6.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:674:in `block in exec_no_cache'
activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract_adapter.rb:722:in `block (2 levels) in log'
activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'

コンテナに入り、同じタイムスタンプ付近の PostgreSQL ログにエラーがないか確認できますか?

「いいね!」 2

トピックのエラーに関するエラーメッセージは以下の通りです:

2020-10-01 18:37:18.894 UTC [25661] discourse@discourse ERROR:  列 "private_message" の null 値が not-null 制約に違反しています
2020-10-01 18:37:18.894 UTC [25661] discourse@discourse DETAIL:  失敗した行の内容は (8803, 'a':25 'api':4A,17 'arriv':23 'avanc':48 'bas':14 'cod':54 'comm..., Comment obtenir l'API odoo sur React Native? Developpement J'u..., fr, 3, null) です。
2020-10-01 18:37:18.894 UTC [25661] discourse@discourse STATEMENT:  INSERT INTO post_search_data
	(post_id, search_data, locale, raw_data, version)
	VALUES (8803, setweight(to_tsvector('french', coalesce('Comment obtenir l''API odoo sur React Native?','')), 'A') ||
	setweight(to_tsvector('french', coalesce('Developpement','')), 'B') ||
	setweight(to_tsvector('french', coalesce('','')), 'C') ||
	setweight(to_tsvector('french', coalesce('J’utilise Odoo comme base de donnees API sur react native mais j’arrive pas a me connecter, j’ai utilise le package npm react-native-odoo , vous pouvez voir mon erreur sur l’image. Merci d’avance pour vos reponses Voici mon Code oddo et l’erreur que j’obtiens error','')), 'D')
	, 'fr', 'Comment obtenir l''API odoo sur React Native? Developpement J’utilise Odoo comme base de donnees API sur react native mais j’arrive pas a me connecter, j’ai utilise le package npm react-native-odoo , vous pouvez voir mon erreur sur l’image. Merci d’avance pour vos reponses Voici mon Code oddo et l’erreur que j’obtiens error', 3)

2020-10-01 18:37:18.897 UTC [25661] discourse@discourse ERROR:  現在のトランザクションは中止されており、トランザクションブロックの終了までコマンドは無視されます
2020-10-01 18:37:18.897 UTC [25661] discourse@discourse STATEMENT:  UPDATE topic_search_data
	SET
	   raw_data = 'Comment obtenir l''API odoo sur React Native? J’utilise Odoo comme base de donnees API sur react native mais j’arrive pas a me connecter, j’ai utilise le package npm react-native-odoo , vous pouvez voir mon erreur sur l’image. Merci d’avance pour',
	   locale = 'fr',
	   search_data = setweight(to_tsvector('french', coalesce('Comment obtenir l''API odoo sur React Native?','')), 'A') ||
	setweight(to_tsvector('french', coalesce('J’utilise Odoo comme base de donnees API sur react native mais j’arrive pas a me connecter, j’ai utilise le package npm react-native-odoo , vous pouvez voir mon erreur sur l’image. Merci d’avance pour','')), 'B') ||
	setweight(to_tsvector('french', coalesce(NULL,'')), 'C') ||
	setweight(to_tsvector('french', coalesce(NULL,'')), 'D')
	,
	   version = 3
	WHERE topic_id = 4351

2020-10-01 18:37:18.900 UTC [25661] discourse@discourse ERROR:  現在のトランザクションは中止されており、トランザクションブロックの終了までコマンドは無視されます
2020-10-01 18:37:18.900 UTC [25661] discourse@discourse STATEMENT:  DELETE FROM "topic_links" WHERE ((post_id = 8803 AND NOT reflection) OR (link_post_id = 8803 AND reflection))
「いいね!」 1

ありがとうございます、とても助かりました!

以前は beta ブランチをトラッキングしていたが、その後 stable に切り替えたのでしょうか?private_message カラムは v2.6.0.beta2 で追加されましたが、そのコミットは v2.5.2 +2 には含まれていません。該当コミットは以下の通りです:

「いいね!」 1

アールフ…はい、私がやったことです、申し訳ありません。本当にありがとうございます!

次の安定版は近日リリースされる予定ですか?

それは完全に非公式な操作であり、Discourse を破損させる結果になります。できるだけ早くデフォルトの tests-passed または beta に戻してください。

私たちは約 6 ヶ月に 1 回「安定版」をリリースしており、次のバージョンは Discourse Version 2.6 で追跡されています。

「いいね!」 1

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.