urgent: error writing to database

urgent: error writing to database

از Faramarz Kazemainy در
Number of replies: 3

Dear all. For the second time this month, my site has stopped functioning and when I activated debug, I get the following message:

Debug info: UPDATE command denied to user 'autec'@'192.168.110.107' for table 'mdl_sessions' UPDATE mdl_sessions SET state = ?,sid = ?,userid = ?,sessdata = ?,timecreated = ?,timemodified = ?,firstip = ?,lastip = ? WHERE id=? [array (   0 => 0,   1 => 'an34takrmk2a33b8c5re1ka6v0',   2 => 0,   3 => NULL,   4 => 1332090391,   5 => 1332090391,   6 => '109.162.225.36',   7 => '109.162.225.36',   8 => '17974', )]
Stack trace:
  • line 397 of \lib\dml\moodle_database.php: dml_write_exception thrown
  • line 999 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1031 of \lib\dml\mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
  • line 639 of \lib\sessionlib.php: call to mysqli_native_moodle_database->update_record()
  • line ? of unknownfile: call to database_session->handler_read()
  • line 184 of \lib\sessionlib.php: call to session_start()
  • line 473 of \lib\sessionlib.php: call to session_stub->__construct()
  • line 60 of \lib\sessionlib.php: call to database_session->__construct()
  • line 688 of \lib\setup.php: call to session_get_instance()
  • line 29 of \config.php: call to require_once()
  • line 31 of \index.php: call to require_once()

So, since it is related to my students' scores, it's really critical to eliminate the problem; so please do me a favour and shed light on it and let me know your wise comments and help.

Your help will be really appreciated.

Best regards

p.s. the first time automatically after 3 days the site started functioning and then after almost 10 days again stopped working.

www.hescoo.com/ec

میانگین امتیازات:  -
In reply to Faramarz Kazemainy

Re: urgent: error writing to database

از Ken Task در
عکس Particularly helpful Moodlers

First, would highly recommend customizing a 404 page for your server.  The current config exposes way too much information: Windows, IIS 7.5, the Drive and Path to web root, etc. are all things that shouldn't be disclosed.

Now to ask about the problem:
see that sessions are being recorded into the DB as opposed to a sessions folder in moodledata/sessions/ as files.   Is the Moodle code (where the /ec in the URL provided) on the same server as the database server @192.168.110.107?

Is your Moodle on a shared system?  or dedicated?

Is the mysqld service set to listen and allow access on that interface (192.168.110.107)?
(an nmap scan of the public IP for the Moodle shows the MySQL port 3056 to be filterd).
or is it set to listen for localhost?

Think the most secure setup would be allow localhost ONLY.  Would recommend changing the Moodle config DB server to localhost if the DB service were on the SAME server as the Moodle.

The first line indicate the user (autec) is denied update on the server (192.168.110.107).  Could user autec update if user were accessing the DB server via localhost?
(note that it shows your IP address: 109.162.225.36)

Sessions just setups up a user connection to the server - preferences and permissions for a user.  Since user autec is denied, no login can be completed.
Does user autec have access rights to the database to update?

I don't think any of the error shown has anything to do with student scores.

'spirit of sharing', Ken

In reply to Ken Task

Re: urgent: error writing to database

از Faramarz Kazemainy در

Hi. Thank you very much for your help.

Yes everything is ok and they are all on the same server. I have activated the debug information and will deactivate it soon.

I have not been able to eliminate the problem.

Kindest regards,

Faramarz

In reply to Faramarz Kazemainy

Re: urgent: error writing to database

از Howard Miller در
عکس Core developers عکس Documentation writers عکس Particularly helpful Moodlers عکس Peer reviewers عکس Plugin developers
Probably exactly what it says...

UPDATE command denied to user 'autec'@'192.168.110.107'

The GRANT command that was used to set permissions for this user/host combination for your database must be wrong. Check this...

http://docs.moodle.org/22/en/MySQL#Command_line

and make you replace the moodleuser@locahost bit with autec@192.168.110.107. It won't hurt to repeat this command.