Updgrade Error - open_baseir

Updgrade Error - open_baseir

by Tim F -
Number of replies: 10

We can't successfully get the moodle php.ini file to update the line for the open_baseir


currently it is pointing to: 


open_basedir: /home/admin/web/hoopsenglish.com/public_html:/home/admin/tmp

we want to set this to: none 


we have updated the location on the server to "none" but this is not reflected in Moodle -

we think there is an override written somewhere in the code

We are upgrading from 3.8 to 3.10

Here are some of the error message we are seeing 


We have done many customizations to platform so I really prefer not to make fresh installation. 



Average of ratings: -
In reply to Tim F

Re: Updgrade Error - open_baseir

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

The errors in the screenshots don't look like open_basedir problems, what suggests this? I'm fairly sure that Moodle doesn't manipulate open_basedir. It may be that this is being set by your hosting service if this is a managed service rather than a VPS. What does PHP info say for open_basedir?

What the errors in your screenshots look like is Moodle 3.10 with an incompletely upgraded database. Both the external function core_output_load_fontawesome_icon_system_map and the capability moodle/contentbank:access were introduced in Moodle 3.9 so they should be present, e.g. with my 3.10 database:

SELECT id, name FROM mdl_external_functions
  WHERE name = 'core_output_load_fontawesome_icon_system_map';
+-----+----------------------------------------------+
| id  | name                                         |
+-----+----------------------------------------------+
| 613 | core_output_load_fontawesome_icon_system_map |
+-----+----------------------------------------------+
SELECT id, name FROM mdl_capabilities
  WHERE name = 'moodle/contentbank:access';
+-----+---------------------------+
| id  | name                      |
+-----+---------------------------+
| 232 | moodle/contentbank:access |
+-----+---------------------------+

I would guess from the errors in the screenshot that these rows are not present in your database. If you still have the Moodle 3.8 database I would restore that (ensuring the existing database is deleted first) and attempt the upgrade again. Upgrading by command line tends to be safer if this is available to you.

"We have done many customizations to platform" – are these Moodle source code changes or configuration changes?

Also, it looks like the site is using the Adaptable theme. This isn't compatible with Moodle 3.10.

In reply to Leon Stringer

Re: Updgrade Error - open_baseir

by Tim F -
The PHP info says -

/home/admin/web/hoopsenglish.com/public_html:/home/admin/tmp


I think we made both source code changes and configuration changes - but I'm not really sure - I had someone helping me to make design changes and some functionality changes but I never got the documentation from them (and now this design guy has gone AWAL).

And now I have hired these guys to updgrade from 3.8 to 3.10 and to do some enrollment work from a wordpress storefront (using Edwiser Bridge).

To make a long story short I think I'm in the middle of a real mess.

So basically if I am understanding correctly - because we tried to go from 3.8 straight to 3.10 we may have missed some key files that are included in the 3.9 updgrade - that now is causing the problem?


And now the fact that I am communicating to the Moodle Experts that it is not an "open_basedir" issue then I'm a little bit unsure if the light at the end of the tunnel is the exit or a train...

thank you
In reply to Tim F

Re: Updgrade Error - open_baseir

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

If open_basedir has been changed to none and this isn't showing in PHP info then either: 1) it hasn't been changed in the correct place, 2) the service – e.g. Apache or PHP-FPM – hasn't been reloaded to pick up the new setting or 3) a managed hosting service is preventing the restriction being removed. But when open_basedir blocks access you get an error like "open_basedir restriction in effect".

You can upgrade directly from 3.8 to 3.10. During the upgrade changes should get made to the database and the errors you've shared indicate some of these haven't occurred. Do you have the 3.8 database backup? I'm suggesting you restore this and attempt to repeat the upgrade to 3.10 and check 1) it completes without error and 2) the expected database rows are now present afterwards. If not, maybe these tables can be restored from a test site.

Are you saying you've paid someone to do this upgrade? And they're not resolving the errors? Or they're suggesting open_basedir as a cause?

To correct what I said earlier: core_output_load_fontawesome_icon_system_map was added in Moodle 3.8.5, do you know the full version of 3.8 you had?

You need to find out if the core Moodle source code has been modified. If you're paying someone who knows Moodle they should be able to tell you, e.g. by running a recursive diff comparing your source code with that from moodle.org. Customising source code (rather than using bespoke plugins) has two problems: 1) it gets in the way of upgrades because you have to apply these changes each time and 2) it gets in the way of support, providers – including us on these forums – don't know about any non-standard behaviour the site has.

In reply to Leon Stringer

Re: Updgrade Error - open_baseir

by Tim F -
so the open_basedir has been changed on Apache and reflects correctly as "none" on the php info pages for other sides on the server (Amazon AWS) - and in the save settings on the server there is clearly a "restart server" function that is activated when we save changes.

Is there a way in Moodle to "clear the cache" so that it could catch any changes to a php.ini change? ?
as I imagine Moodle is not constantly referencing that document every time we load page...

