Failed to access question bank, memory exhaust

Failed to access question bank, memory exhaust

by Caio Gabriel Rodrigues de Melo -
Number of replies: 5

So i am having issues with my moodle site, where a certain user tries to acces a question bank in a course, the site tries to load the page but fails, when i activate debbuging, i get the following message

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 10477400 bytes) in /lib/dml/mysqli_native_moodle_database.php on line 1313

So, this user is the only one in this course that cannot  access the question bank, they have the exact same role and permissions as the other users in the course.

I have tried:

  • purging the caches;
  • changing this user's preferecences to default;
  • forcing quizzes where they had "in progress" state to "finished";
  • comparing this user's permissions with other users from the course(they were equal);
  • checking if the user had a role in the category where the course is from, to see if there's an override in permissions from the category to the course(the user is not enroled in any roles in the category);

Checking the logs of the user in the course, when they try to access the question bank, there are no logs related to this user accessing the question bank. 

So, for short, apparently the problem is not the memory size for the site, since my admin user and other users in the course with the same roles and permissions can access the question bank normaly.

Average of ratings: -
In reply to Caio Gabriel Rodrigues de Melo

Failed to access question bank, memory exhaust

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I normally set the memory limit to at least 512MB on production sites. Insufficient memory could easily be the problem.

Certain roles running out of resources is a fairly common issue.
Average of ratings: Useful (1)
In reply to Howard Miller

Failed to access question bank, memory exhaust

by Caio Gabriel Rodrigues de Melo -
So i increased the memory limit to 512MB, and the error persisted, only changing where it comes from.

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 2239368 bytes) in /lib/dml/mysqli_native_moodle_recordset.php on line 55

I was inclined to think that memory was not the issue for the not loading of the question bank page, because it only happend to this user specifically. So i am more lost than before, because i hoped that if i increased the memmory limit i would get another error or at least the page would load normally and i could compare in other enviroments and see what was different and possibly causing the memory exhaustion.

So if you have any ideas on the matter, i would apreciate the help.
In reply to Caio Gabriel Rodrigues de Melo

Failed to access question bank, memory exhaust

by Ken Task -
Picture of Particularly helpful Moodlers

Guess ... because you said ... "only happend to this user specifically".

Was that user the author of most questions?

Query of your DB

select id,parent,name,qtype,createdby from mdl_question;

createdby is the id number of the user that created the question.

Not sure of what to suggest to fix though! :|

'SoS', Ken

In reply to Ken Task

Failed to access question bank, memory exhaust

by Caio Gabriel Rodrigues de Melo -
So i fixed the problem. And it didn't had to do with the memory limit.
The issue was with the user preferences, more especifically, these three: question_bank_showhidden, question_bank_qbshowtext, question_bank_advanced_search.
They were set to the value 1 and i changed to the value 0. So one of them were causing to load more information and exhaust the memory limit.

But thank you very much, Howard and Ken, for your help and tips!
Average of ratings: Useful (1)
In reply to Caio Gabriel Rodrigues de Melo

Failed to access question bank, memory exhaust

by Friedhelm Küppers -
Picture of Particularly helpful Moodlers
Hello!

Where exactly did you change these three values? I looked in the database for a user. She set the value for question_bank_showhidden to 0 in the mdl_user_preferences table. I couldn't find the other two values for the user.

Best regards,
Friedhelm