Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using RAM as cache directory + Generic 500 error + Rename failure when saving changes #630

Open
MarioKnight opened this issue Dec 4, 2015 · 14 comments

Comments

@MarioKnight
Copy link

I touched upon this in #613 , however I believe this is unrelated so I am making a separate report. Whenever I save changes to ZenCache Pro options, I ger a generic 500 error in my browser. When I navigate back to the options page, the changes I made are present. When making one just a few minutes ago, I decided to check the apache error log for the domain for any hints. I was able to find this block in the logs:

[Fri Dec 04 10:25:55 2015] [error] [client 108.162.216.91] PHP Warning:  rename(/home/mdadmin/missdream.org/wp-content/cache/zencache/cache,/home/mdadmin/missdream.org/wp-content/cache/zencache/cache-5661b0833df11160594443-tmp): Device or resource busy in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php on line 147, referer: https://missdream.org/wp-admin/admin.php?page=zencache
[Fri Dec 04 10:25:55 2015] [error] [client 108.162.216.91] PHP Fatal error:  Uncaught exception 'Exception' with message 'Unable to delete files. Rename failure on directory: `/home/mdadmin/missdream.org/wp-content/cache/zencache/cache`.' in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php:148, referer: https://missdream.org/wp-admin/admin.php?page=zencache
[Fri Dec 04 10:25:55 2015] [error] [client 108.162.216.91] Stack trace:, referer: https://missdream.org/wp-admin/admin.php?page=zencache
[Fri Dec 04 10:25:55 2015] [error] [client 108.162.216.91] #0 [internal function]: WebSharks\\ZenCache\\Pro\\AbsBaseAp->WebSharks\\ZenCache\\Pro\\{closure}('/^.+/i'), referer: https://missdream.org/wp-admin/admin.php?page=zencache
[Fri Dec 04 10:25:55 2015] [error] [client 108.162.216.91] #1 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/classes/AbsBaseAp.php(55): call_user_func_array(Object(Closure), Array), referer: https://missdream.org/wp-admin/admin.php?page=zencache
[Fri Dec 04 10:25:55 2015] [error] [client 108.162.216.91] #2 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(40): WebSharks\\ZenCache\\Pro\\AbsBaseAp->__call('deleteFilesFrom...', Array), referer: https://missdream.org/wp-admin/admin.php?page=zencache
[Fri Dec 04 10:25:55 2015] [error] [client 108.162.216.91] #3 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(40): WebSharks\\ZenCache\\Pro\\Plugin->deleteFilesFromCacheDir('/^.+/i'), referer: https://missdream.org/wp-admin/admin.php?page=zencache
[Fri Dec 04 10:25:55 2015] [error] [client 108.162.216.91] #4 [internal function]: WebSharks\\ZenCache\\Pro\\AbsBaseAp->WebSharks\\ZenCache\\Pro\\{closure}('/^.+/i'), referer: https://missdream.org/wp-admin/admin.php?page=zencache
[Fri Dec 04 10:25:55 2015] [error] [client 108.162.216.91] #5 /home/mdadmin/mis in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php on line 148, referer: https://missdream.org/wp-admin/admin.php?page=zencache

This is for a site on my personal server, running PHP 5.6.16, WP core 4.3.1. It's appeared consistently since the most recent Pro release. This was also the first update to ZCP following the move to my cache directory to RAM as per the KB article on http://zencache.com/kb-article/how-to-use-ram-memory-for-your-cache-directory/ . Please let me know if you need any more information from my end. Thank you.

@jaswrks
Copy link

jaswrks commented Dec 5, 2015

@MarioKnight Thanks for this detailed report. I'm tagging this so that we can run some additional tests to see if there are any problems that we can work around in relation to a RAM disk and atomic cache writes.

@raamdev
Copy link
Contributor

raamdev commented Dec 5, 2015

@MarioKnight @jaswsinc This is almost certainly a dupe of #624.

@raamdev
Copy link
Contributor

raamdev commented Dec 5, 2015

@MarioKnight If possible, would you be able to try some of @jaswsinc's suggestions in #624 (comment) and see if that resolves the Error 500 issue? We've received several similar reports with PHP 5.6 but we haven't been able to pin down what's actually causing the issue, so anything you could do to help here would be hugely appreciated. 😄

