1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Willow Brooke -
Number of replies: 18

I downloaded the "Latest Stable Branch of Moodle 1.7+" on 11/22/06 @ 8 p.m. EST. During the installation process, I kept receiving the following error message that prevented the completion of the installation process.

1st Error message:

Setting up database

Could not assign moodle/site:doanything to the admin role

2nd Error message when I click the continue button on the previous 1st error message webpage:

Moodle 1.7+

ERROR: Could not update release version in database!!

For information about this version of Moodle, please see the online Release Notes

3rd Error message when I click the continue button on the previous 2nd error message webpage:

A problem occurred inserting current version into databases

When I click the continue button I cannot move past the previous 3rd error message webpage. No matter what I do, I cannot complete the installation process or access my moodle site.

After no response from the moodle bug tracker website, I removed Moodle 1.7+, downloaded Moodle 1.7.  The installation of Moodle 1.7 generated the exact same error message as above.  Can someone PLEASE help me?

I am running MySql 5.0.24 with PHP 4.4.1 on an Apache server. 

I have never encountered any problems with the installation of a Moodle release before, so I would appreciate any assistance.  

Average of ratings: -
In reply to Willow Brooke

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Marie,
it looks like your the MySQL username that Moodle is using does not have sufficient privileges to create and add to tables. Let's see if we can find out WHY the roles could not be created:
  1. open "lib/accesslib.php" with a text editor
  2. locate the following line (around line 950):
    error('Could not assign moodle/site:doanything to the admin role');
  3. change the above line to the following:
    error('Could not assign moodle/site:doanything to the admin role - '.mysql_error());
  4. save the modified file
  5. try the installation again
This time your "1st error Message" should have more details, which may help you identify why Moodle can't add roles.

Please tell us how you get on smile

all the best
Gordon
In reply to Gordon Bateson

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Willow Brooke -

Thank you Gordon for responding!

I reinstalled Moodle with the changes to the 'accesslib' file. After successfully creating the tables in the database, this is the error message I received:

Could not assign moodle/site:doanything to the admin role - Column 'contextid' cannot be null

The 2nd and 3rd error messages remain the same after I click the 'continue' button.  Additionally, on the install window that checks 'ok' for components, I found this issue

unicode - is recommended to be installed/enabled - check

According to MySql it is using utf8 unicode ci.  Will this cause a great problem with the completion of the installation?  I have tried to access the docs.moodle.org/en/Installing_MSSQL_for_PHP, but it is not available. 

Once again, thank you for your assistance!

In reply to Willow Brooke

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Marie,
thanks for extra information. For some reason, Moodle was unable to to create a record in the "context" table, which it needs to do in order to set up the permissions for users.

We may be able to get more information, if you would kindly try the following modification:
  1. open "lib/accesslib.php"
  2. locate the following line (around line 1177)
    debugging('Error: could not insert new context level "'.s($contextlevel).'", instance "'.s($instanceid).'".');
  3. change the above line to the following:
    die('Error: could not insert new context level "'.s($contextlevel).'", instance "'.s($instanceid).'"<br />.'.mysql_error());
  4. save the modified file
  5. try the installation again
I expect that this will force Moodle to tell us why it was not possible to add new records to the "context" table.

regards
Gordon
In reply to Gordon Bateson

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Willow Brooke -

Hi Gordon!

Again thank you!!

Please see this thread Moodle 1.7: Verification of SQL Tables?  Here you will see where I compared the contents of my database with a correct database.  Apparently all the tables are not being created in the database for some strange reason????  Do you know if a SQL file exist that I can manually import into the database?  I have tried tirelessly to find such a file without any luck.

This is the error message generated after making the latest changes to the 'accesslib' file:

GPL License

 

The tables were not created.  This is the first time I have ever used a Moodle installer that resulted in this type of problem?!  It is odd that some of the tables were created when others were not?  Do you have any idea what would cause this type of problem?

If it will be easier, then I can provide you access to the site to diagnois the issue first hand.  Let me know and I will email you the login information.

Anyway, thank you for your efforts in this matter!!

In reply to Willow Brooke

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Dear Marie,
thanks for sending the access information to your site. I made an exhaustive (exhausting!) study of what was happening on your server and my conclusion is that you should ask your host to upgrade to PHP 5.1.4. The details of how I reached this conclusion appear below.

The exact point of the critical failure of your install occurs is way down in the database access code, in "lib/adodb/drivers", when Moodle is trying to find out the structure of the of the "mdl_context" table. Moodle uses PHP's "mysql_fetch_field" function to get this information. The function returns an array of information about the table. Unfortunately, on your site the information that is returned indicates that the "contextlevel" and "instanceid" fields in the "context" table are date fields when they are actually integer fields. I have no idea why this is, but for some reason PHP and MySQL are getting their wires crossed (figuratively speaking) on your server.

Now it so happens that just this morning I was fixing somebody else's Moodle on the same host. Curiously enough, that install on the other site worked without a hitch!

I checked the server specifications of the two sites and noticed that while your site is using PHP 4.4.1, the other site is using PHP 5.1.4. Therefore I suggest you ask your webhost to upgrade you to PHP 5.1.4

I'm afraid I cannot offer a "workaround" for this problem, because it is too fundamental. The "FetchField" function in "lib/adodb/drivers/adodb-mysql.inc.php" is used ALL the time by Moodle, and on your site it often returns faulty information about integer fields. That is why the original error about adding capabilities occurred and it is also why other errors such as "A problem occurred inserting current version into databases" happen later on in the attempted install.

I haven't fixed your problem, but if you can persuade your hosting company to upgrade your PHP to 5.1.4 (as they have done for at least one other customer) then I am confident your install will succeed.

best regards
Gordon

========================
result of $db->MetaColumns('mdl_context'): note the "type" setting of "contextlevel" and "instanceid" are "datetime" and "date" respectively
========================
Array
(
[0] => stdClass Object
(
[name] => id
[table] => id
[def] => mdl_17
[max_length] => 170750208
[not_null] => 0
[primary_key] => 1
[multiple_key] => 1
[unique_key] => 0
[numeric] => 1
[blob] => 0
[type] => int
[unsigned] => 0
[zerofill] => 0
[binary] =>
)

[1] => stdClass Object
(
[name] => contextlevel
[table] => contextlevel
[def] => mdl_17
[max_length] => 170750280
[not_null] => 0
[primary_key] => 1
[multiple_key] => 1
[unique_key] => 0
[numeric] => 0
[blob] => 0
[type] => datetime
[unsigned] => 0
[zerofill] => 0
[binary] =>
)

[2] => stdClass Object
(
[name] => instanceid
[table] => instanceid
[def] => mdl_17
[max_length] => 170750368
[not_null] => 0
[primary_key] => 1
[multiple_key] => 1
[unique_key] => 0
[numeric] => 0
[blob] => 0
[type] => date
[unsigned] => 0
[zerofill] => 0
[binary] =>
)
)

In reply to Gordon Bateson

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Willow Brooke -

Hi Gordon,

You are awesome! 

I thought this might be the source of the problem, but I was hopeful.  So, I get to move the site - ugh!  But at least I know this problem will not reoccur.

Thank You, Thank You, Thank You!!

Marie

In reply to Gordon Bateson

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Willow Brooke -

Hi Gordon,

I have submitted my request to transfer my sites, Ipowerweb, from the current server to one with MySQL 4.1.16 or higher and PHP 5.1.4.  However, I have had the worst customer service experience with Ipowerweb.  They are willing to loose me as a customer rather than allow me to transfer to another server.  Their only solution is to stop using Moodle . . . I cannot believe how they are treating me. 

Furthermore, they are calling you a liar that another user is successfully using Moodle 1.7 on their site.  So, I have a fight on my hands with them. 

It would make my request to transfer to another server easier if I knew the server number of the other person you successfully assisted on Ipowerweb.  If I continue to receive this treatment, then I will have to find another web hosting company! 

Thanks,

Marie

In reply to Willow Brooke

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Marie,
thanks for the information. It was a disappointing response from iPowerWeb HelpDesk, especially since I had been very impressed by the speed of the servers.

I have sent the details of the iPowerWeb site on which Moodle 1.7 was successfully installed to you in a private email. Hopefully that will help you get you site moved to one of the other iPowerWeb servers which has PHP 5.1.4

all the best
Gordon
In reply to Gordon Bateson

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Karl Jacobi -

Hi Marie and Gordon,

Yes, Gordon is quite right. I believe Gordon was referring to my site. I run my account through Ipowerweb. Gordon just got my site setup last night. I did have a lot of issues regarding getting the database installed and whatnot but that may have been just my inability to follow directions...;)

If there's anything I can do, please by all means please feel free to contact me.

Thanks

-Karl

In reply to Karl Jacobi

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Karl Jacobi -
Oh, by the way, the site runs very smooth!!!!
In reply to Gordon Bateson

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Willow Brooke -

Hi Gordon and Karl!

Thank you so much for that informtion.  It will be a great help with Ipowerweb.  I am on the phone with them right now. 

I am so disappointed with them.  I have been with them for 5 years, but two years ago they transferred their technical support operations to Arizona from California. This relocation resulted in the worst support ever!!  I rarely call the technical support department, but when I do such as this situation they are more interested in argumentative and combative support rather than problem resolution. 

Gordon, you are right, I love the speed of their servers, but the challenges in dealing with the technical support department is a bit much! 

Karl, did you upgrade your moodle from an earlier version or is this a fresh install?

Thanks,

Marie

In reply to Gordon Bateson

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Willow Brooke -

Hi Gordon,

I have another question.  Ipowerweb is stating that MySQL 4.0.16 is installed on the Karl's server?  Is there anything special I need to know to install Moodle 1.7 on this server?

Thanks so much!!

Marie

In reply to Willow Brooke

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
On Karl's server, they should try the following:

select vDeck -> Settings -> Server Information, and the page states
php version 4.4.1

however, click on "detailed PHP information" link, and the next page, which is generated by the phpinfo() function, states:
PHP Version 5.1.4

I have also sent you a link of where you can see this information for yourself and show it to the iPowerWeb help desk.

good luck
Gordon
In reply to Gordon Bateson

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Willow Brooke -

Hi Gordon,

Thank you for the php information.  Their 'vdeck' console does not always work properly. 

So the version of mysql will not interfere with the installation of Moodle 1.7?

Thanks,

Marie

In reply to Willow Brooke

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Karl Jacobi -

Hey Marie,

No, this was a fresh install onto the neaat-ct account. I haven't had any problems at all running the Moodle and I'm running the same specs and you'll soon be. But, I think Gordon is better qualified to answer that than I.

Thanks

-Karl J.

In reply to Willow Brooke

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Mick Thorn -
I've effectively had the same response from my Webhost - WebFusion/Pipex - who are currently running an incompatible version of PHP and refuse to upgrade...
In reply to Gordon Bateson

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Carlos Gonçalves -
Hi everyone,

I'm also trying to install Moodle 1.7.1+ (download 30 Jan 2007) and I'm having problems when setting up the database. I'm getting the following error (after modified the lib/accesslib.php file):

Could not assign moodle/site:doanything to the admin role - Table 'moodleDB_Dep3.mdl_Dep3_role_capabilities' doesn't exist

In the save server I have another installation of Moodle 1.6 (in a separated virtual host) and the installation process was successfully.

To create the database i used the following script (based on the instruction I have found in Moodle doc's):

CREATE DATABASE moodleDB_Dep3 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON moodleDB_Dep3.* TO moodleuser@localhost IDENTIFIED BY 'MY_PASSWORD';

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodleDB_Dep3.* TO moodleuser@localhost IDENTIFIED BY 'MY_PASSWORD';


The settings for my system are:

Apache: Apache/2.2.0 (Fedora)
MySQL client API version: 5.0.27
PHP version: 5.1.6

Does anyone can help me?
Tanks in advanced,
Carlos
In reply to Carlos Gonçalves

Re: 1.7 & 1.7+ Installation Error: Could not assign moodle/site:doanything to the admin role

by Daniel Groulx -

Hi could some one help me with that issue, the minimun spec for Moodle 1.7 is  PHP 4.3.0 or later (and MySQL 4.1.16 if you are using MySQL).

my version is --  PHP 4.4.1   mysql 5.0.24

the checking environment panel mark ok for all

than I receive those message

Could not assign moodle/site:doanything to the admin role

click continue

another error message

ERROR: Could not update release version in database!!

click continue

another error message

A problem occurred inserting current version into databases

could not go further...

if everything is alwright with the minimun requirement for moodle Why should I force the ISP to upgrade to Php 5, doing that, need good reason.

Did the moodle requirement change...

Any help please

Daniel