wpsharks / comet-cache

An advanced WordPress® caching plugin inspired by simplicity.
https://cometcache.com
GNU General Public License v3.0
77 stars 18 forks source link

Improve error handling for cache write and rename failures #927

Open raamdev opened 6 years ago

raamdev commented 6 years ago

On some platforms, the filesystem or operating system prevent Comet Cache from being able to rename or write cache files. In these cases, the failure should be caught and handled in a way that does not produce a fatal error on the site.

[17-Apr-2018 04:31:05 UTC] PHP Warning: rename(/home/site/wwwroot/wp-content/cache/comet-cache/cache/https/www-sojospaclub-com/index.html-5ad578898e992184414454-tmp,/home/site/wwwroot/wp-content/cache/comet-cache/cache/https/www-sojospaclub-com/index.html): No such file or directory in /home/site/wwwroot/wp-content/plugins/comet-cache-pro/src/includes/traits/Ac/ObUtils.php on line 452

[17-Apr-2018 04:31:05 UTC] PHP Fatal error: Uncaught Exception: Comet Cache: failed to write cache file for: /; possible permissions issue (or race condition), please check your cache directory: /home/site/wwwroot/wp-content/cache/comet-cache/cache. in /home/site/wwwroot/wp-content/plugins/comet-cache-pro/src/includes/traits/Ac/ObUtils.php:457
Stack trace:
#0 [internal function]: WebSharks\CometCache\Pro\Classes\AdvancedCache->outputBufferCallbackHandler(‘<!DOCTYPE html>…’, 9)
#1 /home/site/wwwroot/wp-includes/functions.php(3729): ob_end_flush()
#2 /home/site/wwwroot/wp-includes/class-wp-hook.php(286): wp_ob_end_flush_all(”)
#3 /home/site/wwwroot/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#4 /home/site/wwwroot/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#5 /home/site/wwwroot/wp-includes/load.php(679): do_action(‘shutdown’)
#6 [internal function]: shutdown_action_hook()
#7 {main}
thrown in /home/site/wwwroot/wp-content/plugins/comet-cache-pro/src/includes/traits/Ac/ObUtils.php on line 457

Related: