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
Random Blank Page #438
Comments
@cnxsoft Thank you for the report!I assume the cache files for the "blank pages" include the ZenCache HTML Notes at the bottom, correct? This bug was originally related to Quick Cache generating a cache file for a non-2xx or non-404 status code. However, that bug was fixed by only allowing @jaswsinc Maybe we should add to the HTML Notes for the cache file the HTTP Status code that's being cached, that way we can see if there's something odd about the blank pages that are getting cached. Thoughts? |
@raamdev I forgot to check that. Since my script is running, I don't always have files without body to check. But I don't check in the browser, only directly in zencache directly, so I'm sure it's a cache file generated by Zencache. In Quick Cache, I saved one file with the issue, and after "fixing" the issue. |
@cnxsoft Do you have debugging notes enabled in If you enable debugging notes and update your cleanup script to move the bad cache files somewhere outside the cache directory (instead of deleting them), then we can save those bad cache files for later inspection. To help us figure out if this issue is related to an odd HTTP Status Code, can you please modify your copy of ZenCache as follows: If you're using ZenCache (Lite)Replace lines 948 and 949 inside $cache .= "\n".'<!-- '.htmlspecialchars(sprintf(__('%1$s file built for (%2$s) in %3$s seconds, on: %4$s (HTTP Status Code: %5$d).', $this->text_domain),
$this->name, $this->is_404 ? '404 [error document]' : $this->salt_location, $total_time, date('M jS, Y @ g:i a T'), $this->http_status())).' -->'; If you're using ZenCache ProReplace lines 1326 and 1327 inside $cache .= "\n".'<!-- '.htmlspecialchars(sprintf(__('%1$s file built for (%2$s%3$s) in %4$s seconds, on: %5$s (HTTP Status Code: %6$d).', $this->text_domain),
$this->name, $this->is_404 ? '404 [error document]' : $this->salt_location, (($this->user_token) ? '; '.sprintf(__('user token: %1$s', $this->text_domain), $this->user_token) : ''), $total_time, date('M jS, Y @ g:i a T'), $this->http_status())).' -->'; IMPORTANT NOTEIf you click the "Restore" button inside ZenCache or if you upgrade ZenCache, these changes will get overwritten. Those changes will tell ZenCache to report the HTTP Status code that generated the cache file: <!-- ZenCache file built for (http://zcpro.dev/) in 0.22450 seconds, on: Mar 12th, 2015 @ 3:12 am UTC (HTTP Status Code: 200). --> (Notice the extra The next time ZenCache generates a "blank" cache file, we can check the cache file to see what HTTP Status Code generated the blank page. Note that you are currently deleting these blank cache files with the script you mentioned above, so you'll need to first modify that to move the cache files instead of deleting them so that we can inspect them later. |
So I've manage to get a cached file from Zencache for the same page:
HTML notes are enabled, and they work, as the second file ends with:
I'll add the status code, but I don't think it will show in the cached file. |
Sounds like a good idea to me.
@raamdev So it is quite literally lacking a Having a locked output buffer would prevent this sort of issue, but it would also result in other problems. We discussed this before in #97 Instead of using a locked output buffer, we decided to use a shutdown flag. See: https://github.com/websharks/zencache/blob/000000-dev/zencache/includes/advanced-cache.tpl.php#L867 @cnxsoft Would it be possible for you to provide us with a list of the other plugins and the theme that you're running? I'd like to see if we can find the conflict that I mentioned above. |
@cnxsoft That would further confirm @jaswsinc's theory that this is the result of an output buffer conflict. If you're not even seeing the HTML Notes in the cache file missing the |
@jaswsinc Installed plugins (activate have a ) |
@cnxsoft Thank you. What does the |
I see by your comment that it indicates they are active. Looks like it got cut off, but I get it now. Thanks. |
@cnxsoft (cc @raamdev) Of these plugins, the only one that I found the potential for an output buffer conflict in is If it does, then we could go from there and work to resolve the conflict. TODO: Take a closer look at this plugin: https://wordpress.org/plugins/backwpup/ |
Referencing: https://cloudup.com/c2TMnh6QP_M |
BackWPUp is not the culprit. I've deactivated, and new "no body" cache file are still generated. I've done a grep in my plugins directory: Could Yet-another-related-posts-plugin also conflict with Zencache, although the function does not appear to be called within a while loop? |
@cnxsoft writes...
Possible, but I'd say it is unlikely; i.e., from what I reviewed of this codebase it seems to be using I did not review @cnxsoft writes...
Are you keeping a log of all PHP-related errors on your server? If so, have you seen any errors in your log file recently? These could shed light. Checking Apache error logs for anything related to PHP could help also. Keep in mind that we are still operating on a best-guess here. I am guessing that this is related to output buffers, but an empty PHP error logs, or debugging this by stripping the site down to a bare minimum might help. If you have a test installation of WordPress where you can start fresh and then add one or two of these plugins at a time until you find a clue as what might be causing this could help. |
@jaswsinc Correct, WPTouch is installed, but not active. The few last lines of my php5-fpm.log (I'm using nginx + php5-fpm. I believe this issues does not occur with apache2): [15-Mar-2015 01:46:56] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 11 total children The "slow cron job" is probably because of the script I use to go through thousands of cached files and delete the ones without body. |
Thank you :-) So it appears that you have request-slowlog-timeout set to a pretty low number. I'm seeing log entries for several processes that are being backtraced by PHP5-FPM after just 10-12 seconds. It could be PHP5-FPM Given the number of |
@cnxsoft Just checking in here to see if you had a chance to try increasing |
@raamdev. Sorry I forget to update. I increased max_execution_time to 30, and even disabled it (set to 0), but the blank pages are still generated. |
@cnxsoft Are you able to test/reproduce this in a clean WordPress environment on your server, i.e., without any other plugins installed? The most likely cause for this issue is a plugin conflict, possibly even a conflict created by the combination of two or more plugins resulting in a conflict with ZenCache. That makes it very difficult to troubleshoot. If you're able to reproduce this in a clean WordPress environment, that would indicate an issue with ZenCache and your server environment, in which case we could start running extensive tests using various server environments similar to your own. However, until we can prove that it's not a WordPress plugin/theme conflict, it doesn't make sense to go that route. |
@raamdev. I guess testing a clean installation, and trying plugins one by one is the next step. It may take a while before I find/make time for this though. |
@cnxsoft No problem. Please let us know when you get around to testing this--if you find there's an issue related to your server configuration and not to your WordPress plugins/theme, we'll gladly take another look at this. If you don't mind, I will go ahead and close this GitHub Issue and when you come back to update here, I will reopen it if there's something for us to research further. |
I've just upgraded from Quick Cache to Zencache, and noticed the random blank pages bug as referenced @ https://wordpress.org/support/topic/random-blank-pages-2 still exists.
The page are not completely blank, as the "head" is there, but "body" is completely missing. It's probably only happening with nginx, and not apache. It may be hard to reproduce. I have thousand cached page, but only a dozen or so have the problem at any given time.
I've updated my work around script for Zencache: http://pastebin.com/KfMfEDaf, which I run every five minutes as a cron job to delete cached files without body.
The text was updated successfully, but these errors were encountered: