Urgent help needed : Query failed in load_user_capability.

Urgent help needed : Query failed in load_user_capability.

by Stephan R. SENGUPTA -
Number of replies: 19
I've made some clean up deleting some test courses (sand boxes).
I've changed the name of the primary admin and his password.
I've assigned some role Teacher's, Admin, ...

A user (sudent) tried to log and got the folowing error message :
Query failed in load_user_capability.
He pressed the "continue" buton and reached the start page. He couldn't log into his course.

I tried to log as primary admin and got the same error message, And I've lost all my admin capabilities.

What shall I do ?

Thanks for your urgent help
Average of ratings: -
In reply to Stephan R. SENGUPTA

Re: Urgent help needed : Query failed in load_user_capability.

by Stephan R. SENGUPTA -
I feel alone in that cold Moodle world. Is there anybody out there ?
In reply to Stephan R. SENGUPTA

Re: Urgent help needed : Query failed in load_user_capability.

by Łukasz Leszewski -
I feel alone with my roles problem for 2 weeks sad
In reply to Stephan R. SENGUPTA

Re: Urgent help needed : Query failed in load_user_capability.

by Stephan R. SENGUPTA -
I could fix it by correcting manually the database.
http://moodle.org/mod/forum/discuss.php?d=58405

I'm running 1.7 and I thought to upgrade to 1.7.1. But the bug still has to be fixed as it seems not fixed in 1.8.

- http://moodle.org/mod/forum/discuss.php?d=58723&mode=3

- http://tracker.moodle.org/browse/MDL-6456

- http://tracker.moodle.org/browse/MDL-8159

I haven't received any answer to my own tracker.

http://tracker.moodle.org/browse/MDL-8241

I haven't received any answer to this post.

Asking for urgent help and not getting answer is a bit dispointing.

Can someone tell me, either Martin Dougiamas or anyone, if the Moddle team is working on this issue and preparing a patch for 1.7 ?
In reply to Stephan R. SENGUPTA

Re: Urgent help needed : Query failed in load_user_capability.

by Stacey Borsody -
Wow! I just got my Moodle 1.7.1-latest set up and running yesterday and started doing configuration and testing/adding/deleting of sandbox courses and went to bed happy. When I got up this morning to check on things, I got this error when trying to log in as my Administrator account! At least it is a known issue, but I'm surprised it hasn't been fixed yet in the ASAP way an OSS project can accomplish.

Just for reference, here's the query:

SELECT rc.capability, c1.id as id1, c1.id as id2, (c1.contextlevel * 100) AS aggrlevel,
SUM(rc.permission) AS sum
FROM mdl_role_assignments ra, mdl_role_capabilities rc, mdl_context c1
WHERE ra.contextid=c1.id AND ra.roleid=rc.roleid
AND ra.userid=2 AND c1.id IN (1)
AND rc.contextid=1
AND ((ra.timestart = 0 OR ra.timestart < 1172848118)
AND (ra.timeend = 0 OR ra.timeend > 1172848118))
GROUP BY rc.capability, (c1.contextlevel * 100), c1.id
HAVING
SUM(rc.permission) != 0
ORDER BY aggrlevel ASC with limits (, )
In reply to Stacey Borsody

Re: Urgent help needed : Query failed in load_user_capability.

by Stacey Borsody -
LOL! *pulls hair out*

I had run mysqlcheck on the database and it totally buggered things. There were lots of 'file not found' errors of .frm files and somehow it freaked mysqld out to such the extent that I reinstalled mysql (after dumping my mediawiki db). I was running mysql-5.0.24a package from OpenBSD4.0 ports but now I downgraded to mysql-5.0.22. I re-ran the Moodle installation (considering I don't have any courses set up yet), went through the creation of a new user to check the email authentication. After that I logged out of my new user and logged into the Administrator account again. I got the same error AGAIN. And this time I haven't even deleted test courses or users!

I find it hard to believe this would be a database server problem. I'm rapidly loosing faith in using Moodle as my e-learning platform.

.s
In reply to Stephan R. SENGUPTA

Re: Urgent help needed : Query failed in load_user_capability.

by Guillermo Ramirez -

Hello

Today I had the same problem. When I logged in as administrator I got the message Query failed in load_user_capability and lost all administrative privileges.

Luckily I solved it by checking the database in my cpanel. I noticed that some tables where left open. So I run the repair option and the problem was solved.

In reply to Guillermo Ramirez

Re: Urgent help needed : Query failed in load_user_capability.

by Matt Molloy -

Hello all,

I've also been getting this problem several times over the past week or two. Try to update some course or something, and system returns error message that it couldn't update. Further activity produces the 'Query failed ....etc' message. Also, I loose all my admin priveleges and end up logged in as an ordinary user. Can't see hidden courses etc.

As I'm busy trying to meet a deadline, I haven't had time to investigate, so have resorted to the blunt instrument of simply rebooting the server. I'm on xp professional, xampp, fast machine, with bags of RAM (4gb).

Matt

In reply to Matt Molloy

Re: Urgent help needed : Query failed in load_user_capability.

by Stacey Borsody -
Strangely, rebooting seems to clear the problem. If it happens again I'll try restarting mysqld instead. I'm convinced that Moodle 1.7.1-latest isn't playing nicely with mysql.
Average of ratings: Useful (1)
In reply to Stacey Borsody

Re: Urgent help needed : Query failed in load_user_capability.

by Stacey Borsody -
It happened again. This time I had Debugging on so I got a bit more information. I actually got this shortly after getting an error while trying to edit a Choice activity. I found that restarting mysqld clears the problem. Note that I tried restarting Apache1 prior to restarting mysqld. I'm not as familiar with mysql as I should be and I'm wondering if anyone has more experience with the recommended settings for my.cnf than what comes with the default install on OpenBSD 4.0. Anyone having this problem with PostgreSQL or an earlier version of Moodle?

Error from Moodle:

File './moodle/tbg_groups_members.MYD' not found (Errcode: 9)

SELECT * FROM tbg_groups_members WHERE userid = '3'

Can't create/write to file '/tmp/#sql_1d25_0.MYD' (Errcode: 17)

SELECT rc.capability, c1.id as id1, c1.id as id2, (c1.contextlevel * 100) AS aggrlevel, SUM(rc.permission) AS sum FROM tbg_role_assignments ra, tbg_role_capabilities rc, tbg_context c1 WHERE ra.contextid=c1.id AND ra.roleid=rc.roleid AND ra.userid=3 AND c1.id IN (1) AND rc.contextid=1 AND ((ra.timestart = 0 OR ra.timestart <1172882520 and="" or=""> 1172882520)) GROUP BY rc.capability, (c1.contextlevel * 100), c1.id HAVING SUM(rc.permission) != 0 ORDER BY aggrlevel ASC

From the moodle db on the filesystem:

# ls -l tbg_groups_members.*
-rw-rw---- 1 _mysql _mysql 0 Mar 2 08:00 tbg_groups_members.MYD
-rw-rw---- 1 _mysql _mysql 1024 Mar 2 08:00 tbg_groups_members.MYI
-rw-rw---- 1 _mysql _mysql 8666 Mar 2 08:00 tbg_groups_members.frm
In reply to Stacey Borsody

Re: Urgent help needed : Query failed in load_user_capability.

by Stacey Borsody -
I may have found the answer. On OpenBSD 4.0, mysql defaults to some low number of allowed file descriptors, around 500.

Does anyone here know the recommended number of mysql's open-file-limit variable for a Moodle installation?
In reply to Stephan R. SENGUPTA

Re: Urgent help needed : Query failed in load_user_capability.

by Stacey Borsody -
These instructions may help some of you. The problem is related to the Moodle database having a large number of tables and a low default mysql setting for the number of allowed open files. You can see on your mysql server what the current value is by looking at the output of SHOW VARIABLES.

http://www.openbsdsupport.org/mysql.htm

I really wish I could find some more extensive recommendations for mysql settings in these forums...
In reply to Stacey Borsody

Re: Urgent help needed : Query failed in load_user_capability.

by Scott Nixon -
Where you able to fix the problem?

We are having the same issue. I made the change to the open_files_limit for mysql and the problem didn't go away. Thanks!
In reply to Scott Nixon

Re: Urgent help needed : Query failed in load_user_capability.

by Konu Ullah -
Hi I am also getting the Query failed error and would also like to change the open files limit to see if it solves the problem. I am not sure on how to do this as I am new to mysql. I am currently running mysql version 4.1.16 on windows 2003 running iis. Any help appreciated.
In reply to Konu Ullah

Re: Urgent help needed : Query failed in load_user_capability.

by Scott Nixon -
This didn't work for us and it seems to be getting worst. Basically, it's happening more often.

We are using MySQL 5.0 so I don't know if the process is the same for you. Under the MySQL folder there is a file called my.ini where I added 'open-files-limit = 10240' under the [mysqld].

If I run "show variables;" at the MySQL command line it returns the value of 2048 with this new setting. I feel pretty ignorant of the whole process and its value so take it for what it's worth. Good Luck, let me know if you figure it out.
In reply to Stephan R. SENGUPTA

Re: Urgent help needed : Query failed in load_user_capability.

by Michael Street -
I'm not sure if you've got this sorted out yet, but I ran into this problem with our installation today. Turns out it was a very silly problem with running out of free space on out /tmp partition.
In reply to Michael Street

Re: Urgent help needed : Query failed in load_user_capability.

by Konu Ullah -

Urgent

I have now updated to moodle 1.7.2 and have my table_cache setting to 128 and my open_files_limit is set to 2048 and and i constantly getting "Query failed in load_user_capability" is there a solution for Windows users? I have learners who need to use it without moodle failing every 5 minutes.  Please help, Thanks

In reply to Konu Ullah

Re: Urgent help needed : Query failed in load_user_capability.

by Mike Robinson -
last tuesday (8th May) we had the same message, couldn't of happened at a worse time.. we had moodle training going on all over college, luckily restarting mysql sorted it out and people could get back on.

any news on how to prevent this happening again on our windows server would be helpful ( I guess this post is mostly to keep this thread active )
In reply to Mike Robinson

Re: Urgent help needed : Query failed in load_user_capability.

by allen tseng -
I met the same error message today. and fininally found that the harddisk is full.

after clear up some space in the harddisk, problem solved.