Why is "drush cc all" failing with "undefined function user_load()" After updating my Drupal test server to have a fresh copy of the database and code from the production system, "drush cc all" would fail with a message saying 


  PHP Fatal error:  Call to undefined function user_load() in /usr/share/pear/drush/includes/drupal.inc on line 138


I'm running drush version 6.2.0 with a drupal 7.25 system. I'm using memcache as cache_default_class.
The problem went away after I restarted memcached.

I discovered that by running drush with -d and seeing a PHP error about a $theme value not being a valid index. Tracing the code showed that access to cache_bootstrap was getting empty arrays for the module and theme data.

From now on I plan to restart memcached or flush its cache on my test server after rebuilding its database. (I've done this kind of rebuilding dozens of times before with no issues.)