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

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

Dung Manh發表於
Number of replies: 18
Dear all,
Do someone know how to solve the problem when I finished install all DB tables and access to admin page and get this 2 errors (as below).

I found some hints said that changing the strict-mode = "", but no use.
How to create primary administrator account and guest account by setup ?

Thank you,
Dung
-------------------------------------------

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

評比平均分數: -
In reply to Dung Manh

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

Richard Enison發表於
DM,

You might also benefit from looking at this other post of mine:

http://moodle.org/mod/forum/discuss.php?d=80267#p356183

RLE
In reply to Richard Enison

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

Dung Manh發表於
Dear all,

I follow the Ken Wilson's guide by adding in moodle/config.php file, these lines:

$CFG->debugdisplay = true;
$CFG->debug = 2048;
$CFG->dblogerror = true;

and I set "mnethostid" in "user" table to allow "NULL" value, then the install process can insert records to "user" table. I already set strict-mode ="", But I still get a lot of errors like below.

Anyone can help ?
Thank you all,
Dung

-----------------------------------------------
Strict Standards: Creating default object from empty value in F:\web\moodle18\blocks\course_summary\block_course_summary.php on line 28

Strict Standards: Declaration of page_my_moodle::print_header() should be compatible with that of page_base::print_header() in F:\web\moodle18\my\pagelib.php on line 89
Can not find any guest role!

Strict Standards: strftime() [function.strftime]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Krasnoyarsk' for '7.0/no DST' instead in F:\web\moodle18\lib\moodlelib.php on line 1018
In reply to Dung Manh

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

Ken Wilson發表於
Looks like the time zone setting in PHP is wrong. Dung, can you try to make the following changes in your php.ini file:

1. Leave the timezone as the default by adding a semicolon before the line in php.ini file. This is what mine looks like:

[Date]
; Defines the default timezone used by the date functions
;date.timezone =

2. Alternatively, set it as follows in your php.ini file:

date.timezone = Asia/Krasnoyarsk

3. If you cannot change it in the phi.ini file, and you're using Apache, try this in a .htaccess file:

php.value date.timezone = Asia/Krasnovarsk

It's unusual for the timezone to be set from the default of blank, so please let us know if anything works.

Thanks

Ken


In reply to Ken Wilson

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

stanley john發表於
i followed your direction and i got the result as shown in the attachment.
Please help to solve the problem.

G.Stanley john
附件 error.GIF
In reply to stanley john

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

Ken Wilson發表於
In that case, can you check the level of error reporting in your php.ini file and remove E_STRICT. The recommended php.ini file has it set as follows:

error_reporting = E_ALL

Any better?
In reply to Ken Wilson

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

Dung Manh發表於
Dear Ken and others,

Thank you for your hints. But that were only one of many errors.
Event I DISABLED the sql-mode= "", but the system still informs about "Strict Standards: " and " Can not find any guest role!".

Please read the attach file and help me some hints. Moodle is very good with excellent community.

Thank you,
Dung
In reply to Dung Manh

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

Richard Enison發表於
DM,

Strict mode has to do with MySQL and is set by using the sql-mode parameter; Strict Standards has to do with PHP5 and the E_STRICT error reporting setting. Did you change the setting from E_STRICT to E_ALL as KW suggested?

RLE
In reply to Richard Enison

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

Dung Manh發表於
Dear Richard,
Sure that I set 'error_reporting = E_ALL & ~E_NOTICE' in php.ini file (it generated as default). What can be the cause ?

Thank you,
Dung
In reply to Dung Manh

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

Richard Enison發表於
DM,

In an earlier post you said you had

$CFG->debug = 2048;

in your config.php file. I believe this overrides php.ini. The value of E_STRICT is 2048. Try changing the 2048 to 2047, which is the value of E_ALL.

RLE
In reply to Richard Enison

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

Dung Manh發表於
Dear Richard,

I changed the parameter as your suggestion, it seems working better, but still got some error for admin role and guest role (please see notice below). How to do ?

Thank you,
Dung
--------------------
Can not find any guest role!
  • line 250 of lib\accesslib.php: call to debugging()
  • line 180 of lib\accesslib.php: call to get_guest_role()
  • line 1232 of lib\accesslib.php: call to load_notloggedin_role()
  • line 528 of lib\accesslib.php: call to load_all_capabilities()
  • line 15 of blocks\admin_bookmarks\block_admin_bookmarks.php: call to has_capability()
  • line 424 of blocks\moodleblock.class.php: call to block_admin_bookmarks->applicable_formats()
  • line 1230 of lib\blocklib.php: call to block_base->_self_test()
  • line 411 of admin\index.php: call to upgrade_blocks_plugins()


Notice: Undefined property: object::$capabilities in F:\web\moodle18\lib\accesslib.php on line 530

Notice: Undefined property: stdClass::$proxyhost in F:\web\moodle18\lib\rsslib.php on line 344

Notice: Undefined property: stdClass::$proxyport in F:\web\moodle18\lib\rsslib.php on line 345
Can not find any guest role!
  • line 250 of lib\accesslib.php: call to debugging()
  • line 180 of lib\accesslib.php: call to get_guest_role()
  • line 1232 of lib\accesslib.php: call to load_notloggedin_role()
  • line 528 of lib\accesslib.php: call to load_all_capabilities()
  • line 14 of blocks\mnet_hosts\block_mnet_hosts.php: call to has_capability()
  • line 424 of blocks\moodleblock.class.php: call to block_mnet_hosts->applicable_formats()
  • line 1230 of lib\blocklib.php: call to block_base->_self_test()
  • line 411 of admin\index.php: call to upgrade_blocks_plugins()


