This question pertains to a Drupal 7 multi-site install. As a test for some future backup/migrate bash scripting that I am doing for work, I made a backup/dump of my test site postgres DB. I then dropped the DB and recreated it with the same (old) name. I then restored the DB from my backup. I did not touch any files. I thought everything had worked out well, except I have an error that I cannot figure out:

Call to undefined function user_access() in .../includes/menu.inc on line 634.

Things I've tried:

  • As a sanity check, I made sure that User module was in my core files and that user_access was defined in user.module
  • Checked out the restored database in pgAdmin, made sure that user 0 (anonymous user) was still there
  • Truncated any table starting with '_cache':

    Truncate table prefix_cache;
    Truncate table prefix_cache_block;
    Truncate table prefix_cache_bootstrap;
    Truncate table prefix_sessions;  
    Truncate table prefix_cache_field;
    Truncate table prefix_cache_filter;
    Truncate table prefix_cache_form;
    Truncate table prefix_cache_image;
    Truncate table prefix_cache_menu;
    Truncate table prefix_cache_page;
    Truncate table prefix_cache_path;
  • Checked the system table and disabled, checked and re-enabled various modules including user module via the 'status integer' value/col. (I'm not sure if this is the way to enable and re-enable modules in the DB).

  • Tried to install Drush on my server but file permissions are very restrictive. It seems that Drush has limited abilities. Drush can only clear its own cache even after I setup an alias for the site in question.
  • Created a 'modules' directory inside of the site's multi-site directory and copied the user module out of core and put it there.
  • Tried the export using utf8 as the encoding of the DB and re-importing (no change in error)

1 Answer 1


Here are few tips:

  • make sure your Drupal core has all the files in the right place (especially user module),
  • upgrade your Drupal core to the latest version (drush fr && drush up drupal)
  • clear all your caches (drush -y cc all), including your memcached (killall memcached),
  • rebuild your registry by using Registry Rebuild,
  • if you're using modules which are implementing drupal_bootstrap() (such as Secure Site), disable them,
  • try disabling your PHP cache engines (such as XCache, Zend optimizer) to see if that's the problem,
  • use XDebug and generate a trace file to analyse the code execution,
  • or use IDE debugger, breakpoint on the failing line and check why the function doesn't exist,
  • test it on different environment/machine,
  • eventually restore your database from the point where it was working before.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.