Database transaction aborted automatically

Database transaction aborted automatically

by Carlos Chiarella -
Number of replies: 6

Hi all,

We are getting this error when our students are taking quizzes:

Database transaction aborted automatically

in /var/../.../mod/quiz/processattempt.php, referer: https://.../.../mod/quiz/attempt.php?attempt=378578&cmid=6463

We are running a Moodle instance 3.5.3.

The session timeout is 4 hours.

The quiz autosave feature is on.

Is there something that we can do to avoid this error from happening?

Thanks for your help,

Carlos


Average of ratings: -
In reply to Carlos Chiarella

Re: Database transaction aborted automatically

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
This is probably a symptom of another problem, not a problem in itself. What else is in the logs at about the same time as those errors?
In reply to Tim Hunt

Re: Database transaction aborted automatically

by Carlos Chiarella -

Thanks Tim for your answer. For example today this is all that we have in our Apache logs:

[Wed Mar 25 13:03:38.372562 2020] [php7:notice] [pid 23344] [client 108.162.241.8:64664] Database transaction aborted automatically in /var/www/html/lms/mod/quiz/processattempt.php, referer: https://moodle.rcmusic.com/lms/mod/quiz/attempt.php?attempt=382573&cmid=6488

[Wed Mar 25 14:12:10.178728 2020] [php7:notice] [pid 24876] [client 162.158.126.96:52806] Database transaction aborted automatically in /var/www/html/lms/mod/quiz/processattempt.php, referer: https://moodle.rcmusic.com/lms/mod/quiz/attempt.php?attempt=382636&cmid=10236&page=9

[Wed Mar 25 14:42:13.215657 2020] [php7:notice] [pid 25707] [client 108.162.241.214:53388] Database transaction aborted automatically in /var/www/html/lms/mod/quiz/processattempt.php, referer: https://moodle.rcmusic.com/lms/mod/quiz/attempt.php?attempt=382663&cmid=6428&page=8

[Wed Mar 25 14:49:02.212296 2020] [php7:notice] [pid 25884] [client 108.162.241.214:52728] Database transaction aborted automatically in /var/www/html/lms/mod/quiz/processattempt.php, referer: https://moodle.rcmusic.com/lms/mod/quiz/attempt.php?attempt=382683&cmid=6428&page=2

[Wed Mar 25 14:51:41.852921 2020] [php7:notice] [pid 25900] [client 108.162.241.214:13228] Database transaction aborted automatically in /var/www/html/lms/mod/quiz/processattempt.php, referer: https://moodle.rcmusic.com/lms/mod/quiz/attempt.php?attempt=382689&cmid=6439&page=5

[Wed Mar 25 15:42:01.278451 2020] [php7:notice] [pid 27315] [client 108.162.242.19:23794] Database transaction aborted automatically in /var/www/html/lms/mod/quiz/processattempt.php, referer: https://moodle.rcmusic.com/lms/mod/quiz/attempt.php?attempt=382786&cmid=6436&page=2

[Wed Mar 25 15:43:08.605977 2020] [php7:notice] [pid 27299] [client 108.162.242.19:45180] Database transaction aborted automatically in /var/www/html/lms/mod/quiz/processattempt.php, referer: https://moodle.rcmusic.com/lms/mod/quiz/attempt.php?attempt=382786&cmid=6436&page=5

[Wed Mar 25 15:44:33.537121 2020] [php7:notice] [pid 27379] [client 172.69.63.139:37710] Database transaction aborted automatically in /var/www/html/lms/mod/quiz/processattempt.php, referer: https://moodle.rcmusic.com/lms/mod/quiz/attempt.php?attempt=382793&cmid=6410

[Wed Mar 25 16:04:32.374528 2020] [php7:notice] [pid 27921] [client 173.245.54.187:17656] Database transaction aborted automatically in /var/www/html/lms/mod/quiz/processattempt.php, referer: https://moodle.rcmusic.com/lms/mod/quiz/attempt.php?attempt=382847&cmid=6427

[Wed Mar 25 16:18:36.729651 2020] [php7:notice] [pid 28505] [client 162.158.126.96:21382] Database transaction aborted automatically in /var/www/html/lms/mod/quiz/processattempt.php, referer: https://moodle.rcmusic.com/lms/mod/quiz/attempt.php?attempt=382865&cmid=6463

[Wed Mar 25 16:50:44.908805 2020] [php7:notice] [pid 29791] [client 172.69.63.47:30390] Database transaction aborted automatically in /var/www/html/lms/mod/quiz/processattempt.php, referer: https://moodle.rcmusic.com/lms/mod/quiz/attempt.php?attempt=382939&cmid=6459&page=5

I am out of ideas. Thanks for your help,

Carlos


In reply to Carlos Chiarella

Re: Database transaction aborted automatically

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I'm assuming that is the Apache error log.

For just one of those timestamps, look at what is in the Apache access log, and the PHP log, around that time.
In reply to Tim Hunt

Re: Database transaction aborted automatically

by Carlos Chiarella -

Hi Tim,

PHP errors are going to the Apache logs. In the Apache Access logs there is nothing unusual.

44.224.22.196 - - [25/Mar/2020:13:30:52 +0000] "GET / HTTP/1.0" 400 0 "-" "-"

I turned on Debug in the site. It shows this:

[Thu Mar 26 16:08:05.338731 2020] [php7:notice] [pid 32011] [client 108.162.241.214:26004] Database transaction aborted automatically
in /var/www/html/lms/mod/quiz/processattempt.php, referer: https://moodle.rcmusic.com/lms/mod/quiz/attempt.php?attempt=384765&cmid=607

[Thu Mar 26 16:08:05.339423 2020] [php7:notice] [pid 32011] [client 108.162.241.214:26004]
Default exception handler: You have entered data outside the normal sequence. This can occur if you use your browser's Back or Forward buttons;
please don't use these during the test. It can also happen if you click on something while a page is loading.
Click <strong>Continue</strong> to resume.
Debug: \nError code: submissionoutofsequencefriendlymessage\n* line 2182 of /mod/quiz/attemptlib.php: moodle_exception thrown\n*
line 89 of /mod/quiz/processattempt.php: call to quiz_attempt->process_attempt()\n,
referer: https://moodle.rcmusic.com/lms/mod/quiz/attempt.php?attempt=384765&cmid=607

Does that mean something for troubleshooting the issue?

Thanks for your help,

Carlos

In reply to Carlos Chiarella

Re: Database transaction aborted automatically

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
In that case there is nothing to worry about. The other error means exactly what it says. The user did something they should not have done, and that leads to these errors in the logs. Don't worry.

(Would probably be better if these errors were not logged but there are several things that Moodle logs like this. It's not an easy problem to fix.