Error 1050 - help required please

Error 1050 - help required please

by Just H -
Number of replies: 4
Good evening to you all smile

I am currently trying to head my organisation down the Moodle path rather than a commercal product (no LMS/CMS at present but need to get one up and running fast).

After a bit of trial and error I managed to get Moodle set up on a host server but I keep getting the attached errors if I click on "Admin" or try and do a back up.

I have spent the best part of today trying to figure it out but as a 100% total newbie to pHp (or whatever it is!) not having much luck deciphering some of the posts in the forums that may be relevant.

I'm leaning towards it being something to do with dumping the tables in Sql (sorry if that makes no sense) but a bit loathe to do something like that prior to showing my colleagues what I have set up so far (i.e. it appears to work 99.9% and I don't want to break it).

Any advice in very plain language would be most appreciated smile

Regards
Harry

System info (as far as I can make out) -
Moodle version: 1.52
phpMyAdmin: 2.6.3
mySql: 4.0.24 standard
Apache 1.3.33
running on linux 2.4.31


Average of ratings: -
In reply to Just H

Re: Error 1050 - help required please

by Shane Elliott -
Picture of Core developers Picture of Plugin developers
Backups are Eloy's baby and he may be able to shed some light on it.

However, to me it looks like the backup versions weren't stored in the database at setup time or have been altered since so the setup keeps trying to reinstall the backup tables. In simple terms, moodle doesn't know the backup tables are installed so it's trying to reinstall them.

A small script like the following in the admin directory should do the trick:

<?php
require('../config.php');
require_once ("$CFG->dirroot/backup/version.php");
if (set_config("backup_version", $backup_version) and set_config("backup_release", $backup_release)) {
print_continue($CFG->wwwroot.'/'.$CFG->admin.'/index.php');
exit;
} else {
notice ('Somethings gone wrong!');
exit;
}
?>
Store the above code in eg admin/backupversionfix.php and then call it directly eg http://my.moodle.site/admin/backupversionfix.php
Delete the script afterwards.

HTH




In reply to Shane Elliott

Re: Error 1050 - help required please

by Just H -
Hi Shane

Thanks very much for getting back to me so quickly.

I dropped that script in and called it as you advised with some result, down to 2 errors now (as attached).

Any further magical scripts in your arsenal would be much appreciated smile

Regards
Harry
In reply to Just H

Re: Error 1050 - help required please

by Shane Elliott -
Picture of Core developers Picture of Plugin developers
It really looks like your config database table has been corrupted/deleted/obliterated sad

You can do something similar again to remove those block notices but if the config table is corrupted it may just lead to some other error messages.

<?php
require('../config.php');
require_once ($CFG->dirroot .'/blocks/version.php');
if (set_config('blocks_version', $blocks_version)) {
print_continue($CFG->wwwroot.'/'.$CFG->admin.'/index.php');
exit;
} else {
notice ('Somethings gone wrong!');
exit;
}
?>
Moodle keeps version numbers of various things in the config table. If moodle finds the version in the config table is earlier than the current coded version then it tries to do an upgrade. If there is no version number in the table, then moodle will think it needs to install something. There are version numbers for all sorts of things that are checked. What seems to have happened in your case is that some or all of the version entries in the config table have disappeared even though the installation has already taken place.


In reply to Shane Elliott

Re: Error 1050 - help required please

by Just H -
Hello again Shane

No idea what it was you advised me to do . . . but whatever it was it worked a treat big grin

Thanks a lot for your help on this, very much appreciated.

Time to learn some of this php and Sql stuff I reckon!

Thanks again
Harry