Mixed Versions detected after doing Git

Mixed Versions detected after doing Git

by Debbie Unterseher -
Number of replies: 7

Trying to move from 3.5 to 3.6.  Have used git successfully to do the minor updates.  I am not the server admin, but trying to help him out.  These are the commands he did.  Now we have the message "Mixed versions detected".  I've attached images of what our Moodle directory looks like now.

  1. Sync local git to remote 

    1. git remote update

  2. Get new major version

    1. git checkout -b MOODLE_36_STABLE origin/MOODLE_36_STABLE

  3. Update new major version

    1. git pull

  4. Remove old major branch

    1. git branch -d MOODLE_35_STABLE


Attachment pic1.png
Attachment pic2.png
Average of ratings: -
In reply to Debbie Unterseher

Re: Mixed Versions detected after doing Git

by Ken Task -
Picture of Particularly helpful Moodlers

Did he/you begin with a backup of code and a matching DB dump?   Might be easier restoring the backup and then try it again ... but maybe not before checking out what you have.

The #1 you have:

git remote update

are we certain it 'sync local git to remote'?

What does: fgrep '$release' version.php show?

What does git branch -a show right now?

When site was 3.5 ... was it ever updated to highest 3.5.7+?

And for further confusion, following might help:

https://stackoverflow.com/questions/36358265/when-does-git-refresh-the-list-of-remote-branches

Comment: victume to -b upon initial install ... but that's my non-git-guroooo opinion. :|

'SoS', Ken


In reply to Debbie Unterseher

Re: Mixed Versions detected after doing Git

by Debbie Unterseher -

Notice the different dates in the files and the different file ownerships. Not sure why.

In reply to Debbie Unterseher

Re: Mixed Versions detected after doing Git

by Ken Task -
Picture of Particularly helpful Moodlers

There are many that say to run git commands as sudo for web service user.   Ubuntu - www-data ... CentOS 6-7 - apache - Debian ? but supposed to be like Ubuntu.

I run as root and the last thing I have my 'up' bash shell script do is set ownerships and reset some permissions ... like completely hiding the hidden .git directory at code root from outside viewers.

Yes, saw the dates .... probably why your server reports mixed ... it is!  

Are you going to answer any of my questions?   Like ... what do you have now for:

git branch -a

and

fgrep '$release' version.php

Kinda important if I was going to suggest "sideloading" code and replacing .git directory in code to make a correction in usage of git.

From what I've learned ... -b is really for programmers and if one is going to run their own repo of Moodle code.

The official moodle docs I used are located:

https://docs.moodle.org/37/en/Git_for_Administrators

Note that on that page, in the section

Obtaining the code from Git

The git clone command doesn't use -b.

If, however, you wish to pursue your situation ... a little leg work for a via google:

https://stackoverflow.com/questions/36358265/when-does-git-refresh-the-list-of-remote-branches

Not saying info above will provide your answer, however.

Also asked if admin did a full site backup prior to and suggested it might be best to restore what one had prior to attempt.

'SoS', Ken

In reply to Ken Task

Re: Mixed Versions detected after doing Git

by Debbie Unterseher -

We found out it was two plugins causing the problem: flashcard and hsuforum.  Deleted those folders, but now it gives another error (see CURRENT ERROR below).  Although we are going to try to reload the database again to see if that error gets taken care of.

Why plugins didn't work with GIT:  We are using GIT for our main moodle site, but NOT for the plugins.  The plugins had a reference to  /lib/eventslib.php  which is no longer in Moodle 3.6.  Even though we updated the plugins before going to 3.6, it only updated the plugins with the 3.5 version, which still referenced this file. 

Now this message.  Time for more google searching.   I also copied the information below for the git branch -a and fgrep '$release' version.php

CURRENT ERROR:

Error writing to database

More information about this error

Debug info: Duplicate entry '693-67' for key 'mdl_messuserbloc_useblo_uix'
INSERT INTO mdl_message_users_blocked (userid, blockeduserid, timecreated)
SELECT userid, contactid, null as timecreated
FROM mdl_message_contacts
WHERE blocked = ?
[array (
0 => 1,
)]
Error code: dmlwriteexception
×Stack trace:
  • line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 1139 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 2466 of /lib/db/upgrade.php: call to mysqli_native_moodle_database->execute()
  • line 1793 of /lib/upgradelib.php: call to xmldb_main_upgrade()
  • line 518 of /admin/index.php: call to upgrade_core()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

root@uc-moodlet:/var/www/html/moodle# git branch -a
* MOODLE_36_STABLE
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/MOODLE_13_STABLE
  remotes/origin/MOODLE_14_STABLE
  remotes/origin/MOODLE_15_STABLE
  remotes/origin/MOODLE_16_STABLE
  remotes/origin/MOODLE_17_STABLE
  remotes/origin/MOODLE_18_STABLE
  remotes/origin/MOODLE_19_STABLE
  remotes/origin/MOODLE_20_STABLE
  remotes/origin/MOODLE_21_STABLE
  remotes/origin/MOODLE_22_STABLE
  remotes/origin/MOODLE_23_STABLE
  remotes/origin/MOODLE_24_STABLE
  remotes/origin/MOODLE_25_STABLE
  remotes/origin/MOODLE_26_STABLE
  remotes/origin/MOODLE_27_STABLE
  remotes/origin/MOODLE_28_STABLE
  remotes/origin/MOODLE_29_STABLE
  remotes/origin/MOODLE_30_STABLE
  remotes/origin/MOODLE_31_STABLE
  remotes/origin/MOODLE_32_STABLE
  remotes/origin/MOODLE_33_STABLE
  remotes/origin/MOODLE_34_STABLE
  remotes/origin/MOODLE_35_STABLE
  remotes/origin/MOODLE_36_STABLE
  remotes/origin/MOODLE_37_STABLE
  remotes/origin/master
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
root@uc-moodlet:/var/www/html/moodle# fgrep '$release' version.php
$release  = '3.6.5+ (Build: 20190712)'; // Human-friendly version name

In reply to Debbie Unterseher

Re: Mixed Versions detected after doing Git

by Ken Task -
Picture of Particularly helpful Moodlers

Thanks sharing back info.  And congrats!

So no more 'mixed' errors and dates of folders and files don't reflect that either ... good!

That error would have been tripped using any method of upgrading moodle code, BTW.

Now a question ... when you say:

Although we are going to try to reload the database again to see if that error gets taken care of.

Does that mean restore a backup of DB (sql dump) that was made when?   If before when you had issues with the in-compat plugins, wouldn't that be a self-inflicted wound?

The more info link had a couple of suggestions ... both related to config of DB server ... max_packet_allowed and InnoDB/Baracuda.

So what does /etc/my.cnf look like? (config for MySQL DB server)

BTW, there are scripts in moodlecode/admin/cli that pertain to InnoDB/Baracuda and could help you id or at least inform about your DB for moodle.

'SoS', Ken


In reply to Ken Task

Re: Mixed Versions detected after doing Git

by Debbie Unterseher -
Got everything working now. Apparently the root of all this problem was the Hsuforum and the Flashcard module that caused havoc with us updating to Moodle 3.6 from 3.5 because of the eventslib.php file that Moodle no longer has. If you go directly to the git repository for this module https://github.com/blackboard-open-source/moodle-mod_hsuforum, and download it from there, it works fine. We had to remove the plugin folder for both of these modules first to get it working and not displaying the HTTP 500 error. Thanks for your help!