Check oracle usage error message after upgrade

Check oracle usage error message after upgrade

by Martin T -
Number of replies: 16
Hello,
Recently upgraded to 4.3.3 and now see this error in the Environment section in Moodle.



I found this thread that has the same error: https://moodle.org/mod/forum/discuss.php?d=457466&mode=4
However, the advice there doesn't seem to apply to me - output from the various commands



What should I be checking next?
Average of ratings: -
In reply to Martin T

Re: Check oracle usage error message after upgrade

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

I found this thread that has the same error: https://moodle.org/mod/forum/discuss.php?d=457466&mode=4
However, the advice there doesn't seem to apply to me - output from the various commands

This output doesn't show you've checked that your lib/upgradelib.php contains the function definition for check_oracle_usage() at the end.

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: Check oracle usage error message after upgrade

by Martin T -
Good call out, I missed that somehow.

I just checked now and I think it's missing. I downloaded the tgz package from https://download.moodle.org/download.php/stable403/moodle-4.3.3.tgz (linked on https://download.moodle.org/releases/latest/ under "This is the latest official update of Moodle 4.3." section.

My file doesn't have a line 2888 nor does it have "check_oracle_usage" in the file





What's my solution? The linked post states "In general this shouldn't occur if the source code is managed by Git as these lines were added in the same commit. It also shouldn't happen if these two files were obtained from the same .zip or .tgz file from moodle.org."
In reply to Martin T

Re: Check oracle usage error message after upgrade

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

If you search admin/environment.xml for "check_oracle_usage" is this present?

As far as I can tell the error message occurs if check_oracle_usage is in admin/environment.xml but isn't in lib/upgradelib.php.

With Moodle 4.3.3. (i.e. moodle-4.3.3.tgz, the version you've downloaded) it should be in neither file, so obviously the error should not occur.

On https://download.moodle.org/releases/latest there's also a link to the 4.3.3+ weekly release, moodle-latest-403.tgz. This does contain check_oracle_usage in both files (because it has been added since 4.3.3), so again the error should not occur. But it would occur if you somehow had admin/environment.xml from 4.3.3+ (with check_oracle_usage), but lib/upgradelib.php from 4.3.3 (without check_oracle_usage). I can't imagine how this would happen, but you're the third person to report this.

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: Check oracle usage error message after upgrade

by Martin T -
I actually don't have the "check_oracle_usage" in the enviroment.xml file...



(this is nano with the "where is" function)
In reply to Martin T

Re: Check oracle usage error message after upgrade

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

In that case I'm out of ideas. As far as I know it's the lines:

      <CUSTOM_CHECK file="lib/upgradelib.php" function="check_oracle_usage" level="optional">

in admin/environment.xml that cause this check to happen. So if these lines aren't present there should be no Oracle check and thus no error.

In reply to Leon Stringer

Re: Check oracle usage error message after upgrade

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

One more idea, in your moodledata folder is there an environment/environment.xml file? Does that contain the above check?

Average of ratings: Useful (1)
In reply to Martin T

Re: Check oracle usage error message after upgrade

by Ken Task -
Picture of Particularly helpful Moodlers
At Martin T ...
since you have command line, strongly suggest that in a situation like this, git is your 'best friend' as you can delete both environment files and then restore both enviornment files via git.

Had this very thing happen when updating a 4.2.x site to highest available 4.2.x via git and command line as root user ... but it went away all by itself when checking site with GUI.   Attributed to a 'hickup'.

Did you notice other poster's solution?   Change theme to one of boost or classic.

On sites that use 3rd party theme, probably not a bad idea to force the theme to boost via config.php for the upgrade ... and then, if goes well, comment out the config.php line that forces theme - but leave line for your next update/upgrade. (purge all caches after).

'SoS', Ken


In reply to Ken Task

Re: Check oracle usage error message after upgrade

by Martin T -
We use Moove as our theme (which is Boost based) so I doubt it's theme related.

So far we've boiled down to the check isn't present in the regular enviroment.xml file but is in the copy in moodledata. I'm unsure my next steps here.
In reply to Martin T

Re: Check oracle usage error message after upgrade

by Ken Task -
Picture of Particularly helpful Moodlers
In your screen shot of commands you tired, see that one ...

php admin/cli/upgrade.php

wasn't issued correctly.

What would it hurt to force site to use boost via config.php file to see if it is related to theme?
'boost based' isn't 'boost'!

And, what the heck is environment.xml doing in moodledata?

Have 4.1.9+, 4.2.highest, and 4.3.highest sites and none of them ... repeat ... none of them have environment.xml in moodledata!!!

Either hide by renaming environment.xml with a dot in front ... like .environment.xml or delete that file in moodledata.   Then go to Site Admin Server Environment Check - Update component
That should place an environment.xml file in the correct spot.

'SoS', Ken

In reply to Martin T

Re: Check oracle usage error message after upgrade

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

What I think is happening is:

  1. On the Environment page there's an Update component link. This downloads moodledata/environment/environment.xml which is from the latest weekly release.
  2. When Moodle performs the checks on the Environment page it uses the most recent out of admin/environment.xml and moodledata/environment/environment.xml.
  3. For the latest non-weekly release admin/environment.xml will have the same date when it was added to the .tgz/.zip. For 4.3.3 this is 9 February 2024. Obviously any subsequent weekly release will have a more recent environment.xml.

So if one clicks Update component it's possible to obtain an environment.xml containing checks that the Moodle version doesn't actually support yet, resulting in the Error reading environment data message.

Martin: I would suggest you either update to the most recent 4.3.3+ weekly release, or just delete moodledata/environment/environment.xml, or run touch admin/environment.xml.

But I think it's something Moodle should handle better. I can't see this has been reported in the Tracker.

Average of ratings: Useful (2)
In reply to Leon Stringer

Re: Check oracle usage error message after upgrade

by Ken Task -
Picture of Particularly helpful Moodlers
Well, I'll be ....
In a 4.1.9+ git acquired but have used update component link

moodledata/environment/ there are actually 2 files:

environment.md5 Apr 10 32
environment.xml Apr  9 162252

and in code/admin/
the environment.xml file is 162133
smaller size.

Ditto for another 4.1.9+ instance on another server.

'SoS', Ken
In reply to Leon Stringer

Re: Check oracle usage error message after upgrade

by Martin T -
Perfect. Explanation makes sense, touching the xml in the install dir fixes the issue.
Thank YOU!
In reply to Leon Stringer

Re: Check oracle usage error message after upgrade

by Uwe Wennmann -

Thanks for the precious tipp - the update to Moodle 4.3.6 (Build: 20240812) works after

image%20%281%29.png

touch moodle/admin/environment.xml

I think I pressed the button on the right "Komponente aktualisieren".

image%20%282%29.png