WordPress.org

Ready to get started?Download WordPress

Forums

Mounting read only took down entire site (4 posts)

  1. ruddj
    Member
    Posted 6 years ago #

    I installed Super Cache and it was working fine. Then my host had an issue and mounted the volume as read only. Suddenly my website would not load at all and was having fatal errors.

    Warning: fopen(/mounted-storage/MyHome/www/wordpress/wp-content/cache/wp_cache_mutex.lock) [function.fopen]: failed to open stream: Permission denied in /mounted-storage/MyHome/www/wordpress/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 98
    Couldn't write to: /mounted-storage/MyHome/www/wordpress/wp-content/cache/wp-cache-b948cad31c816ac4765e91dd2274988f.html
    Warning: flock() expects parameter 1 to be resource, boolean given in /mounted-storage/MyHome/www/wordpress/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 107

    Warning: fopen(/mounted-storage/MyHome/www/wordpress/wp-content/cache/meta/wp-cache-b948cad31c816ac4765e91dd2274988f.meta) [function.fopen]: failed to open stream: Read-only file system in /mounted-storage/MyHome/www/wordpress/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 362

    Would it be possible to include a check in Super Cache that if it fails to open the wp_cache_mutex.lock file it does not take down the entire site. It should have some fallover support in case this happens.
    Thankyou.

  2. ruddj
    Member
    Posted 6 years ago #

    Closer analysis of source code wp-cache-phase2.php:
    wp_cache_mutex_init() is called on L14 then $mutex is populated on line 98,
    $mutex = fopen($cache_path . $mutex_filename, 'w');

    However there is no check that $mutex contains a valid pointer instead of false. $mutex is then used in several other functions that then fail.

    Overall result, as super-cache can not open the $mutex file as writeable no page is displayed at all.

  3. Donncha O Caoimh
    Member
    Posted 6 years ago #

    Ouch, that was bad for you. MySQL stopped working too? I'll add a check in there for the mutex, good catch!

  4. ruddj
    Member
    Posted 6 years ago #

    Funny MySQL kept working. Probably on a different server. Likely there was a problem with the file system and Linux automounted the drive as read-only.

    Worst thing was because all files were read only I couldn't even use my filemanager to go in and edit wp-cache-config or wp-config to temporarily disable the cache.
    Without caching enabled site probably would have been fine and I wouldn't have noticed any problem. Ironic that the plugin you add to increase reliability and reduce server processing ends up being affected by the problem.

    Thanks for adding the check donncha, I've temporarily disabled super cache in case my host has problems again, but as soon as the next cache version is released I'll update and have it going again.
    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic