Jump to content
  • 0

Cron ob_flush(): failed to flush buffer


Jonathan

Question

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?

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

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 :)

 

Link to comment
Share on other sites

  • 0

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?

Link to comment
Share on other sites

  • 0
8 hours ago, 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.

the solution has worked,

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

 

Link to comment
Share on other sites

  • 0
11 hours ago, Blesta Addons said:

the solution has worked,


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

 

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...