-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush #214
Comments
There is @, so it should not produce rror. |
Sorry for the delay in replying - I was on vacation last week. It doesn't produce the error with the @, but the problem is that it still results in a blank page being returned. I can fix it by replacing:
with
here: https://github.com/nette/tracy/blob/master/src/Tracy/Debugger.php#L430 I am not sure if that is the correct/appropriate solution, but it is the only way I can seem to prevent a blank screen from being returned in certain situations. Is there any other info I can provide? |
Can you describe in which situations is returned blank screen? Because setting output_buffering = 0 is fine. |
Ok, I have tracked it down (I think), although it may be a little tricky for you to replicate. The problem only occurs when I manually call Does that give you enough insight to work from? If not, let me know and I'll set up a site so you can test. Thanks! |
@dg - would you consider adding:
just before this line: Line 149 in 577c63b
This is in line with what is suggested here: http://php.net/manual/en/function.ob-get-level.php#109001 It seems to fix everything at my end. Can you see any possible side-effects? |
Simply, I don't understand where is problem, so I am unable to solve it. |
Good point! OK, I'll try to explain in more detail. It all relates back to this issue: #185 In my last comment you'll see that I am now calling Maybe manually calling I do know that if I add 1 to the value of |
shutdownHandler() should flush all buffers created after Tracy is enabled. So *) before |
I am getting: before enable: 0 |
It seems ok. Can you dump |
|
So after This should not produce At the same time, it should not result in a blank page, because it is flushed. So I'm stuck :-) For what purpose do you use the buffer? Page cache? You can try to render Bar this way instead of calling shutdownHandler: Debugger::getBar()->render();
Debugger::$showBar = FALSE; |
I believe the issue is starting here: https://github.com/processwire/processwire/blob/50f2834a0ae2a9f9f2ac53439184ebdc04db2f54/wire/core/admin.php#L89 Removing that ob_start() does fix things, but it also seems like your solution of:
instead of calling the shutdown handler also works, so thank you very much for that! Just an FYI - as I think I mentioned in that other issue, all of this is only problem when using that SessionHandlerDB module: https://github.com/processwire/processwire/blob/50f2834a0ae2a9f9f2ac53439184ebdc04db2f54/wire/modules/Session/SessionHandlerDB/SessionHandlerDB.module |
Sorry to bring this up again @dg - maybe I should have started a new issue, but since it only seems to affect me, I thought it better to add here. I just noticed that even though:
gets the AJAX bar working, it doesn't get the Redirect working. Again this is only an issue with that SessionHandlerDB module. It might be good to note that I am having to add:
before those two lines, otherwise php header redirects don't work at all unless php.ini has output_buffering on by default. Any thoughts on what might be preventing the Redirect bar from working? Here is what a dump of $_SESSION['_tracy'] looks like: These are on exactly the same page after the same redirect. I don't know why the redirect index is NULL and the bar index has three items. I don't want to take up anymore of your time on this, but if you have any quick ideas of why it might be happening, that would be greatly appreciated. Thanks! |
I get this error when PHP's output_buffering is set to 0, which seems to be quite common on shared hosts.
I think it is likely related to this: http://php.net/manual/en/function.ob-get-level.php#109001 and the fact that
ob_get_level
returns one at the beginning of the script.The error comes from this line: https://github.com/nette/tracy/blob/master/src/Tracy/Debugger.php#L436
Let me know if you have any trouble reproducing - it may only be occurring because I am manually calling
Debugger::shutdownHandler()
from another script.The text was updated successfully, but these errors were encountered: