Jump to content
  • 0

Cron Job not working because of memory limit even


afunworm

Question

Hi, all.

I have been using Blesta for a year+ now but the cron never works. Sometimes it does, sometimes it doesn't, and every once in a while I log into the admin dashboard, it feels like a gamble.

So today I took the cron command and run it under the command line. Immediately, I receive the following message:

Attempting to run all tasks for Company Name.
Attempting to deliver invoices scheduled for delivery.
<!DOCTYPE html>
<html lang="en" xml:lang="en">
    <head>
        <meta charset="utf-8">
        <title>Blesta</title>
        <link rel="stylesheet" href="/app/views/errors/css/application.min.css">
        <link rel="stylesheet" href="/app/views/errors/css/font-awesome.min.css">
    </head>
    <body>
        <div class="error-container">
            <div class="program-error">
    <div class="panel panel-default panel-simple">
        <div class="panel-heading">
            <h3><i class="fa fa-exclamation-circle"></i> Something went wrong.</h3>
        </div>
        <div class="panel-body">
            <p>
                Allowed memory size of 33554432 bytes exhausted (tried to allocate 3145728 bytes)            </p>
        </div>
    </div>
</div>        </div>
    </body>
</html>

I checked my PHP for memory limit and the limit when I run phpinfo() is 1024MB! That should easily be enough for Blesta, shouldn't it? I own a VPS so there is no sharing of memory with other accounts. I have cPanel and WHM installed on my server.

Is there any way to check what the problem is? The cron job doesn't work and it renders Blesta useless for quite a while now.

The cronjob looks like this:

/opt/cpanel/ea-php56/root/usr/bin/php -q /home/username/public_html/index.php cron

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

The error states that the memory size of 33554432 bytes was exceeded, and that's only 32 MB. You may want to double-check your php.ini file for both web and CLI since the system does not appear to have the 1024 MB limit you said it should have. While 32 MB may work for some, the Blesta requirements recommend at least 128 MB.

The invoice delivery cron task is failing in your example, which means it is probably using more than 32 MB of memory to generate the invoice PDFs and send them via email.

You can try running the following to see the memory limit at run-time in CLI:

php -r "echo ini_get('memory_limit') . PHP_EOL;"

 

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