|
Hi Eloy,
I suspect there is something serious about this. Please refer to http://moodle.org/mod/forum/discuss.php?d=94934 Reopening and adding some people here.
This is the improvement that added the "disk full" emails. I would suggest to limit the number of emails (1/day...) and... also... to add the log record information to the message, in order to see what's causing the error on insert and fix it. Feel free to comment.... Ciao P.S.: Anyway Manish, I really think that this issue in the logs cannot cause the quiz problem you comment at all ( http://moodle.org/mod/forum/discuss.php?d=94934 Let's use the original bug to talk about the log issue, I'll reopen it.
My GUESS is that this issue a temporary problem on that server which has now caused permanent errors in the table that need repairing. Yup, agree about your guess... I'll keep this open until
Thanks! Martin, yesterday I repaired database using cPanel operation. After that also I got the email, "Insert into log table failed at Tuesday 15th of April 2008 01:12:57 AM. It is possible that your disk is full."
Eloy, the problems related to quiz remain and the reason of correlating the two is that there were no issues with quiz earlier and the problems have cropped up later and if you look at my post you would notice some zeroes in the screenshot which I guess are not usual in the table. Hi Manish,
we have just send to CVS some changes to logs (
So, if you can update your site in 24 hours... hopefully some error will happen again and then, if you share the problematic statement here... we'll be able to try to fix it. TIA! About the quiz problem... I really think they are unrelated (at least I cannot imagine any relation until we get the information above, to see if the problems in logs are happening when logging some quiz operations). Anyway, I'd suggest you to:
That way, quiz maintainer (Tim Hunt) will be able to suggest you things / request more information and detect where is the problem. Thanks a lot! Ciao Hi Eloy,
Here are the contents of the email I got just now after replacing datalib.php file: Insert into log table failed at Wednesday 16th of April 2008 07:23:05 AM. The failed SQL is: INSERT INTO mdl_log (time, userid, course, ip, module, cmid, action, url, info) I wonder if it has anything to do with http://tracker.moodle.org/browse/MDL-13812 One more email has come in which 'choice' is replaced by 'course':
Insert into log table failed at Wednesday 16th of April 2008 11:50:06 AM. The failed SQL is: INSERT INTO mdl_log (time, userid, course, ip, module, cmid, action, url, info) Hi Manish,
and did you received those emails from the same server? Strange, because one of the things implemented is about to receive only ONE notification per day. Uhm... Anyway, the offending SQL statement looks really perfect (no strange chars, correct numbers...). I've executed here manually and there isn't any problem with it. So... next step should be about to examine MySQL logs to see if something is being notified there when your logs fail to be inserted. I really cannot imagine any reason for this failing randomly. Perhaps some buggy MySQL version could be the problem? Or so very-very busy server? Only that and table needing repair/optimise are my ideas. Ciao Any insight here? I'll close this in some days... seems to be working perfectly.
Hi Eloy,
I have not received that email since last 4 days. When I got most of those emails it appeared to be a very busy period for the server. There was an event and a very large number of users were accessing the site. Now, how a busy server is linked to that message would be interesting to understand. Uhm... perhaps under high load, your MySQL server rejects some connections and that's the ultimate cause for that message? Or the log table is practically locked due to high concurrence or some timeouts happen?
I would suggest to: 1) Analyse and optimise your database from time to time (it's a heavy operation, so it's recommended to perform it when the server is idle). I'm going to close this because seems to be some problem in your end... feel free to continue commenting here if you need anything else. Ciao I don't think this should be closed quite yet. We are getting the following message:
Insert into log table failed at Tuesday 01st of July 2008 12:45:33 AM. The failed SQL is: INSERT INTO mdl_log (time, userid, course, ip, module, cmid, action, url, info) This isn't a Moodle bug, Matthew, it's some MySQL administration issue, so it shouldn't be here in the tracker.
However, some discussion about how to detect/fix the actual problem could be useful in the moodle.org forums Martin,
The SQL fails because it is an invalid SQL statement. The course field is set to blank. It should be a numeric value and MySQL is smart enough to know that it is a number even though it has ' ' around it...but since it is blank it mismatches the field type. I don't see how this is anything but a Moodle problem. We are having the same issue and there are no errors in the MySQL log.
Would it be possible to add the error message the server returns when the query is executed to the e-mail? This would certainly help narrow down the cause of the problem. The site load at the time was minimal (two actions in the same minute the log insert failed) so it appears that isn't the issue for us. We are having the same issue with no errors in the mysql logs.
Petr and Eloy, is there any way (in Moodle code) we can find out more details about the problem when it happens so we can give users more accurate feedback?
We have the same problem with this SQL:
INSERT INTO mdl_log (time, userid, course, ip, module, cmid, action, url, info) Our Moodle is 1.9.2+ Well,
I can see two ways to complete the information, adding these: 1) Dump the stack trace to know which script was the original caller of the add_to_log() call. That will help to know the originator of problems like the blank course commented by Matthew above. Ciao Same issue since over here.
Using 1.9.2+ since august. Second or third time I'm getting this mail. INSERT INTO mdl_log (time, userid, course, ip, module, cmid, action, url, info) Disk is certainly not full. I suggests adding debug message like as follows to solve this problem;
lib/datalib.php, function add_to_log() // My site does not has this problem, then I can not check this code. assigning to Eloy, he probably knows more about this
The fact that MySQL has a 4GB limit..
MyISAM table with dynamic (variable length) rows, the index file for the table (tablename.MYI) stores row locations using 32-bit pointers into the data file (tablename.MYD). That means it can address only 4GB of space. For a long time 4GB was an entire hard disk and most operating systems had trouble with files larger than 2GB, so when MySQL designed their engine they didnt think for a while that there will be someone who will use that much of storage or at least reach millions of records in his table :s from my point of view; the 32-bit pointer is ideal becasue most people are running MySQL on 32-bit hardware (Intel/Linux), hence, the 32-bit pointer is most efficient way to do this on 32-bit hardware. okay okay.. I know I talked so much.. but how to overcome this problem? and enlarge the limit or 4 GB? here we go, MYSQL>show table status like 'mdl_log' \G To change the 4 GB, just execute MYSQL>alter table mdl_log max_rows = 200000000000 avg_row_length = 50; now you are done, but notice that the alter statement may take long time. another note that if you are using 64-bit machine you will not need to execute the alter statement becasue the installation of mysql will increase the max_data_length accordingly. cheers.. Amr Hourani! I also keep receiving messages like those.
Upgraded yesterday to latest version and received the following message today: INSERT INTO mdl_log (time, userid, course, ip, module, cmid, action, url, info) VALUES ('1234761350', '1', '1', '66.249.65.169', 'course', '0', 'view', 'view.php?id=1', '1') In the 10th February, received: And in 6th February: I don't know if it is important, but the FrontPage backup keeps returning errors. Received other error messages...
Insert into log table failed at Friday 20th of February 2009 05:26:21 AM. The failed SQL is: INSERT INTO mdl_log (time, userid, course, ip, module, cmid, action, url, info)
Insert into log table failed at Monday 23rd of February 2009 05:22:40 AM. The failed SQL is: INSERT INTO mdl_log (time, userid, course, ip, module, cmid, action, url, info)
I have got the same issue with one of my installation. I am getting approximately one such email per week. The server is not mine (commercial webhosting) so I can't provide more information right now.
Some problem here, running 1.9.3
INSERT INTO log (time, userid, course, ip, module, cmid, action, url, info) We've checked the server's load, cpu and memory usage and everything look normal. Just to complement:
The error returned is: MySQL server has gone away. We've moodle working with persistent connections but it didn't help. This problem seems to have been around a long while (March 08), I'm not a programmer so I am not much use to the dev team but I thought this description may help.
This error has only become apparent for us since we upgraded the Moodle version three weeks ago. We have had an increasing number of students using the system but we are not a large site compared with some (< 100 students on at any one time). We have the same 'INSERT INTO' messages as noted above. We have noticed that the error happens when the front page partially loads, left column and centre column load but right column is not present and centre column spreads across to right of the browser window - as you'd expect. The browser then waits for the remainder of the page to load but it doesn't. At the same time one of the server CPUs hits 100% utilisation. The only way to get out of the situation is to stop the MySql server and then restart it. Apache then sends its error message "INSERT INTO" etc to our admin email address. This is happening many times a day - probably 10 times yesterday. We are constantly resetting MYSQL just to keep classes running. We have updated to the latest release Moodle 1.9.5+ (Build: 20090729) Our Mysql runs two installations of moodle (one configured as a staff portal and one for students) - I hope this helps - I will butt out now let the real guru's get on with the job - Thanks to all. Hi Gaurav,
as commented above we cannot really do much here but:
But really we cannot do too much else if the insert query is ok (like all cases above but the Matthew one) and the DB is giving errors. FWIW, I'm also seeing similar things with Moodle 1.9.5+ and an Oracle 10g RAC backend. The message is always a variant on:
Insert into log table failed at Tuesday 20th of October 2009 02:06:10 PM. The failed SQL is: INSERT INTO m_log (time, userid, course, ip, module, cmid, action, url, info) The database seems fine otherwise. Thanks, Brad, I'm getting the same thing with our Moodle 1.9.5+ and Oracle 10g installation.
I think it's the fact that, in the m_log table, all the fields have a 'NOT NULL' constraint, and SQL statements like yours (and some I've seen on our system) try to put the empty string (i.e. '') into one of the fields (like the 'url' field in the SQL statement in your example). Our Moodle administrator contacted me with a similar example, but in our case, the empty string was for the 'action' field. Perhaps it would be enough to take the 'NOT NULL' constraint off a few of those fields (at least the 'action' and 'url' fields)? Can anyone reading this think of anything in Moodle 1.9.5+ that would break if some of the fields in records in the log table were empty? Cheers, Hi Brad, Guy... your problem is a different one caused by moodle trying to insert '' (empty char) in that tables. Oracle assumes empty = null. It's a well-know problem we have already handled in other places. I'm going to fix that, plz, don't change table/field specs.
This bug remains open since ages because of MySQL prone to fail inserting records from time to time and we haven't found any cause in Moodle, but some ideas to avoid that concurrence of workaround it. So, for the Oracle problem... fixing/testing now... I'll keep you informed. Ciao Follow-up for the Oracle problem with empty URLs... going to fix that there:
We are getting this error as well on 1.9.6 running MySQL 5. Here are several messages we've received over the last couple weeks. All of the SQL executes when I run it manually, so it seems to be valid SQL.
Insert into log table failed at Wednesday 04th of November 2009 09:17:10 PM. It is possible that your disk is full.The failed SQL is: Insert into log table failed at Wednesday 28th of October 2009 10:17:01 PM. It is possible that your disk is full.The failed SQL is: Insert into log table failed at Saturday 24th of October 2009 10:21:39 PM. It is possible that your disk is full.The failed SQL is: I've altered the page to email the specific MySQL error. We'll see what happens. We are getting this error as well on 1.9.6 running MySQL 5. Here are several messages we've received over the last couple weeks. All of the SQL executes when I run it manually, so it seems to be valid SQL.
Insert into log table failed at Wednesday 04th of November 2009 09:17:10 PM. It is possible that your disk is full.The failed SQL is: Insert into log table failed at Wednesday 28th of October 2009 10:17:01 PM. It is possible that your disk is full.The failed SQL is: Insert into log table failed at Saturday 24th of October 2009 10:21:39 PM. It is possible that your disk is full.The failed SQL is: I've altered the page to email the specific MySQL error. We'll see what happens. I'm seeing the same error, with near identical SQL INSERT statements under Moodle 1.9.7+ MySQl 5. The database checks out ok. We started seeing these errors after we installed Moodle 1.9.7 and moved the Moodle database to a dedicated MySQL server (separate from the Moodle server). Based on our monitoring, we don't think this is a load issue; the alerts are sent infrequently and at all hours; the last one was at midnight.
We've increased our MySQL log level to see if we can get any more details on this error. Thanks!
if they are "incorrect" insert sqls, then we can fix them. If they are correct sqls, then all we can do is to blame MySQL, or recommend ppl to switch from MyISAM (table locks) to InnoDB (row locks, plus a lot of nice extras like proper isolation, transactions...). Ciao |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
is this an error in some of the moodle.org sites? Or in your own server?
If it's in your server I'd suggest you to take a look to disk space (perhaps it's really full). Else, try to repair the log table in your DB, you can do it from phpMyAdmin.
Hope this helps, closing as "not a bug". Ciao