Yes the person I am paying has suggested with confidence the open_basedir issue as the cause after 4-5 days working on problem.  

Only Monday can I confirm the full version of 3.8 and also with the source code if changes were made as that person is not available until then.

I really would like to avoid this issue in the future - assuming we can get through this situation! -

and since now I am using Wordpress as the storefront the issue of "theme" becomes less important - is there any themes that are most recommended for facility of upgrading Moodle versions?  Would you recommend me trying to change themes on my own to classic just to see if these errors go away?  I am a bit nervous to try this as then I won't be able to come back to adaptable as it's not compatible and I don't want to compound the situation further! 

Thank you Leon!
In reply to Tim F

Re: Updgrade Error - open_baseir

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

PHP settings like open_basedir can be set on a per-site basis with an Apache .htaccess file in the Moodle source code file with an entry like:

php_value open_basedir <directory_list>

PHP settings are read by the PHP environment, in this case Apache. Moodle doesn't have any control over when changes are read. That said, changes made to settings .htaccess are effective immediately.

You probably already know that open_basedir restricts which files can be accessed, it doesn't affect database access. The errors in the two screenshots indicate database rows that should get added during a successful upgrade are missing. The presence of these rows can be confirmed using the queries in the first reply. Hopefully it will be possible to get open_basedir changed establishing if this is a factor or not.

You can switch the the theme to Boost (the default) and change it back, I wouldn't expect any compatibility issues to affect that.


In reply to Leon Stringer

Re: Updgrade Error - open_baseir

by Tim F -
errorThey seem to have figured out some of it - there was definitely some htaccess issue involved

I will get the solution and post here for if anyone else comes across this error

now we are still getting this but there is improvment and we still need to change the theme before everything working good.

Thank you your posts helped me to guide these people to some direction of solution!
In reply to Tim F

Re: Updgrade Error - open_baseir

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

That latest error looks like it has the same cause as the second of your first two screenshots: a capability that should have been added during upgrade is missing. Previously it was moodle/contentbank:access, this time it's mod/h5pactivity:addinstance.

I've attached a tab-separated list of the capabilities which are added when upgrading from Moodle 3.8.6 to 3.10. It should be possible to use this to determine if other capabilities are missing and then insert those if necessary, e.g.:

INSERT INTO mdl_capabilities (name, captype, contextlevel, component, riskbitmask)
VALUES ('mod/h5pactivity:addinstance', 'write', 50, 'mod_h5pactivity', 0);

You could then reset each role to apply the default permissions for the affected capabilities – that is unless the site uses modified capabilities as resetting them would lose your changes. In which case you may have to set the permissions for each added capability for each role manually which would be laborious.


In reply to Leon Stringer

Re: Updgrade Error - open_baseir

by Tim F -
Ok previous errors have been solved - the screens before now work correct.  

Also worth nothing is that in 3.8 my server was bluehost shared server and now I have moved server to AWS - 

just to make things interesting - one person was hired to get the AWS server setup and Moodle 3.8 was functioning correctly on new AWS server before upgrade. 

A different person is doing the Moodle upgrade - they believe that the errors are controlled on servers settings in htaccess file or other settings -  the person who helped with the server has zero familiarity with Moodle...



Now only remaining error message is coming when we try to import questions into the question bank :



Here is screen shot







sad



Here are the debugging notes - 



Warning: fileexistrff open_basedir resMcIMn in effect. Flle(ttmp/requestditrphkz) is not Wthin the allowed path(s)

/home/admin/web/hoopsenglish.com /public_html:Mome/adminamp) in Mome/admintweb/hoopsenglish.com/public_html/courses/libisetuplib.php on One 1538



Warning: fileexistrff open_basedir resMcIMn in effed. Flle(ttmp/requestdir/phkz) is not Wthin the allowed path(s)sad/home/admin/web/hoopsenglish.com /public_html:Mome/admintrrnp) In Mome/admintweb/hoopsenglish.com/public_html/courses/libisetuplib.php on line 1548



Warning: is_airo: open_basedir restriction in effect. FiletrImp/requestditrphkff is not within the allowed path(s): (/home/admin/web/hoopsenglish.com /public_html:Mome/adminnonp) in Thome/adrnin/web/hoopsenglish.com/public_htrolkourses/libMetuplib.php on line 1552



the error line are different but its same error



Warning: fileexistrff open_basedir

Warning: fileexistrff open_basedir

Warning: is_airo: open_basedir



THANKS - once the updgrade is complete I will (hopefully) receive documentation from the installation and post what solutions they used -
In reply to Tim F

Re: Updgrade Error - open_baseir

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

This might be due to a change in Moodle 3.10 (MDL-66928). Try adding the following to config.php:

$CFG->localrequestdir = '/home/admin/tmp/requestdir';
Average of ratings: Useful (1)
In reply to Leon Stringer

Re: Updgrade Error - open_baseir

by Tim F -
LEON THANK YOU - this last reply of adding

$CFG->localrequestdir = '/home/admin/tmp/requestdir';


to the config.php did the trick.