@raamdev raamdev modified the milestones: Future Release (Pro), Next Release (Pro) Dec 5, 2015
@MarioKnight
Copy link
Author

It doesn't look like any of the suggestions in the linked comment helped. WP memory limit is already set to an absurdly high value (apparently I never lowered this back to a reasonable one pending various upload tests a year and a half or so ago, oops), and I don't appear to have opcache installed or configured on this server. I still put in the line to disable it just in case, however this did not change the behavior or error logs in apache.

@MarioKnight
Copy link
Author

Also, if this helps, here is the phpinfo() output for the site showing this behavior: https://missdream.org/phpinfo.php

@MarioKnight
Copy link
Author

I just installed opcache, checked the behavior which remained the same. I retried the suggestions however nothing changed in the browser or error logs.

@raamdev
Copy link
Contributor

raamdev commented Dec 9, 2015

@MarioKnight The error you're seeing consistently in your error logs is Unable to delete files. Rename failure, correct? Also, have you been able to connect the Error 500 in your browser with a corresponding Unable to delete files. Rename failure in your server logs? I'm just trying to figure out if we're dealing with more than one issue here...

@MarioKnight
Copy link
Author

Correct, the error log block in my initial post has remained consistent. That message block only occurs when I click the save changes button within the plugin options. I did have other errors in my logs, but I was able to address them separately, and watched the live logs following to confirm. I also updated WP core to 4.4 this morning, and there was no change in this behavior.

@raamdev
Copy link
Contributor

raamdev commented Dec 9, 2015

@MarioKnight Great. Thank you. In that case my feeling is that the issue you're experiencing is not related to the issue in #624 (which we suspect is related to a bug in Opcache), but rather more likely related to configuring your cache directory to use a RAM disk.

The next step that I would suggest for narrowing this issue down would be to temporarily switch back to using the regular disk for the cache directory and see if the issue persists.

@raamdev raamdev changed the title Generic 500 error when saving changes Generic 500 error + Rename failure when saving changes Dec 9, 2015
@MarioKnight
Copy link
Author

I unmounted the cache directory and the 500 error is gone! I will keep it unmounted for the time being, however if you have anything you'd like to test for this issue, I'll be happy to test.

@raamdev raamdev changed the title Generic 500 error + Rename failure when saving changes Cache directory as RAM disk + Generic 500 error + Rename failure when saving changes Dec 9, 2015
@raamdev raamdev removed this from the Next Release (Pro) milestone Dec 9, 2015
@raamdev raamdev changed the title Cache directory as RAM disk + Generic 500 error + Rename failure when saving changes Using RAM as cache directory + Generic 500 error + Rename failure when saving changes Dec 9, 2015
@raamdev
Copy link
Contributor

raamdev commented Dec 9, 2015

@MarioKnight Thank you! I've updated the title of this GitHub issue to reflect that his appears to be specific to using RAM as the cache directory.

@raamdev
Copy link
Contributor

raamdev commented Dec 16, 2015

@MarioKnight A new version of ZenCache was just released that includes many bug fixes and enhancements. You might want to give this release candidate a try to see if it addresses any of the issues you were having here. See http://zencache.com/zencache-pro-v151216-rc-release-candidate/

@MarioKnight
Copy link
Author

Thank you for the heads up on the RC posting. I've gone ahead installed the RC, and sadly it doesn't seem to address the issues in this and in #613 (or perhaps a different issue since the cron event was not actually removed from what I was able to tell, will make separate issue after this post). I re-mounted the cache directory to tmpfs, and the 500 error returned when saving changes. As from the error logs:

