Upgrade to 4.2.6 - Server Checks Page

Upgrade to 4.2.6 - Server Checks Page

by Ahmed Al Kahky -
Number of replies: 5
Hello All, 
     Recently I upgrade Moodle installation from 4.1 to 4.2.6, there are two nodes hosting Moodle and they share the same database, after running the upgrade on both nodes one of them is seeing that it is not upgraded and when running upgrade.php --is=pending, I got a message "An upgrade is pending" and the value is 2, if I upgrade this node the other node will give the same error and when I login to Moodle the server checks page is displayed while there is no issues or errors appearing on it and so on, both nodes have the same version 4.2.6 Build 20240212.

I also purged all the cache on both nodes but this did not solve the issue.

Have you face a similar issue and how did you solve it?
Average of ratings: -
In reply to Ahmed Al Kahky

Re: Upgrade to 4.2.6 - Server Checks Page

by Ahmed Al Kahky -
Any help?
Attachment ServerChecks.jpg
Attachment ServerChecks2.jpg
In reply to Ahmed Al Kahky

Re: Upgrade to 4.2.6 - Server Checks Page

by Ahmed Al Kahky -
After updgrading the database these messagse appear randomly 
Attachment ServerCheck3.jpg
Attachment ServerChecks4.jpg
In reply to Ahmed Al Kahky

Re: Upgrade to 4.2.6 - Server Checks Page

by Ken Task -
Picture of Particularly helpful Moodlers
"two nodes hosting Moodle" ...

Means you have a load balancer setup ... 2 web servers - 1 DB server.
Right?
Check load balancer docs!

Only one of the nodes needs to do the upgrade on the DB.
So you do that by working with only the first node.
And getting it to upgrade the DB.

While you are doing that, the second node isn't available ... to anyone.

The second node has acquired the same code.   That you do by going directly to the node via some other means other than browser - ssh? 

Shouldn't need to do the environment check.
Nor the upgrade to the DB.   It is just made available for users.

When both nodes have updated code and updated plugins, both nodes made available again.

Use command line on both nodes ... admin/cli/ scripts.

Does that make sense? smile

'SoS', Ken

In reply to Ken Task

Re: Upgrade to 4.2.6 - Server Checks Page

by Ahmed Al Kahky -
Thanks a lot for your reply, the architecture you described is right.

Regarding upgrading the second node, do you mean that the upgrade script should not run on the second node, just clone the code of the exact version of first node and add the plugins to the right directories?
So in this case the sequence should be
- Put moodle in maintenance mode
- shutdown the second node
- Run the upgrade on node 1 and install the plugins on this node.
- extract moodle code zip file or clone the same version on the second node and add the plugins to Moodle directory
- start node 2
- disable maintenance mode.

is that right?
In reply to Ahmed Al Kahky

Re: Upgrade to 4.2.6 - Server Checks Page

by Ken Task -
Picture of Particularly helpful Moodlers
Think you need to consult your Load Balancer docs/recommendations first.

It's the load balancer that is put into a maintenance mode ... all traffic hits the LB and goes no further ... allows the admin to do the upgrade.

If you are NOT doing upgrades via git, highly recommend you do so.  
https://docs.moodle.org/403/en/Git_for_Administrators

That will be the most efficient/less prone to human error method of acquiring core code for the 1st node .... and the second if you do that independently.

Another way would be to upgrade node 1 core code and plugins as well - upgrade the DB. Then rsync all the code (which includes the updated core code + addons) to node 2.   The only file one would not treat that way I think would be config.php as config.php would be slightly different on node 2.

Then LB taken out of maint mode and your back to 'normal'.

Again:
Think you need to consult your Load Balancer docs/recommendations first

'SoS', Ken