Serious errors when installing

Serious errors when installing

by Nigel Singleton -
Number of replies: 10
Have tried to install three times now. Checked parameters and hoster had this to say on the last installation: I ran through more of the installation but ended up with this error:

Could not create guest user record !!!
SERIOUS ERROR: Could not create admin user record !!!

I've not found any useful information about how to fix this so far.
We are not running MySQL in "strict SQL" mode as one solution
suggested.

Any ideas?

Thanks.


Average of ratings: -
In reply to Nigel Singleton

Re: Serious errors when installing

by Nigel Singleton -
In addition I just don't know what the admin login information is. The "mdl_user" table is empty.
In reply to Nigel Singleton

Re: Serious errors when installing

by Ken Wilson -
Those error messages are coming from lib/adminlib.php and lib/dmllib.php functions, especially the insert_record function in dmllib.php - which is failing and causing the errors to be flagged. In order to find out what's happening, try these steps:
  1. Moodle is complaining that there is something wrong - it cannot insert a record into the database - so try first by checking for fundamentals, e.g. disk space, mysql communications problems (try increasing max_packet_size in your my.cnf to >> 4M).
  2. Try downloading a fresh copy of moodle and dropping and re-creating the moodle database one more time.
  3. If your moodle/config.php file, add these lines:

    $CFG->debugdisplay = true;
    $CFG->debug = 2048;
    $CFG->dblogerror = true;
Re-run the install and let us know if there are any error messages displayed.

Thanks

Ken
In reply to Ken Wilson

Re: Serious errors when installing

by rob mock -
Howdy!
Ken, you tried to help me with the same error several months ago in this post:
http://moodle.org/mod/forum/discuss.php?d=58049#p331062

I had no luck and gave up for a few months, hoping that version 1.8 would work. I'd always had good luck installing [even very large] scripts on my hosted machine, so this surprised me. I am now in contact with a really helpful tech support guy at my host, and this is what he wrote me today:

"After thoroughly checking and testing Moodle, I can safely say that the issue is with the code, not our MySQL settings. As far as I can tell, Moodle's implementation of ADODB (which is how it prepares SQL statements) isn't working as it should. It's difficult to explain, but the upshot is that ADODB thinks that the "name" column in mdl_config has to be an integer and so to "protect" the data, it transforms the value of the string that's meant to go into "name" into a 0. However, the string was always supposed to be a string, and so Moodle errors out because it doesn't expect that 0. This all happens in PHP and before Moodle even tries to insert the data. It may be a bad interaction with MySQL5, but it's more likely that it's just flawed code."

Could he be correct? If yes, where should I report this? I really would love to get Moodle going, so if anyone can help, I'd appreciate it.
In reply to rob mock

Re: Serious errors when installing

by Ken Wilson -
Hi Rob

This looks like one for the developers to think about! Can you please add it to the tracker, and hopefully a database expert will respond.

Thanks

Ken
In reply to Ken Wilson

Re: Serious errors when installing

by Nigel Singleton -
I was the original poster.
I reinstalled Moodle into a clean directory and made a new database. I checked with my hoster to make sure the php settings advised by Moodle were implemented which they confirmed. I requested (ahead of time this time) to make sure that the installer had 'index' rights to the new database I had created. I amended the config file as above to give some readout of any problems. However, it worked alright this time! My hoster is running the latest php and MySql. Sorry that this won't solve the problems of others.
In reply to rob mock

Re: Serious errors when installing

by Richard Enison -

RM,

I would say absolutely not. If that were true, Moodle would not work at all for anybody.

There is a really simple way for any Moodler to prove this, if they have access to their database outside of Moodle, e.g., with phpmyadmin. Look at the mdl_config table in your Moodle database. Look at the name column in that table. What do you see? Strings, or a bunch of 0's?

I know the answer is strings, because otherwise Moodle could not work. So how did those strings get there? Moodle put them there, using ADODB.

I rest my case.

RLE

In reply to rob mock

Re: Serious errors when installing

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Rob,
I came across problems like this a while back on a site with PHP 5.0.4.
Do you know what version of PHP you are using?
Gordon
In reply to Gordon Bateson

Re: Serious errors when installing

by rob mock -
version 4.4.1

In reply to rob mock

Re: Serious errors when installing

by Nigel Singleton -
I have since - in my new installation - had a new problem logging in with original admin user. However, I had created another admin user (I've now created another too). I was able to log in with this new user and then change the password (or rather retype) the password for the original administrator who can log in again. So advice: create several adminstrators the first time you log in. It's some kind of bug in my view (v. humble opinion).