Error message - "requce_once(): Failed opening required" during Moodle upgrade about the file setup.php in lib - "/usr/local/moodle/lib/setup.php"
I am trying to upgrade it to Moodle 3.8.9. I included the minimal necessary plugins that are previously installed, including upgrade version of Moove theme, plarigism - veriguide, lockdown browser, booktool wordimport. However, it prompts the below error message after undergoing upgrade for several hours.
Warning: require_once(/usr/local/moodle/lib/navigationlib.pgp): failed to open stream: No such file or directory in /usr/local/moodle/lib/setup.php on line 599
Fatal error: require_once(): Failed opening required '/usr/local/moodle/lib/navigationlib.pgp' (include_path='/usr/local/moodle/lib/pear:.:/usr/local/php/lib/php') in /usr/local/moodle/lib/setup.php on line 599
It tried many times. The error message always occurs at the file under the directory /usr/local/moodle/lib/
Please let me know what is the cause of this error message. Kindly advise how to fix it. Thank you very much.

Re: Error message - "requce_once(): Failed opening required" during Moodle upgrade about the file setup.php in lib - "/usr/local/moodle/lib/setup.php"
Essential theme no longer supported. Suggest using a theme that comes with core code (boost) for the upgrade and beyond.
You could use config.php to set default theme:
$CFG->theme='boost';
Please see:
https://moodle.org/plugins/theme_essential
'SoS', Ken
Re: Error message - "requce_once(): Failed opening required" during Moodle upgrade about the file setup.php in lib - "/usr/local/moodle/lib/setup.php"
Re: Error message - "requce_once(): Failed opening required" during Moodle upgrade about the file setup.php in lib - "/usr/local/moodle/lib/setup.php"
When you un-installed Essential theme how did you do that?
core_plugin/err_removing_unremovable folder?? Permissions on folders of code?
Fatal error: require_once(): Failed opening required '/usr/local/moodle/lib/navigationlib.pgp'
???? navigationlib.pgp?????
Did you look at line 559 of lib/setup.php?
Best to use core themes ... if not boost then classic.
Installing a new theme at the same time as upgrade very well could confuse things.
Are all your plugins compatible with the version you are upgrading to?
For more info, one could add the debugging lines from config-dist.php to config.php
'SoS', Ken
Re: Error message - "requce_once(): Failed opening required" during Moodle upgrade about the file setup.php in lib - "/usr/local/moodle/lib/setup.php"
1. Theme selector->Select "boost"
2. At Plugin overview->Theme->Essential->uninstall->It display SUCCESS.
3. Before clicking "Continue"->I delete the theme/essential folder in Linux
4. Click "Continue"->It prompts "core_plugin/err_removing_unremovable folder"
5. Then, I click "Upgrade Moodle database now"
The permission of code folder for directory is 755 and executable files are 644.
The below is a portion of setup.php. It looks like some PHP library file.
// Remember the default PHP timezone, we will need it later.
core_date::store_default_php_timezone();
// Load up standard libraries
require_once($CFG->libdir .'/filterlib.php'); // Functions for filtering test as it is output
require_once($CFG->libdir .'/ajax/ajaxlib.php'); // Functions for managing our use of JavaScript and YUI
require_once($CFG->libdir .'/weblib.php'); // Functions relating to HTTP and content
require_once($CFG->libdir .'/outputlib.php'); // Functions for generating output
require_once($CFG->libdir .'/navigationlib.php'); // Class for generating Navigation structure <----------"599"
require_once($CFG->libdir .'/dmllib.php'); // Database access
require_once($CFG->libdir .'/datalib.php'); // Legacy lib with a big-mix of functions.
require_once($CFG->libdir .'/accesslib.php'); // Access control functions
require_once($CFG->libdir .'/deprecatedlib.php'); // Deprecated functions included for backward compatibility
I will try to upgrade with Boost theme first and install Moove theme later. Thanks for advice.
I checked that all plugins are compatible to the version 3.8 I am upgrading except one plugin - Atto word import.
I had twice experience of successfully upgraded Moodle to 3.8 while I kept using the Atto word import 1.3.7 which is claimed to be compatible to Moodle 3.4 only.
Re: Error message - "requce_once(): Failed opening required" during Moodle upgrade about the file setup.php in lib - "/usr/local/moodle/lib/setup.php"
require_once($CFG->libdir .'/filterlib.php'); // Functions for filtering test as it is output
require_once($CFG->libdir .'/ajax/ajaxlib.php'); // Functions for managing our use of JavaScript and YUI
require_once($CFG->libdir .'/weblib.php'); // Functions relating to HTTP and content
require_once($CFG->libdir .'/outputlib.php'); // Functions for generating output
require_once($CFG->libdir .'/navigationlib.php'); // Class for generating Navigation structurelibdir .'/dmllib.php'); // Database access <---599
require_once($CFG->libdir .'/datalib.php'); // Legacy lib with a big-mix of functions.
require_once($CFG->libdir .'/accesslib.php'); // Access control functions
require_once($CFG->libdir .'/deprecatedlib.php'); // Deprecated functions included for backward compatibilitylibdir .'/moodlelib.php'); // Other general-purpose functions <---603
require_once($CFG->libdir .'/enrollib.php'); // Enrolment related functions
require_once($CFG->libdir .'/pagelib.php'); // Library that defines the moodle_page class, used for $PAGElibdir <---606 .'/blocklib.php'); // Library for controlling blockslibdir .'/grouplib.php'); // Groups functions <--607
require_once($CFG->libdir .'/sessionlib.php'); // All session and cookie related stuff
require_once($CFG->libdir .'/editorlib.php'); // All text editor related functions and classes
require_once($CFG->libdir .'/messagelib.php'); // Messagelib functions
require_once($CFG->libdir .'/modinfolib.php'); // Cached information on course-module instances
require_once($CFG->dirroot.'/cache/lib.php'); // Cache API
Re: Error message - "requce_once(): Failed opening required" during Moodle upgrade about the file setup.php in lib - "/usr/local/moodle/lib/setup.php"
core_plugin/err_removing_unknown_plugin
Debug info: core_plugin_manager::get_plugin_info() returned null for the plugin to be deleted
Error code: err_removing_unknown_plugin
$a contents: Array
(
[plugin]=>theme_essential
)
Stack trace:
line 136 of /admin/plugins.php: moodle_exception thrown
Re: Error message - "requce_once(): Failed opening required" during Moodle upgrade about the file setup.php in lib - "/usr/local/moodle/lib/setup.php"
First, for a CentOS 7 server, /usr/local/moodle is a strange location for moodle code. CentOS 7 is Linux Standards Base distro which means apache config (httpd.conf) default would make /var/www/ apache users home directory. In there, an html which is typically document root as defined in main config file for apache. /etc/httpd/conf/httpd.conf on typical setup.
Having moodle in /usr/local/ would mean there are or should be other config files that define that directory. Do you have a special config file for that location or have you changed httpd.conf such that /usr/local/ is now apache home?
Plugin removal best done by Moodle Admin interface, but in the cases of plugins that have dependencies (require other plugins), one might have to resort to manually moving the plugin folders out to an archive directory, then visiting plugins via Moodle Admin interface ... it will say missing from disk ... that's ok, click the 'Upgrade Database' button and that should remove rows in mdl_config_plugins table that refer to those plugins.
In what you shared back about owner ... daemon,daemon???? The user for apache on CentOS 7 is typically 'apache' ... as defined in main config file /etc/httpd/conf/httpd.conf
A failed attempt to upgrade will mess with DB tables some so you might have to restore your DB to when site was running older version.
Hope you did a site backup ... code + DB minimally ... so you can restore and 'try it again'.
The next try, make sure you have debugging turned on from the get go.
What documents are you following for upgrading?
When your site was a 3.6, did you check server environment and update the component. Then picked 3.8 as destination version to see if there were any reported issues concerning environment?
BTW, you never did answer the question about that strange file name ... ending with .pgp in moodle code related to navigation. That's why I ask about what docs you are following for upgrading.
'SoS', Ken
Re: Error message - "requce_once(): Failed opening required" during Moodle upgrade about the file setup.php in lib - "/usr/local/moodle/lib/setup.php"
Yes, it is a source code compile version of Apache. It is my Boss's habit that he always changes var/www/apache to /usr/local/moodle,
The user for apache on this CentOS 7 is daemone instead of 'apache' ... as defined in main config file /usr/local/apache2/conf/httpd.conf
After turn on the debugging mode, it shows the below error message:
Warning: array_key_exists() expects parameter 2 to be array, null given in /usr/local/moodle/lib/moodlelib.php on line 1499
Notice: Undefined property: stdClass::$dirroot in /usr/local/moodle/cache/classes/factory.php on line 476
Warning: require_once(/cache/classes/dummystore.php): failed to open stream: No such file or directory in /usr/local/moodle/cache/classes/factory.php on line 476
Fatal error: require_once(): Failed opening required '/cache/classes/dummystore.php' (include_path='/usr/local/moodle/lib/pear:.:/usr/local/php/lib/php') in /usr/local/moodle/cache/classes/factory.php on line 476
Fatal error: Uncaught Error: Call to a member function is_transaction_started() on null in /usr/local/moodle/lib/classes/shutdown_manager.php:137 Stack trace: #0 [internal function]: core_shutdown_manager::shutdown_handler() #1 {main} thrown in /usr/local/moodle/lib/classes/shutdown_manager.php on line 137
Re: Error message - "requce_once(): Failed opening required" during Moodle upgrade about the file setup.php in lib - "/usr/local/moodle/lib/setup.php"
Do you mean true compile?!!!!???
Like acquire source code then following directions from
this http://httpd.apache.org/docs/current/programs/configure.html#installationdirectories ?
What compile options were included for cache?
https://httpd.apache.org/docs/2.4/mod/mod_cache.html
What does:
/usr/sbin/httpd -V
return
Also:
/usr/sbin/httpd -t -D DUMP_MODULES
Since your boss did it, he/she should know exactly how compiled ... including any switches options for PHP and supports for MySQL as well!
I used to compile the AMP stack for my servers. Decided that it was just as good (less issues) to use the package manager of the OS and acquire stack that way.
'SoS', Ken
[solve]: Error message - "requce_once(): Failed opening required" during Moodle upgrade about the file setup.php in lib - "/usr/local/moodle/lib/setup.php"
We cloned the production site. We turn on the debugging mode as you advised and perform moodle upgrade. The moodle can be upgraded successfully in much shorter time. There is no fatal error message except some minor errors which can be easily fixed.
Re: [solve]: Error message - "requce_once(): Failed opening required" during Moodle upgrade about the file setup.php in lib - "/usr/local/moodle/lib/setup.php"
Welcome ... glad you resolved.
For those who might find this thread ...
One of the reasons I gave up compiling AMP was updates. Couldn't mix a OS repo upgrade (OS package manger) to any piece of compiled AMP stack. While compiled AMP stack did allow running well on non-server class workstations that were beefed up a little, the frequency of updates and upgrades using compile meant longer downtime.
One more piece of advice ... and now would be a good time for ya ... install/and maintain core moodle code via git. See
https://docs.moodle.org/311/en/Git_for_Administrators
*by far* the best way to maintain moodle core code - fewer moving parts - and literally takes only minutes ... less prone to human error also!
'Spirit of Sharing', Ken