Update to 4.2 via git pull not possible: 'Already up to date'.

Update to 4.2 via git pull not possible: 'Already up to date'.

by Piotr F -
Number of replies: 18
Hi,

Ubuntu 22.04 LTS

Our instance:
Moodle 4.1.3 (Build: 20230424)

Notifications:
There is a newer Moodle version available!
Moodle 4.2 (Build: 20230424) | Version 2023042400 | Stable version |
It is strongly recommended that you update your site to the latest version to obtain all recent security and bug fixes.

I believe I have already updated to 4.2+ (I saw this), and I do weekly updates via git pull.

So now this is what prompt prints:
root@user:/dir/moodle# git pull
Already up to date.

This happens for the first time.
I can see that build is the same, nevertheless, the admin system shows there is a new version.

I will be grateful for any tips.

Cheers,
Piotr

Average of ratings: -
In reply to Piotr F

Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Antonio Carmona -
Hello Pior, 

What you should do is to checkout to the major release branch.  Just do the follow: 

cd /path/to/your/moodle/folder

# Check which branch you are currently tracking
git branch -a

# Make a local branch for the newer release from the remote repo
git branch --track MOODLE_402_STABLE origin/MOODLE_402_STABLE

# Switch to track this branch
git checkout MOODLE_402_STABLE

Would be very helpful if you take a look to the admin documentation



In reply to Antonio Carmona

Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Piotr F -
Thank you, Antonio.

The print not promising:

git checkout MOODLE_402_STABLE
error: Your local changes to the following files would be overwritten by checkout:
        blocks/accessreview/block_accessreview.php
blocks/accessreview/classes/external/get_module_data.php
blocks/accessreview/classes/external/get_section_data.php
[...] many [...] blocks/social_act Aborting

Made snapshot, so can revert it easily.

No idea how it was possible to change branches.

Would this help?

git checkout -f branch
Will be grateful for any help.
In reply to Piotr F

Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Piotr F -
As for now, the above
git checkout -f branch
did the job.

Anyway, I believe there is something (serious?) wrong if I get the messages from admin UI right, let me repeat:

for whatever reasons, I have 4.1.3 which is 401 branch,
nevertheless, admin UI notifications show me update available for the branch 402, which is 4.2.

Is this all good?
In reply to Piotr F

Re: Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Ken Task -
Picture of Particularly helpful Moodlers
Opps!   Looks you tried to upgrade incorrectly and it failed.   Then tried again ... me thinks you now have a mix of 4.1.x files and 4.2 files.

accessview block is part of core and don't think you've been altering core files hav you?

If that's the case, restore the code and DB backup you made prior to attempting any upgrade.   Purge caches after doing that and check site to assure it's still a 4.1.highest.

Then, if server meets requirements for 4.2, if you really want to - upgrade via git:

php admin/cli/cron.php
php admin/cli/maintenance.php --enable
git branch --track MOODLE_402_STABLE origin/MOODLE_402_STABLE
git checkout MOODLE_402_STABLE
php admin/cli/upgrade.php --non-interactive
php admin/cli/maintenance.php --disable

Check version:
fgrep '$release' version.php

Might also purge caches while you are there ... then check the GUI!

'SoS', Ken

In reply to Ken Task

Odp: Re: Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Piotr F -
Ken, thank you,

"accessview block is part of core and don't think you've been altering core files hav you?"

No, I have not, that's another strange message. I would have never touched the core code, not skilled enough.

Just restored snapshot, all works as before.

In reply to Piotr F

Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
I believe you have to change branches.  4.2 is a different branch to 4.1.
In reply to Emma Richardson

Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Piotr F -
Thank you all, indeed!

This is then very odd: definitely, I was tracking 402 stable. That is why, until now, I saw even this 4.2+ to upgrade.

Anyway, will check, and get beck with results.
In reply to Piotr F

Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Piotr F -
Now:
MOODLE_401_STABLE

How is it possible that it switched to another branch?

Logically, if my version shows 4.1.3 and this is the branch 401, it should not show me the update available for the branch 402.

So this is kind of a bug?
In reply to Piotr F

Re: Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Ken Task -
Picture of Particularly helpful Moodlers
That notification (I call it the 'nag') will show any version higher than what you are running.   And you do want to keep being informed ... even though it becomes a 'nag'.

Since have command line access:
cd /path/to/moodlecode
fgrep '$release' version.php will show the info you need from CLI.

A git branch -a will show higher branches that are available - but ... continue reading, please ....

Many Moodle admins stay at Long Term Support versions ... which 4.1.x is - until such time that there is no updates for fixes or security.   Then upgrade.   By then, hopefully, there is a higher version that is LTS.   Not a bad strategy really as the next hop upwards might put you back into 'omicron tester'. smile

Plus ... couple of things to check before making hop to next version - does your server have what it needs.   Admin Server Environment - update component and see.    Additional plugins you might have installed and are using.   *Themes* are plugins.   If a plugin you installed is now considered 'mission critical' and there is no higher version available, you might wait until there is one!

Now if you are really curious about 4.2 suggest standing up a dev instance as a 4.2 using git and tinker/compare.

Just remember ... if you are admin of a moodle for others, they might not tolerate changes as well as you do! smile

My 2 cents!
'SoS', Ken


In reply to Ken Task

Re: Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
I wonder whether the changed convention of tags since Moodle 4.x was a good idea after all.

The old scheme was:
Release -> Tag
3.0.x -> MOODLE_30_STABLE
3.1.x -> MOODLE_31_STABLE
..
3.10.x -> MOODLE_310_STABLE
3.11.x -> MOODLE_311_STABLE

The new scheme:
4.0.x -> MOODLE_400_STABLE
4.1.x -> MOODLE_401_STABLE
..
(future)
4.10.x -> MOODLE_410_STABLE
4.11.x -> MOODLE_411_STABLE

There are two problems:
- often people think MOODLE_401_STABLE is release 4.0.1
- what if there is a release 4.100.x? In the old scheme it would have been MOODLE_4100_STABLE. The new scheme is a dead end. ;)
In reply to Ken Task

Odp: Re: Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Piotr F -
Thanks, so it looks like all the thread is irrelevant, and the only thing which might be reported is:

'don't show updates available for another branches' or 'show the updates available only for the being tracked branch'.

Should I go with this to the tracker?
In reply to Piotr F

Re: Odp: Re: Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Ken Task -
Picture of Particularly helpful Moodlers
About submitting something in Tracker ...
That requires poster to provide a way to replicate the issue.   The only time issue appears is when a new major version is either a day away or during the time frame it is to be released.
i don't know how one would be able to replicate the issue.

Do know if one catches things just right a gir branch -a will show RC# versions of the latest - release candidates # - have seen # as high as 3 before.

It's for that reason that I test just acquiring code on a Mac first ... so that I can see no RC#'s.

In the case of 4.1 to 4.2 ... 4.1 is LTS (long term support) ... for a production server I'll stick with a LTS until it is no longer supported.  If I am really curious about the next release, I'll stand up a sandbox instance and explore.

"Latest" doen't always equate to "best" or 100% bug free ... especially with addons - major are 3rd party themes.

IMHO, if one gets on 'leading edge' that could also mean 'bleeding edge' and I prefer not to put teachers/students on that 'edge'.

Above is just my 2 cents! smile
'SoS', Ken
 
In reply to Ken Task

Odp: Re: Odp: Re: Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Piotr F -
That requires poster to provide a way to replicate the issue. The only time issue appears is when a new major version is either a day away or during the time frame it is to be released.

If this is the case, ie. admins will get this confusing notification about the available update only once awhile when a major version is released, then this is not a problem, thank you for your help.
I thought I would be getting this each week.

Indeed, I will stay with LTS.
In reply to Ken Task

Odp: Re: Odp: Re: Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Piotr F -
Well, it looks like this 'nag', as you call it, persists ;) It just shows next updates to the branch not tracked.
All the notification looks no different to the currently tracked branch update notification.
This is confusing.
In reply to Piotr F

Re: Odp: Re: Odp: Re: Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Ken Task -
Picture of Particularly helpful Moodlers
Did you go to Server -> Enviironment -> **update component**?
That should acquire a new environment.php and a new environment.xml.
LIsting should change.

Begin RANT ...
The above action should be made part of cron job as a task that's run at least every week.
Also, the numbering scheme ... for years it has been 'logical', but beginning series 4, it's changed.   Guess to now be in line with the 'new and improved' UI/UX (mean that sarcasically) so I'm gonna call it 'Logick' - that's a more 'trendy', isn't it?   No need to answer that!
END RANT

I lied ... not end of rant ...

Bottom line ... admins have to adjust!  And that's always been the case with a DIY moodle ... that's why 'admin' makes the 'big bucks'!   We all have 'telepathic abilities', right?  (don't answer that one either!). 

Oh, wait a minute ... this could be the beginning of AI and Chatbots for Moodle!

Ok, RANT really ends now! smile

'SoS', Ken

In reply to Ken Task

Odp: Re: Odp: Re: Odp: Re: Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Piotr F -
Thank you, did the 'update component'.
The same, 4.1.x updated, still seeing 4.2+ notification.
In reply to Piotr F

Re: Odp: Re: Odp: Re: Odp: Re: Odp: Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Ken Task -
Picture of Particularly helpful Moodlers
That's 'normal' ... see screen shot of a 4.1.highest notifications screen attached.

notifications in 4.1.highest

Will continue with the 'nag' until I upgrade it to 4.2.highest.
What counts is what
from code directory, fgrep '$release' version.php and
 git branch -a shows from command line.

'SoS', Ken

In reply to Ken Task

Re: Update to 4.2 via git pull not possible: 'Already up to date'.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Very normal.
wink

For comparison, from a Moodle 3.9 (LTS) site:


I notice that there is nothing about 3.9 itself. The above site is a Moodle 3.9.19 (Build: 20230116). (I know, the link is broken. The release pages have moved.) There is already a 3.9.21?

This is nothing compared to what the documentation says:


(For those who don't know, 3.9 (LTS) gets bug fixes and security updates till December. https://moodledev.io/general/releases)