Notice: Undefined property: object::$capabilities in F:\web\moodle18\lib\accesslib.php on line 530

Notice: Undefined property: stdClass::$mnet_localhost_id in F:\web\moodle18\lib\adminlib.php on line 498

No admin role could be found

In reply to Dung Manh

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

Richard Enison發表於
DM,

OK. The messages beginning Notice are just that: notices, not errors. You can ignore them. If you don't want to see them, use 2039 instead of 2047, because the value of E_NOTICE is 8. If you want to exclude warnings also, use 2037, because E_WARNING is 2.

Now, the Admin role msg. is more serious. What KW's post suggested doing after making those debugging changes to config.php was to re-run the install and see what error msgs. you get when it is unable to insert the user record for admin. The problem with that is that the install.php script won't run if config.php exists. I would suggest adding the lines

$CFG->debugdisplay = true;
$CFG->debug = 2037;
$CFG->dblogerror = true;

to install.php instead, right at the top; just before the line that says

if (file_exists('./config.php')) {

would be as good a place as any. Then delete (or rename if you want to preserve it) the config.php file, and run the install.php script again. You should be able to see any error msgs. that occur on the screen as well as capture them in your error log file. It would probably be best to delete any tables in your database before running install.php, otherwise you may get a bunch of "Table already exists" msgs.

RLE
In reply to Richard Enison

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

Dung Manh發表於
Dear Richard Enison and others,

I followed your guide and it installed well on the system, but still had some error in rename X.frm to Y.frm in the moodle folder. I tried to find this .frm file but it seems does not exist.

Can you help with this error as reported below?
Thank you,
Dung
-------------------------------------

(mysql): CREATE INDEX foruqueu_use_ix ON forum_queue (userid)
7: Error on rename of '.\moodle\#sql-1784_2b.frm' to '.\moodle\forum_queue.frm' (Errcode: 13)
 
 
 
 
 


(mysql): CREATE INDEX foruqueu_dis_ix ON forum_queue (discussionid)
7: Error on rename of '.\moodle\#sql-1784_2b.frm' to '.\moodle\forum_queue.frm' (Errcode: 13)
 
 
 
 
 

In reply to Dung Manh

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

Richard Enison發表於
DM,

First of all, you say you looked for the file it was trying to rename and it wasn't there. Where did you look for it? In the moodle folder where the scripts are? That's the wrong moodle folder. The "." at the beginning of '.\moodle\#sql-1784_2b.frm' means "current folder", which doesn't really tell you anything. I can tell you from my experience with MySQL that the reason the file is in a folder called moodle is that it is part of a table in the database called moodle. On my installation, anyway, there are three files for each table, one with the extension .frm, one .MYI, and one .MYD, in the database folder moodle, which is a subfolder of the folder data, which is a subfolder of mysql. The name of each of these three files, before the extension, is just the name of the table. "#sql-1784_2b" is probably a temporary table name. The exact locations of these folders may be different on your system. They are defined in my.ini or my.cnf.

This kind of error has come up a few times in the last year in this forum, mostly with no resolution. Some have had success repairing or recreating the database, or restarting or reinstalling MySQL; most have not. You might be able to find more info in your MySQL error log. I believe this would be a text file with the extension .err in the data folder. See http://dev.mysql.com/doc/refman/5.0/en/error-log.html

Make sure the database username and p/w you gave Moodle with which to access the moodle db have all the necessary rights. Other than that I can only refer you to the advice I gave in an earlier post, which so far, it seems, no one has taken: http://moodle.org/mod/forum/discuss.php?d=83587#p369635

RLE
In reply to Dung Manh

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

Richard Enison發表於
DM,

Just to clear up a possible ambiguity in my previous post:

When I said the .err file is in the data folder, I meant the MySQL data folder, where the database subfolders are, not the Moodle data folder.

RLE
In reply to Richard Enison

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

Dung Manh發表於
Dear Richard Enison and others,

After working hard for several days to troubleshoot by strongly support of Richard Enison I finally finished the setup successfully Moodle 1.85. But when I logged in by admin account or guest account, it informed that can not create guest user account, and with admin account (usr: admin, pwd: admin) I created manually (because the setup process did not create admin account), I can not access to Moodle. The notice as below.

Whether I can create user admin and others manually or which way?
Please help,
Thank you,
Dung
=======================================
Could not create guest user record !!!


Sorry, you have exceeded the allowed number of login attempts. Restart your browser.
In reply to Dung Manh

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

Richard Enison發表於
DM,

You haven't said that you have tried any of the other suggestions that have been given, such as trying to
  1. repair your database
  2. recreate your database
  3. reinstall MySQL
  4. look for a MySQL error log
  5. check the rights your MySQL db user (the one you gave Moodle to use) has; it needs all rights except the right to create a new db
If all of the above fail, I can only suggest, again, reporting the problem to the Moodle Tracker and mysql.com.

RLE
In reply to Richard Enison

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

Dung Manh發表於
Dear Richard Enison,

Yes, I did do almost suggestion from you and delete DB, ...
But I will try again, maybe lucky.

Thank you,
Dung