Site Administration Menus almost empty

Site Administration Menus almost empty

by Ian MacDonald -
Number of replies: 10

Just last week we discovered that we could no longer add or manage users. That’s when we realized that the Site Administration area was empty of menus, except for Front Page. As administrator, I cannot access a course, receiving the message “you cannot enroll yourself in this course”, nor see any of our users. Our host restored an earlier backup, but with no improvement. Teachers and students are still able to access all features of Moodle applicable to them.

 

I no longer know which version we are using, since without admin privilege functioning, I can’t access it. But it would be the version we started using about two years ago and have not upgraded.

 

I would appreciate any suggestions or advice.


Average of ratings: -
In reply to Ian MacDonald

Re: Site Administration Menus almost empty

by Ken Task -
Particularly helpful Moodlers колдонуучунун сүрөтү

Ok, we've a very brief description of the problem, but no other info.

Things like Moodle version, how hosted and where, operating system ... might help.

As far as not being able to navigate ... even if logged on as what was formerly an Admin level account, might I suggest trying to go directly via browser to:

http://yoursite/admin/user.php

and/or both

http://yoursite/admin/roles/admins.php

To see what you can see/do.

If need be, you might also try going directly to debugging:

http://yoursite/admin/settings.php?section=debugging

and turning that on ...

Remember to turn it off by going to the same url above once you've collected some info.

IF there is info to share, copy and paste the error text to a text file locatlly, come back here, and paste the text into a response.

'spirit of sharing', Ken

In reply to Ken Task

Re: Site Administration Menus almost empty

by Ian MacDonald -

Hi Ken,

Thank you for your suggestions. I tried them and it opened up the same view giving the same error and only FrontPage under site admin. The error is "you cannot enrol yourself in this course", which makes sense because as Administrator I am not enrolled in any courses. When I click "more information about this error" it tells me we are using version 2.7.

Under Site Admin all I see is:

Site Administration

Front Page.

Would you know if the "Pedro Cruze" post applicable here?

I look forward to any further advice. 

Ian

In reply to Ian MacDonald

Re: Site Administration Menus almost empty

by Ken Task -
Particularly helpful Moodlers колдонуучунун сүрөтү

Gee ... we're going to make this difficult giving very little info about system other than the problem and the version of Moodle, aren't we?

'the Pedro Cruze post' has a url ... please provide.

So let's start with the basics ... is the moodle hosted on a Linux server?   Do you have ssh access to the server or is there any software on the server that would allow you to browse files?

If I found the right server, your server (vlearn) appears to be:

Apache/2.4.7 (Ubuntu) and appears to be at least a 3.1 of Moodle!  Not a 2.7.

The specific version of your Moodle can be seen in the version.php that's located in the directory for moodle code.   Since we don't know much about the server, you'd have to find that.

If hosted remotely, where hosted?   Provider please.

Without more info, one could guess and chase lots of rabbits down rabbit holes ... uhhhh, would rather not be 'Elmer Fudd' here. ;)

But, you could try this ... if you know your account ID number ... add a line to config.php like this one:

$CFG--siteadmins="2,YOURACCOUNTIDNUMBER";

No need to restart any service, just access the server and log in.

Does your site admin menu show to you know?

BTW, id user 2 was the original admin user ... the user that installed the moodle.

'spirit of sharing', Ken


In reply to Ken Task

Re: Site Administration Menus almost empty

by Ian MacDonald -

Hi Ken,

I am sorry for making this difficult - not intended - and I really appreciate your help. I've gathered the following information from our provider.

Our Moodle site is running on a Plesk shared hosting server, the Backend is Linux CentOS.

Our host says we do not get shell access, and we can only browse the contents of our webroot using FTP or through the panel.

Our provider is Provision Data Systems Inc. http://provisiondata.com/

They don’t believe you found the right server - it is Apache 2.2.15 (CentOS) - so we didn't try the addition to config.php. 

The Pedro Cruz post is at https://moodle.org/mod/forum/discuss.php?d=324918

I look forward to any more suggestions.

Ian


In reply to Ian MacDonald

Re: Site Administration Menus almost empty

by Ken Task -
Particularly helpful Moodlers колдонуучунун сүрөтү

Ohhh ... shared hosting.   Sigh!   But, we'll attempt to help resolving ... still might have to involve hosting provider.

The post for Pedro is now locked and if you noticed it was the same advice given to you about editing the config.php file adding site admins line.    That tip makes no difference as to the operating system under which Moodle runs ... any Linux, any MacOSX and any Windows.

What version of Moodle? ... that can be seen using that tool to browse files on your system and looking at the version.php file in the moodle code root.

In your case, if your tool that browses files also has the ability to edit files, then use that tool to add that line.

What I can't tell you is the path to the config.php flie which is also at the root of the moodle code where the version.php file is located.   If you need help with that, ask service provider.

Things like this just don't happen for no reason. :\

Anyhoo ... add those lines to your config.php and let's see if it helps you navigate or not.

'spirit of sharing', Ken


Average of ratings:Useful (1)
In reply to Ken Task

Re: Site Administration Menus almost empty

by Ian MacDonald -

Thank you Ken. 

Those lines in the config.php have reinstated admin access to menus. However, when I go to see who else we need to reset admin privileges for the Site Administrator, the menu reads Error Reading Database, with the message further below (when full debugging messages enabled). Does this mean we need to make further changes to the database code? 

I can now confirm our version as 2.7.2. Are these problems likely due to an old version, not updated, and would resolve if we updated, which we are planning to do? Or are they likely to persist in an updated version? 

Here's the Debug info:

Debug info: Unknown column 'ovcmtmoodle' in 'where clause'
SELECT id,firstnamephonetic,lastnamephonetic,middlename,alternatename,firstname,lastname,username,email FROM user
WHERE id <> ? AND deleted = 0 AND confirmed = 1 AND id IN (2,ovcmtmoodle) ORDER BY lastname, firstname, id
[array (
0 => '1',
)]
Error code: dmlreadexception
Stack trace:
  • line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
  • line 1014 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 62 of /admin/roles/classes/admins_existing_selector.php: call to mysqli_native_moodle_database->get_records_sql()
  • line 219 of /user/selector/lib.php: call to core_role_admins_existing_selector->find_users()
  • line 132 of /admin/roles/admins.php: call to user_selector_base->display()
Thanks for your help Ken,

Ian

In reply to Ian MacDonald

Re: Site Administration Menus almost empty

by Ken Task -
Particularly helpful Moodlers колдонуучунун сүрөтү

There is no table that contains user id's for those that should be or were admins.   From what I understand, all is contextual ... and since am not a developer, I have no idea as to what in the he-- that means in English! :\

Could be, that too many admins have in-advertently gotten your site into the state it's in ... have seen that many times and there is no one way to fix.

As you discover users who will probably Email you asking why they can't admin any longer, you could then make a db query of mdl_user for that users login to find their ID number, and then add their ID number to the list of id's in config.php.    That, however, is a bandaide.

Your version is many updates behind ... 2.7.x (long term support) is now up to 2.7.20.   Will updating to the highest version fix?    Un-known.

If you decide to attempt an upgrade in this state ... it might fix ... it might fail ... it might break things more.   Dunno.

So let's talk about backups ... have them?  Code and DB minimal.   What was the last backup when the site was functioning?

The error points to this: column 'ovcmtmoodle' that's not a standard column and might be an add-on in users profiles.   Using any tool you have to browse data base, look for mdl_user and any table that might be related to users ... and profiles of users.   See what's there.  Another bandaide approach might be to create a column by that name in the proper db ... has no data, but at least we might get by that error to see what awaits on the other side. :\

A database dump you have - a backup ... could be restored to another database not named the same as the db for your moodle, and you could inspect the tables.   And, if you had the right access, be able to export the data from that column alone to import into the current database.    That's a *MIGHT*.

'spirit of sharing', Ken


Average of ratings:Useful (1)
In reply to Ken Task

Re: Site Administration Menus almost empty

by Ian MacDonald -

Great news Ken! With your help we have reestablished admin access privileges including access to administrator assignments. I am grateful for your knowledgeable assistance and advice. 

Ian

In reply to Ian MacDonald

Re: Site Administration Menus almost empty

by Ken Task -
Particularly helpful Moodlers колдонуучунун сүрөтү

Good to hear!   Feel free to rate posting that helped as 'useful'.

Mind disclosing what you did to fix?

Now the question remains ... how did that happen? :\  and how can one prevent it from happending again?

'spirit of sharing', Ken


In reply to Ken Task

Re: Site Administration Menus almost empty

by Ian MacDonald -

Ken, here is a summary from our tech team:

We used your (Ken’s) former post about the Pedro Cruz situation (http://www.moodleworld.com/lost-admin-rights-moodle-site-assign-admin-role-user-moodletips/) to regain admin access. However, those instructions didn't say to comment out the CFG code after using it and our tech person didn't browse to Home > Site administration > Users > Permissions  > Site administrators to receive the error code.  

When they were shown the error they saw our username and ID in the SQL query and thought it may be due to the CFG instruction in config.php. Commenting this out fixed the query.

I believe this means if not for you we would not have solved the problem. Thanks again, Ian