[Wed Dec 16 13:14:44 2015] [error] [client 162.158.127.151] PHP Warning:  rename(/home/mdadmin/missdream.org/wp-content/cache/zencache/cache,/home/mdadmin/missdream.org/wp-content/cache/zencache/cache-5671aa1416075594796234-tmp): Device or resource busy in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php on line 147, referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:14:44 2015] [error] [client 162.158.127.151] PHP Fatal error:  Uncaught exception 'Exception' with message 'Unable to delete files. Rename failure on directory: `/home/mdadmin/missdream.org/wp-content/cache/zencache/cache`.' in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php:148, referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:14:44 2015] [error] [client 162.158.127.151] Stack trace:, referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:14:44 2015] [error] [client 162.158.127.151] #0 [internal function]: WebSharks\\ZenCache\\Pro\\AbsBaseAp->WebSharks\\ZenCache\\Pro\\{closure}('/^.+/i'), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:14:44 2015] [error] [client 162.158.127.151] #1 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/classes/AbsBaseAp.php(55): call_user_func_array(Object(Closure), Array), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:14:44 2015] [error] [client 162.158.127.151] #2 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(40): WebSharks\\ZenCache\\Pro\\AbsBaseAp->__call('deleteFilesFrom...', Array), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:14:44 2015] [error] [client 162.158.127.151] #3 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(40): WebSharks\\ZenCache\\Pro\\Plugin->deleteFilesFromCacheDir('/^.+/i'), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:14:44 2015] [error] [client 162.158.127.151] #4 [internal function]: WebSharks\\ZenCache\\Pro\\AbsBaseAp->WebSharks\\ZenCache\\Pro\\{closure}('/^.+/i'), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:14:44 2015] [error] [client 162.158.127.151] #5 /home/mdadmin/mis in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php on line 148, referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1

[Wed Dec 16 13:14:52 2015] [error] [client 108.162.238.162] PHP Warning:  rename(/home/mdadmin/missdream.org/wp-content/cache/zencache/cache,/home/mdadmin/missdream.org/wp-content/cache/zencache/cache-5671aa1cdab17132317102-tmp): Device or resource busy in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php on line 147
[Wed Dec 16 13:14:52 2015] [error] [client 108.162.238.162] PHP Fatal error:  Uncaught exception 'Exception' with message 'Unable to delete files. Rename failure on directory: `/home/mdadmin/missdream.org/wp-content/cache/zencache/cache`.' in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php:148
[Wed Dec 16 13:14:52 2015] [error] [client 108.162.238.162] Stack trace:
[Wed Dec 16 13:14:52 2015] [error] [client 108.162.238.162] #0 [internal function]: WebSharks\\ZenCache\\Pro\\AbsBaseAp->WebSharks\\ZenCache\\Pro\\{closure}('/^.+/i', true)
[Wed Dec 16 13:14:52 2015] [error] [client 108.162.238.162] #1 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/classes/AbsBaseAp.php(55): call_user_func_array(Object(Closure), Array)
[Wed Dec 16 13:14:52 2015] [error] [client 108.162.238.162] #2 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(68): WebSharks\\ZenCache\\Pro\\AbsBaseAp->__call('deleteFilesFrom...', Array)
[Wed Dec 16 13:14:52 2015] [error] [client 108.162.238.162] #3 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(68): WebSharks\\ZenCache\\Pro\\Plugin->deleteFilesFromCacheDir('/^.+/i', true)
[Wed Dec 16 13:14:52 2015] [error] [client 108.162.238.162] #4 [internal function]: WebSharks\\ZenCache\\Pro\\AbsBaseAp->WebSharks\\ZenCache\\Pro\\{closure}('/^.+/i')
[Wed Dec 16 13:14:52 2015] [error] [client 108.162.238.162] #5 /home in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php on line 148

