Cron Error

Hi Guys,

Anyone here faced issue like the image below?

this my cron batch file:

cd xampp\htdocs\sugarpath\
E:\xampp\php\php-cgi.exe -c E:\xampp\php\php.ini -f cron.php

and output like below image, and the scheduled mail not sending automatically (it’s worked if I clicked the Send queue mail button)

Thanks,
Zee

Hi Zee,

This seems to be an issue we’ve inheritied from Sugar. Because you’re calling cron using the php-cgi this is breaking a check in cron.php.

What value do you get if you add

echo $sapi_type;

after the line:

$sapi_type = php_sapi_name();

in cron.php?

Thanks,
Jim

Hi Jim,

Thanks for the respond, after I added the code i get the error (attached image 1)

and if i put the code on batch file:

cd xampp\htdocs\crm
E:\xampp\php\php.exe -f cron.php

getting error (attached image 2)

Hi Zee,

I’d recommend using your second batch file to run the cron jobs.

The notices that you get in image 2 can be ignored. The “Fatal Error” is caused by imap not being enabled.

You can enable imap in ‘xampp\php\php.ini’ by removing the semicolon at the start of:

extension=php_imap.dll

(alternatively if you don’t use the inbound email functionality you can disable the inbound email jobs in the scheduler page).

Thanks,
Jim

Hi Jim,

Sorry to annoying, I changed the batch file to the second one, and still get error like image attached below. Really need your help :frowning:

Regards,
Zee

What is that mean of AOW Workflow error?

Hi Zee,

Not at all, I’m glad to help.

That last error is pretty strange. Looks like in your config file there’s a function that’s already been declared. Adding a function to config.php is not something that Sugar or Suite would have done. Since this is likely a customisation I can’t really advise on what steps to take since this may affect the customisations you have. One thing to try would be to find the function in config.php and comment it out (or find out if any files are being included).

Please remember that anytime you make changes you should ensure that you have a backup of the system.

Thanks,
Jim

Hi Zee,

The AOW_Workflow messages are notices, not errors. These are more like warnings that PHP emits.

the workflow notice just means that part of workflow does something like:

$arr['module'];

Where ‘module’ is not a key in ‘$arr’. While it is our goal to reduce notices these are usually harmless and can be ignored. In a live site you would usually turn error_reporting off in the php.ini so that users do not see these. Since cron is run from the command line however the error settings may be different and you’ll see the notices.

Thanks,
Jim

Hi Jim,

So, no need to worry about that AOW Workflow notices? or is that mean the cron will worked properly.

the error on config file is solved after xampp restarted…

Regards,
Zee

Hi Zee,

Correct. You don’t need to worry about notices. However “Fatal errors” should definitely not happen. If you see these then this is a problem.

Thanks,
Jim

1 Like

Hi Jim,

Thanks for this :slight_smile:

Regards,
Zee