Getting some some strange error

Getting some some strange error

by products info -
Number of replies: 11

I am getting an error while trying to access moodle admin site 

ERROR!!! The code you are using is OLDER than the version that made these databases! 

And In my server I had a moodle Update to 3.11.17-4 is available but when I tried that it was giving error like 

Updating an installation of moodle 3.10.10-156 for elearn.nchpad.org has failed: 
 • Non-zero exit status returned by script. 
Output stream: 'ERROR!!! The code you are using is OLDER than the version that made these databases! '. 
Error stream: 'ERROR!!! The code you are using is OLDER than the version that made these databases! 

 and site was going to maintenance mode automatically 

 can I get help with this

Average of ratings: -
In reply to products info

Re: Getting some some strange error

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Well, if you tried Upgrading to 3.11, gave up and replaced the code with 3.10, this is to be expected.

If an upgrade crashed, you Site_restore the Site_backup you took prior to the upgrade.

P.S. This is not a developer question, better suited for Installing and upgrading forum.
In reply to Visvanath Ratnaweera

Re: Getting some some strange error

by products info -
Thank you for your reply!

Unfortunately, I don't have a database backup and somebody tried to do this update previously and I got this task to set it right Is there any way I can continue upgrading the code as well? (since the database got updated I guess).
In reply to products info

Re: Getting some some strange error

by Ken Task -
Picture of Particularly helpful Moodlers
make this query on the DB
select name from `mdl_config` where `name = "version";

That will display something like:

2022112809.01

There is a file at code root called version.php.
cat version.php
look for $version.

That tells you what version the code is.

But there are many version files.    Look at version.php in /mod/   Ditto theme.
'SoS', Ken

In reply to Ken Task

Re: Getting some some strange error

by products info -
Hey Ken,

I didn't find mdl_config table in my db instead I have config_plugins and I see mod_folder has version - 2022112800



And in the root, I have like this below and I don't find a version file in mod folder

$version  = 2021051717.00;              // 20210517      = branching date YYYYMMDD - do not modify!
                                        //         RR    = release increments - 00 in DEV branches.
                                        //           .XX = incremental changes.
$release  = '3.11.17 (Build: 20231009)';// Human-friendly version name
$branch   = '311';                      // This version's branch.

I can see there is a version change now how can I update the code file to match with the db 
In reply to products info

Re: Getting some some strange error

by Ken Task -
Picture of Particularly helpful Moodlers
Your DB prefix is moodle_ ... mine is mdl_.

"I can see there is a version change now how can I update the code file to match with the db"

That's the catch 22!
ERROR!!! The code you are using is OLDER than the version that made these databases!

Higher versions of moodle would be 3,10, 3,11, 4.0, 4.1, 4.2, or 4.3.
Have a feeling that whomever tried to upgrade ran into the environment check
and server didn't have required version of PHP or MySQL/MariaDB or didn't have max_input_vars set to 5000 or higher.

Find out what version of PHP your server is running ... and what version of MySQL/MariaDB .. then study chart link below.

Please see:

If you have command line/terminal access, there is a checks.php script in code/admin/cli/
and you should be able to run: php checks.php
That might throw and error but might help determine what code you need to re-acquire from moodle downloads.

To verify version of code ... in mod, blocks, theme there should be a readme.txt file and/or an upgrade.txt file.   At the top of those is the version of code you have ... just the major release ... like 3.9 ... not the full version with point release.

'SoS', Ken


In reply to Ken Task

Re: Getting some some strange error

by products info -
I just manually upgraded the version from 3.9 to 4.1 by downloading the new moodle software and copying my previous theme there. Now I am not getting any errors in my website.

But when I checked php checks. php I got this

PHP Warning: Module 'memcache' already loaded in Unknown on line 0
CRITICAL: Ad hoc task queue (tool task adhocqueue)
Status I Check
I Tasks max fail delay (tool task maxfaildelay)
WARNING
1 task (s) failing
Ad hoc task queue (tool task adhocqueue)
Oldest task is 6 years 271 days which is more than 4 hours

And again in my server I see that update moodle to 3.11.17 but I am already on Moodle 4.1.9+


In reply to products info

Re: Getting some some strange error

by Ken Task -
Picture of Particularly helpful Moodlers
Well, no wonder!!! sad
Your screen show shows an application for intalling/updating/upgrading moodle that Moodle HQ doesn't provide ... that's a hosting issue for that!

"Oldest task is 6 years 271 days which is more than 4 hours"

You have command line, right ... go to code/admin/cli/ and run cron.php
php cron.php

then

php adhoc_task.php

Actually you should consider  yourself lucky!

And have you made a full site backup now?
If not, MAKE A FULL SITE BACKUP!

'SoS', Ken


In reply to Ken Task

Re: Getting some some strange error

by products info -
Yes I was lucky!

And Yes I did the full site backup 

And I got this for commands


In reply to products info

Re: Getting some some strange error

by Ken Task -
Picture of Particularly helpful Moodlers
Well, you're not out of the woods yet!    You've more work to do ....

uname -an
php -v
php -m
php -i

in your panel, setup of cron job needs to be checked.

And something for future use?
which php
The full path you see to php:
/full/path/php -v

which git

'SoS', Ken