[Wed Dec 16 13:15:55 2015] [error] [client 162.158.127.151] PHP Warning:  rename(/home/mdadmin/missdream.org/wp-content/cache/zencache/cache,/home/mdadmin/missdream.org/wp-content/cache/zencache/cache-5671aa5bcaf35288385325-tmp): Device or resource busy in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php on line 147, referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:15:55 2015] [error] [client 162.158.127.151] PHP Fatal error:  Uncaught exception 'Exception' with message 'Unable to delete files. Rename failure on directory: `/home/mdadmin/missdream.org/wp-content/cache/zencache/cache`.' in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php:148, referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:15:55 2015] [error] [client 162.158.127.151] Stack trace:, referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:15:55 2015] [error] [client 162.158.127.151] #0 [internal function]: WebSharks\\ZenCache\\Pro\\AbsBaseAp->WebSharks\\ZenCache\\Pro\\{closure}('/^.+/i'), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:15:55 2015] [error] [client 162.158.127.151] #1 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/classes/AbsBaseAp.php(55): call_user_func_array(Object(Closure), Array), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:15:55 2015] [error] [client 162.158.127.151] #2 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(40): WebSharks\\ZenCache\\Pro\\AbsBaseAp->__call('deleteFilesFrom...', Array), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:15:55 2015] [error] [client 162.158.127.151] #3 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(40): WebSharks\\ZenCache\\Pro\\Plugin->deleteFilesFromCacheDir('/^.+/i'), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:15:55 2015] [error] [client 162.158.127.151] #4 [internal function]: WebSharks\\ZenCache\\Pro\\AbsBaseAp->WebSharks\\ZenCache\\Pro\\{closure}('/^.+/i'), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1
[Wed Dec 16 13:15:55 2015] [error] [client 162.158.127.151] #5 /home/mdadmin/mis in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php on line 148, referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1&zencache_wp_config_wp_cache_remove_failure=1

One thing I noticed that I hadn't before, was the mention of zencache_wp_config_wp_cache_remove_failure=1 in the stack traces. This should be expected as I had my wp-config.php file set to 400 and manually override any changes to it. To see if this made a difference, I set it to 600 to allow for editing to it. While the 500 is still present, the stack trace was slightly different:

[Wed Dec 16 13:26:22 2015] [error] [client 162.158.127.151] PHP Warning:  rename(/home/mdadmin/missdream.org/wp-content/cache/zencache/cache,/home/mdadmin/missdream.org/wp-content/cache/zencache/cache-5671acce58b22523715682-tmp): Device or resource busy in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php on line 147, referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1
[Wed Dec 16 13:26:22 2015] [error] [client 162.158.127.151] PHP Fatal error:  Uncaught exception 'Exception' with message 'Unable to delete files. Rename failure on directory: `/home/mdadmin/missdream.org/wp-content/cache/zencache/cache`.' in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php:148, referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1
[Wed Dec 16 13:26:22 2015] [error] [client 162.158.127.151] Stack trace:, referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1
[Wed Dec 16 13:26:22 2015] [error] [client 162.158.127.151] #0 [internal function]: WebSharks\\ZenCache\\Pro\\AbsBaseAp->WebSharks\\ZenCache\\Pro\\{closure}('/^.+/i'), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1
[Wed Dec 16 13:26:22 2015] [error] [client 162.158.127.151] #1 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/classes/AbsBaseAp.php(55): call_user_func_array(Object(Closure), Array), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1
[Wed Dec 16 13:26:22 2015] [error] [client 162.158.127.151] #2 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(40): WebSharks\\ZenCache\\Pro\\AbsBaseAp->__call('deleteFilesFrom...', Array), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1
[Wed Dec 16 13:26:22 2015] [error] [client 162.158.127.151] #3 /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(40): WebSharks\\ZenCache\\Pro\\Plugin->deleteFilesFromCacheDir('/^.+/i'), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1
[Wed Dec 16 13:26:22 2015] [error] [client 162.158.127.151] #4 [internal function]: WebSharks\\ZenCache\\Pro\\AbsBaseAp->WebSharks\\ZenCache\\Pro\\{closure}('/^.+/i'), referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1
[Wed Dec 16 13:26:22 2015] [error] [client 162.158.127.151] #5 /home/mdadmin/mis in /home/mdadmin/missdream.org/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php on line 148, referer: https://missdream.org/wp-admin/admin.php?page=zencache&zencache_updated=1

The first segments of the PHP warning and fatal error appear to have been unchanged. To make things more interesting (though I can understand the logic here), is when I disable ZC and hit save before un-mounting, there's no 500.

@raamdev
Copy link
Contributor

raamdev commented Dec 16, 2015

@MarioKnight Thank you for the update and the additional information. That will definitely help us when we take a closer look at this during the next development cycle. For now, I recommend not using the RAM disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants