Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
and the change was committed on Aug 11 (4 days ago)''
No, the cron jobs appear to be working correctly. The correct, updated file is in place:
drupal2 HEAD # grep Id /var/www/api.drupal.org/src/HEAD/includes/database.mysql.inc
// $Id: database.mysql.inc,v 1.78 2007/08/12 15:55:35 dries Exp $
drupal2 HEAD # grep -A7 'function db_result' /var/www/api.drupal.org/src/HEAD/includes/database.mysql.inc
function db_result($result) {
if ($result && mysql_num_rows($result) > 0) {
// The mysql_fetch_row function has an optional second parameter $row
// but that can't be used for compatibility with Oracle, DB2, etc.
$array = mysql_fetch_row($result);
return $array[0];
}
return FALSE;
And the cron.php job is running every half-hour (with no entries in either squid cache) with this output consistently:
Narayan spent some time looking into whether this was cron-related when following up to 172490. His response went only to the mailing list:
I looked into this a bit today because I thought it might be releated to
me moving the cvs up from drupal2 to drupal1. However, the parsing of
the files is being triggered from the updated mtimes (I looked in the
log to verify this and also touched one of the files to make sure that a
Parse was inserted into the watchdog tables). I also checked to make
sure that the permissions were correct to the file in question and that
also seems fine (and that shouldn't have changed since the api cron has
run on drupal2 for quite awhile now).
Basically I got nowhere :). Seems like it gets to api_parse_php_file,
and just doesn't find anything new...hell if I know why.
Oh and the really genius thing is that one run did work. At 070902
20:00:12 UTC comment_new_page_count was inserted into api_documentation.
So, that rules out cron.
Next, Squid might have been caching these pages. Here's the Squid cache entry:
So, the last-viewed time is the same as the last-updated time, with an expire time in 1970. Which means Squid goes back to the source (Apache) each page-view. Furthermore, I've verified by watching the Apache logs that each page-view hits Apache.
So, it must be within the webapp. Neil Drumm points out that it works for him when logged in (http://drupal.org/node/172490#comment-298784). Narayan confirmed that the correct data is being inserted into the DB by the API cron.php run, so somehow the webapp must be pulling wrong data from somewhere. Could it be that memcache is storing this data?
I don't think memcache is running on api.drupal.org. I did notice that nothing in API module clears the Drupal cache. I will add something for that and update this issue once the site is running that code.
It looks to me like cron is running fine, its just not completing. The watchdog tables for at least api and drupal.org show huge numbers of 'attempt to start cron while its still running' and 'cron has been running for six hours' statements, but no cron completes.
On the other hand, groups.drupal.org seems to be completing fine.
api and drupal.org should be updated now. I still have very little idea what is actually going on, but have found a couple interesting things.
A. cron_semaphore is not removed from the cache correctly when the cron php shutdown function is called. This prevents cron from running correctly the next time around and generally makes this whole thing quite difficult to debug. I don't know why this is happening, nothing looks obviously wrong with the code.
B. The cron is dieing in the update_index hook of the node module. It dies on the search_index function call. To make life better, while I was debugging this things suddenly started working. The drupal.org and api crons started completing. Unless someone else did something, I got no clue why this happened. I do have some extra watchdog lines in drupal.org's node update_index hook now so that maybe I can have some more information the next time this fails.
In case someone wants to see where cron died and how long it takes various modules to complete the cron hook, there is a patch in the queue about making cron more granular and informative.
Regardless of whether it goes in core or not, it can be a valuable troubleshooting aid.
Comments
Comment #1
killes@www.drop.org commentednot running for any domain in fact. Will be fixed tomorrow, I'll run some manually for now.
Comment #2
pwolanin commentedIs this still a problem for api.d.o?
this does not match what's in CVS: http://api.drupal.org/api/function/db_result/6
and the change was committed on Aug 11 (4 days ago)
Comment #3
emsearcy commentedNo, the cron jobs appear to be working correctly. The correct, updated file is in place:
And the cron.php job is running every half-hour (with no entries in either squid cache) with this output consistently:
Removing ...<br />Removing ...<br />Removing ...<br />Comment #4
pwolanin commentedWell something is broken (either cron or the API module) since the wrong code is still showing:
http://api.drupal.org/api/function/db_result/6
Comment #5
emsearcy commentedTrying to resolve, see http://drupal.org/node/163972 and http://drupal.org/node/172490 for more comments.
Narayan spent some time looking into whether this was cron-related when following up to 172490. His response went only to the mailing list:
So, that rules out cron.
Next, Squid might have been caching these pages. Here's the Squid cache entry:
So, the last-viewed time is the same as the last-updated time, with an expire time in 1970. Which means Squid goes back to the source (Apache) each page-view. Furthermore, I've verified by watching the Apache logs that each page-view hits Apache.
So, it must be within the webapp. Neil Drumm points out that it works for him when logged in (http://drupal.org/node/172490#comment-298784). Narayan confirmed that the correct data is being inserted into the DB by the API cron.php run, so somehow the webapp must be pulling wrong data from somewhere. Could it be that memcache is storing this data?
Comment #6
drummI don't think memcache is running on api.drupal.org. I did notice that nothing in API module clears the Drupal cache. I will add something for that and update this issue once the site is running that code.
Comment #7
pwolanin commentedAs another example, changes I committed to the developer docs 15 hours ago still do not show right now.
http://cvs.drupal.org/viewvc.py/drupal/contributions/docs/developer/hook...
Comment #8
nnewton commentedIt looks to me like cron is running fine, its just not completing. The watchdog tables for at least api and drupal.org show huge numbers of 'attempt to start cron while its still running' and 'cron has been running for six hours' statements, but no cron completes.
On the other hand, groups.drupal.org seems to be completing fine.
Comment #9
nnewton commentedapi and drupal.org should be updated now. I still have very little idea what is actually going on, but have found a couple interesting things.
A. cron_semaphore is not removed from the cache correctly when the cron php shutdown function is called. This prevents cron from running correctly the next time around and generally makes this whole thing quite difficult to debug. I don't know why this is happening, nothing looks obviously wrong with the code.
B. The cron is dieing in the update_index hook of the node module. It dies on the search_index function call. To make life better, while I was debugging this things suddenly started working. The drupal.org and api crons started completing. Unless someone else did something, I got no clue why this happened. I do have some extra watchdog lines in drupal.org's node update_index hook now so that maybe I can have some more information the next time this fails.
Comment #10
kbahey commentedIn case someone wants to see where cron died and how long it takes various modules to complete the cron hook, there is a patch in the queue about making cron more granular and informative.
Regardless of whether it goes in core or not, it can be a valuable troubleshooting aid.
Comment #11
gerhard killesreiter commentedComment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.