Drupal 6 White Screen of Death on Top Level Landing Page

I have a number of Drupal sites on the Internet; more than I can possibly check on a daily basis, what with work commitments and all. I pointed my web browser at one of the more infrequently visited sites the other day and was confronted with the White Screen of Death. Disaster! What on Earth can cause that? And how long had the site been down? A quick check of the log gave no evidence of anything amiss, and the integrity of the database looked ok with a cursory glance.

Nothing else for it but to start analysing the Drupal landing page of index.php. I did the usual developers' trick of a binary chop through the code, outputting the word 'Here' to the screen. In fact, I was able to output to the screen all the way down the code so the system wasn't crashing per se - which of course is backed up by the fact there were no error messages in the log.

The Drupal front controller looks like:

require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

$return = menu_execute_active_handler();
// Menu status constants are integers; page content is a string.
if (is_int($return)) {
  switch ($return) {
    case MENU_NOT_FOUND:
      drupal_not_found();
      break;
    case MENU_ACCESS_DENIED:
      drupal_access_denied();
      break;
    case MENU_SITE_OFFLINE:
      drupal_site_offline();
      break;
  }
}
elseif (isset($return)) {
  // Print any value (including an empty string) except NULL or undefined:
  print theme('page', $return);
}

drupal_page_footer();

It became clear to me that menu_execute_active_handler() was returning with NULL so the subsequent call using theme didn't have anything to do.

menu_execute_active_handler() executes the page callback associated with the current path, but in my situation it was returning nothing. With a blinding flash of inspiration, I decided that perhaps the cache had been corrupted. So using phpMyAdmin I deleted all the entries in the cache table. After clicking on refresh, low and behold, my site was back! Big smile

But why? The only plausible explanation I have come up with so far is my hosting company moved my domain and perhaps during the moving process something got broken. Not particularly satisfactory, but the best possible candidate so far.