Jump to content
  • 0

Cron ob_flush(): failed to flush buffer


Question

Posted

While it shouldn't be impacting anything, it's the only error I can associate with "provision paid services" cron hanging a few times a day.  By hanging I mean Blesta thinks it's running and it's indeed not, so I assume it died before updating log_cron.end_date.

[2017-09-15 14:55:01] general.NOTICE: E_NOTICE: ob_flush(): failed to flush buffer. No buffer to flush {"code":8,"message":"ob_flush(): failed to flush buffer. No buffer to flush","file":"/path/to/blesta/app/controllers/cron.php","line":
3260}

Any ideas if this could be causing odd stuff or the cron to die?

12 answers to this question

Recommended Posts

  • 0
Posted

maybe the addservice() function in your module has a error or issue that lead to this . i assume when you activate the service from admin side is not returning any error, this happen only in the CLI cron .

to diagnost the issue, order a service, then stop the cron from running, and run the cron manually from command CLI, don't forget to enable error reporting, then you will get a error listed that lead to this issue .

we has this in the past and we have identifying it by this step, finally we have created a plugin called "Cron Debugger" that we use it to simulate the cron run to identify any issue in the cron, the plugin will be released soon after we make some tweak as it still in beta, but it work :)

 

  • 0
Posted

The error handler doesn't stop php execution over notices so the cron wouldn't fail to complete if no output buffer exists to flush. There's something else going on that's causing the cron to hang (e.g. waiting for a callback from a module request). Does the cron complete adding all of its services every time?

  • 0
Posted
  On 10/16/2017 at 12:57 AM, Blesta Addons said:

in cron file , i don't see any initialization of output buffering , so i have added @ob_start(); on top of  @ob_flush(); and i will watch what is happen.

Expand  

the solution has worked,

        if ($echo) {
            @ob_start();
            echo $new . ($this->is_cli ? "\n" : '<br />');			
            @ob_flush();
            @flush();
            @ob_end_flush();
        }

 

  • 0
Posted
  On 10/16/2017 at 9:56 AM, Blesta Addons said:

the solution has worked,

        if ($echo) {
            @ob_start();
            echo $new . ($this->is_cli ? "\n" : '<br />');			
            @ob_flush();
            @flush();
            @ob_end_flush();
        }

 

Expand  

I tried this not sure if it's related but only thing that has changed, a clients invoice for 11.99 magically replicated 47 times to 560$ could thus be related or should I start looking elsewhere

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...