General developer forum

Coding Error

 
Picture of Lawrence Boateng
Coding Error
 

I am using Moodle 4.0 on Linux Mint. I was creating some courses and the lights went off. When the lights came on I tried accessing moodle and I had this error: Coding error detected, it must be fixed by a programmer: Failed to unserialise data from file. Either failed to read, or failed to write.

I cannot create courses again. How do I fix it?
 
Average of ratings: -
Picture of Mark Johnson
Re: Coding Error
Core developersParticularly helpful MoodlersPlugin developers

Hi Lawrence,

The current version of Moodle is 3.3, so you may be a little confused about the version you're running.

In any case, I would guess that this a file permission error.  Check that the user your web server is running has can read and write to your dataroot directory correctly.

 
Average of ratings: -
Picture of Lawrence Boateng
Re: Coding Error
 
Hi Mark. Thanks for the reply. I checked from other sources and I have to delete the cache files in the /moodledata/cache directory.


 
Average of ratings: -
Picture of Lawrence Boateng
Re: Coding Error
 

Hi Mark. I have been able to resolve the issue. It was with the cache files in the  /var/moodledata/cache directory. I did not have permission to empty the folder so I used the command;

chmod -R 0777 /var/moodledata/cache to allow everyone access to the directory. I then deleted the files in the directory and it worked.

 
Average of ratings: -