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
7 minutes ago, Blesta Addons said:

after  using the monolog viewer plugin , i see a lot of this error in the log, is pumping the  NOTICE file size . any temporary fix to prevent this false/positive notice ?

 

I also see this in the monolog viewer every cron run

  • 0
Posted
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();
        }

 

  • 0
Posted
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

  • 0
Posted
1 minute ago, gosuhost said:

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

i can't believe it related

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...