By Martin Lines on Monday, 04 April 2016
Posted in General
Likes 0
Views 11.6K
Votes 0
I have an easyblog cron job that fails when run automatically.

When it is run manually from a command line it fails with a "500- Server error" the first time it is run, but succeeds the second time.

The Apache log looks like this

139.162.200.22 - - [04/Apr/2016:13:54:02 +0000] "GET /index.php?option=com_easyblog&task=cron HTTP/1.1" 500 276 "-" "Wget/1.16 (linux-gnu)"
139.162.200.22 - - [04/Apr/2016:13:55:01 +0000] "GET /index.php?option=com_easyblog&task=cron HTTP/1.1" 500 276 "-" "Wget/1.16 (linux-gnu)"
139.162.200.22 - - [04/Apr/2016:13:55:01 +0000] "GET /index.php?option=com_easyblog&task=cron HTTP/1.1" 200 979 "-" "Wget/1.16 (linux-gnu)"
139.162.200.22 - - [04/Apr/2016:13:55:01 +0000] "GET /index.php?option=com_easyblog&task=cron HTTP/1.1" 200 979 "-" "Wget/1.16 (linux-gnu)"
139.162.200.22 - - [04/Apr/2016:13:55:51 +0000] "GET /index.php?option=com_easyblog&task=cron HTTP/1.1" 500 276 "-" "Wget/1.16 (linux-gnu)"
139.162.200.22 - - [04/Apr/2016:13:56:40 +0000] "GET /index.php?option=com_easyblog&task=cron HTTP/1.1" 200 979 "-" "Wget/1.16 (linux-gnu)"
139.162.200.22 - - [04/Apr/2016:13:57:35 +0000] "GET /index.php?option=com_easyblog&task=cron HTTP/1.1" 500 276 "-" "Wget/1.16 (linux-gnu)"


A time or timer seems to be associated in some way. It is successful on the second attempt providing this occurs less than a minute after the last failed attempt?
Yes it has cured the cron issue as well. I assume that the first time the cron job runs that it tries the mail function and fails. If it then retries within the timer for email it runs ok as email is not checked until the timer expires. This would explain why it would work sometimes and not others.
·
Wednesday, 06 April 2016 18:51
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Martin,

You should actually try to turn on error reporting and see if there are any errors generated. With just a blank 500 error, it really doesn't tell us anything

There could be instances where it could be cause by a system plugin on the site but without any errors generated, it's like finding a needle in a haystack.
·
Monday, 04 April 2016 23:45
·
0 Likes
·
0 Votes
·
0 Comments
·
I can also see


[Tue Apr 05 15:45:02.011088 2016] [:error] [pid 22324] [client 139.162.200.22:37218] PHP Fatal error: Call to undefined function imap_num_msg() in /var/www/http://www.bigjimny.com/public_html/administrator/components/com_easyblog/includes/mailbox/adapters/lib.php on line 251

which appears sometimes when I get the 500 error.

Martin
·
Tuesday, 05 April 2016 23:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Martin,

[Tue Apr 05 15:45:02.011088 2016] [:error] [pid 22324] [client 139.162.200.22:37218] PHP Fatal error: Call to undefined function imap_num_msg() in /var/www/http://www.bigjimny.com/public_html/administrator/components/com_easyblog/includes/mailbox/adapters/lib.php on line 251


Based on this error message, I believe your php server do not have install/enable this php function imap, try consult with your webhosting provider regarding this and enable this `extension=php_imap.dll` from your php server.

And see is it solve your cron issue or not, if the issue still persists, can you provide us with your Joomla backend and Cpanel access so we can better have a look?
·
Wednesday, 06 April 2016 11:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks, this has cured it.

The underlying server system was migrated earlier this year from Debian Wheezy to Debian Jessie and php5-imap was not in standard distribution
·
Wednesday, 06 April 2016 17:23
·
0 Likes
·
0 Votes
·
0 Comments
·
You're welcome.

May i know your cron is it working now?

If no, is it can provide us with your Cpanel and Joomla backend access so we can better have a look?
·
Wednesday, 06 April 2016 17:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

You are most welcome. Glad to hear that your issue has been resolved now.

As a gentle reminder, kindly start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiry. I will lock and mark this thread as resolved.
·
Wednesday, 06 April 2016 18:59
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post