Notice: possible solution for "Fatal error: $CFG->dataroot is not writable, admin has to fix directory permissions! Exiting."

Notice: possible solution for "Fatal error: $CFG->dataroot is not writable, admin has to fix directory permissions! Exiting."

by Lea Cohen -
Number of replies: 0

One morning, we suddenly ran into this error on all of our installations in our Moodle development server. Even though we knew we hadn't touched any filesystem permissions or configuration, we still tried playing around with changing owners and permission, but of course to no avail.

Eventually we thought to check SELinux state, and discovered it was enabled, despite disabling it on installation (we're using Centos). We found out that what had caused this error was that during installation we had only temporarily set it to "permissive", and the day before the error occurred, someone had restarted the networking service and returned the system to its default settings in which the SELinux was enabled. So we permanently set it to permissive and  now everything works.

Hope it helps someone.

Average of ratings: -