Support » Requests and Feedback » Mounting read only took down entire site

  • ruddj


    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • ruddj


    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.

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



    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Mounting read only took down entire site’ is closed to new replies.