我在 Moodle 中从题库访问类别时遇到问题

I'm having problems accessing a category from a question bank in Moodle

提问人:Aristides Evandro 提问时间:11/15/2023 更新时间:11/15/2023 访问量:17

问:

我在 Moodle 中访问题库中的类别时遇到问题。

我在 4.0 版中使用 Moodle,在 7.4 版中使用 PHP。

当我尝试从 Moodle 中的题库访问类别时,出现以下错误:

Error writing to database:

Debug information:  Deadlock found when trying to get lock; try restarting transaction
DELETE FROM mdl_question_response_count WHERE analysisid IN (
SELECT id
FROM mdl_question_response_analysis
WHERE hashcode= ? AND whichtries = ? AND questionid = ?
)
\[array (
0 =\> '80ff80a084acf661db8978c57dabc0e88c0793f2',
1 =\> 'alltries',
2 =\> '7057133',
)\]
Error code: dmlwriteexception×Ignorar essa notificação
Rastreamento de pilha:
line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
line 291 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database-\>query_end()
line 1686 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database-\>query_end()
line 216 of /question/classes/statistics/responses/analysis_for_question.php: call to mysqli_native_moodle_database-\>delete_records_select()
line 140 of /question/classes/statistics/responses/analyser.php: call to core_question\\statistics\\responses\\analysis_for_question-\>cache()
line 753 of /mod/quiz/report/statistics/report.php: call to core_question\\statistics\\responses\\analyser-\>calculate()
line 722 of /mod/quiz/report/statistics/report.php: call to quiz_statistics_report-\>analyse_responses_for_questions()
line 675 of /mod/quiz/report/statistics/report.php: call to quiz_statistics_report-\>analyse_responses_for_all_questions_and_subquestions()
line 950 of /mod/quiz/report/statistics/report.php: call to quiz_statistics_report-\>get_all_stats_and_analysis()
line 2492 of /mod/quiz/lib.php: call to quiz_statistics_report-\>calculate_questions_stats_for_question_bank()
line 8053 of /lib/moodlelib.php: call to mod_quiz_calculate_question_stats()
line 149 of /question/classes/local/statistics/statistics_bulk_loader.php: call to component_callback()
line 65 of /question/classes/local/statistics/statistics_bulk_loader.php: call to core_question\\local\\statistics\\statistics_bulk_loader::load_statistics_for_place()
line 1037 of /question/classes/local/bank/view.php: call to core_question\\local\\statistics\\statistics_bulk_loader::load_aggregate_statistics()
line 984 of /question/classes/local/bank/view.php: call to core_question\\local\\bank\\view-\>load_required_statistics()
line 768 of /question/classes/local/bank/view.php: call to core_question\\local\\bank\\view-\>display_question_list()
line 59 of /question/edit.php: call to core_question\\local\\bank\\view-\>display()

我已经尝试重新启动服务器(linux)和数据库,我也尝试更新linux服务器。

我清除了moodledata中的缓存和localcache,但它并没有解决问题。

在我的本地主机测试 Moodle 中,我复制了数据库并且它工作正常,但在生产 Moodle 中它继续给出错误。换句话说,这可能不是数据库的问题,但我不确定。

数据库 服务器 事务 死锁 Moodle

评论


答:

1赞 Russell England 11/15/2023 #1

看起来这是由 MDL-75576 在 Moodle 4.0.8 中修复的

该代码已被删除

https://github.com/moodle/moodle/commit/118d3e855a3755a7c24c2927652101c853ead85b

您可能需要升级,最新版本是 Moodle 4.0.11

或者尝试应用提交

git show 118d3e855a3755a7c24c2927652101c853ead85b