Hello, I have a real humdinger. I'm the Moodle Developer for a University and have been plagued by this "Exeption - Failed to write cache file" for a few months now. My stack is load balanced with 2 head ends and the moodle_data directory is on a beefy Dell Compellent NFS system. There are other Moodle instances on the stack but nothing shared. Other instances have different, older, versions and work fine.
This year our current Moodle instance is using 3.5.3.
Our cache is Couchbase (Memcached) that's behind TwemProxy. Sessions are also in memcached but in it's own seperate bucket (so we can purge if needed without losing sessions).
If I don't purge Moodle Cache, Memcached and OPCache after 10-14 days then suddenly all users will get "Failed to write cache file". If a student hit's refresh 3-5 times then sometimes it goes away. A few pages later and they'll get that error again and again. As soon as I purge all caches the issues is gone for another week or two.
I'm having a heck of a time replicating this on our test stack and it's extremely frustrating to all users, especially when they are writing exams/quizzes.
Why would this suddenly creep up and affect all users?
When I navigate into the localcache/mustache/[some number]/[theme name]/ folder I can see that file that failed to write.
From what I can see, and correct me if I'm wrong, as soon as the __MUSTACHE_ file is created that's it. These cached files should not be re-written.......right???
(4 hours later) So doing some more searching I found a similar issue: https://moodle.org/mod/forum/discuss.php?d=379587 and in this case this user had issues with language pack translations. We currently use es, fr and ja. Could this be a possible cause?
Any help or advice would be greatly appreciated.