General help

 
 
Picture of John Reese
been getting these stats error lately - ...!!! Error writing to database !!!
 

I noticed in the last 2 weeks, I have been getting more of these errors ...

 

Running clean-up tasks...
...finished clean-up tasks
Running daily statistics gathering, starting at 1360742400:
................  finished until 1360828800: Thursday, 14 February 2013, 12:00 AM (in 432 s)
................  finished until 1360915200: Friday, 15 February 2013, 12:00 AM (in 555 s)
...!!! Error writing to database !!!

 

thoughts?

 

 

 
Average of ratings: -
Picture of Howard Miller
Re: been getting these stats error lately - ...!!! Error writing to database !!!
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Run with Debugging switched on. Hopefully the error will become a bit more helpful.

 
Average of ratings: -
Picture of John Reese
Re: been getting these stats error lately - ...!!! Error writing to database !!!
 

Hi Howard,

I don't want to turn on debugging as this is a production and it run via CLI.

Another interesting observation I've found too that if I wait long enough, it will fix it by itself in a few day...

 

Server Time: Tue, 19 Feb 2013 03:08:04 -0800

 

 

Running daily statistics gathering, starting at 1360915200:

................  finished until 1361001600: Saturday, 16 February 2013, 12:00 AM (in 292 s) ................  finished until 1361088000: Sunday, 17 February 2013, 12:00 AM (in 209 s) ................  finished until 1361174400: Monday, 18 February 2013, 12:00 AM (in 440 s) ................  finished until 1361260800: Tuesday, 19 February 2013, 12:00 AM (in 984 s) ...completed 4 days of statistics.

Running weekly statistics gathering, starting at 1360483200:

 finished until 1361088000: Sunday, 17 February 2013, 12:00 AM ...completed 1 weeks of statistics.

Running stats cleanup tasks...

...stats cleanup finished

Deleting old draft files... done.

Cleaning up files from deleted contexts... done.

Deleting trash files... done.

PRODUCTION 2.2.4+ Moodle Server STATISTICS COMPLETED CORRECTLY Execution took 1965.429888 seconds

 

The machine is pretty robust (6.3 redhat 64bit with 16 GB ram)... any other settings on the mysql or php side that I should consider to add/tweak?

thanks

 

 

 

 

 

 
Average of ratings: -
James Richardson
Re: been getting these stats error lately - ...!!! Error writing to database !!!
 

Hello John!

Its possible you may have a corrupted table in your database. If you are on a cPanel hosting you can try running a repair on the database through the MuSQL database section. Click here for more information on this.

If you are not on cPanel then you can try running a repair through shell command line. The following is for repairing a single database or all databases.

Repair a specific database
mysqlcheck -c --auto-repair <database_name>

Repair all databases on the server
mysqlcheck -c --auto-repair --all-databases

Database repairs can also fix other abberant behaviors as well.

Best Regards,

James R
InMotion

 

 

 
Average of ratings: -
Picture of John Reese
Re: been getting these stats error lately - ...!!! Error writing to database !!!
 

Hello James,

We have our own server inhouse and using VM. It was working for months.

Just today, it's working again...

Server Time: Wed, 20 Feb 2013 03:08:05 -0800


Running daily statistics gathering, starting at 1361260800:
................  finished until 1361347200: Wednesday, 20 February 2013, 12:00 AM (in 365 s)
...completed 1 days of statistics.
Running stats cleanup tasks...
...stats cleanup finished
Deleting old draft files... done.
PRODUCTION 2.2.4+ Moodle Server STATISTICS CRON SCRIPT COMPLETED CORRECTLY
Execution took 365.670504 seconds

------

I won't be surprised if something goes wrong again in the next few days thoughtful

It's an innoDB format so what do I use to check the integrity of the tables involved and which tables are they?

Thanks

 

 

 
Average of ratings: -
James Richardson
Re: been getting these stats error lately - ...!!! Error writing to database !!!
 

Hello John!

You can dump and reload the Innodb database to get it started fresh; however, it almost sounds like the error is happaning at a certian time. Check if the error occurs at the same time. Maybe the server is performing a task at the time you run the stats.

 

 

 

 
Average of ratings: -