During cron runs the Twitter account are refreshed, but if an error occurs during this process an exception is thrown which is not caught. This will prevent other important cron tasks from running.
Some examples of errors I've seen occurring during cron:
- Connection timed out
- request timed out
- Internal Server Error
- Service Temporarily Unavailable
- Service Unavailable
WD twitter: exception 'TwitterException' with message 'Connection timed out' in sites/all/modules/contrib/twitter/twitter.lib.php:284
Stack trace:
#0 sites/all/modules/contrib/twitter/twitter.lib.php(227): Twitter->request('http://api.twit...', Array, 'GET')
#1 sites/all/modules/contrib/twitter/twitter.lib.php(112): Twitter->call('statuses/user_t...', Array, 'GET', '0')
#2 sites/all/modules/contrib/twitter/twitter.lib.php(160): Twitter->get_statuses('statuses/user_t...', Array, '0')
#3 sites/all/modules/contrib/twitter/twitter.inc(125): Twitter->user_timeline('1410601', Array, '0')
#4 sites/all/modules/contrib/twitter/twitter.module(143): twitter_fetch_user_timeline('1410601')
#5 [internal function]: twitter_cron()| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1567042-1-twitter-cron_exception.patch | 978 bytes | pfrenssen |
Comments
Comment #1
pfrenssenComment #2
juampynr commentedCommitted. Thanks.
http://drupalcode.org/project/twitter.git/commitdiff/f4a03bb6fb9132fbfc6...
See if you can make and test a patch for branch 6.x-3.x
Comment #3
pfrenssenHmm somehow I encountered this problem again, I have received the following uncaught exception, even with the patch from #1 applied.
Comment #4
pfrenssenOk it seems that I am mistaken about the entire issue. The exceptions were already caught successfully in Twitter::call():
I am running cron from the CLI, and this causes a stack trace to be output to STDERR whenever exceptions occur, regardless of whether the exception is caught or not. I was mistaking these stack traces as fatal errors. Reading back the word "uncaught" is not even present in the error message, I have somehow overlooked this all the time.
Actually it transpires that the problem only existed in my head and my patch was not needed at all. It can best be reverted, it does not do any harm but is unneeded as the exceptions are already handled.
Comment #5
juampynr commentedNo probs. Reverted.
http://drupalcode.org/project/twitter.git/commitdiff/cef3fb3f3c22d8ae88d...
Comment #6.0
(not verified) commentedAdded example exception backtrace to help people searching for this error