drush cc
Enter a number to choose which cache to clear.
[0] : Cancel
[1] : drush
[2] : registry

2
PHP Fatal error: Call to undefined function lock_acquire() in includes/bootstrap.inc on line 3106

Fatal error: Call to undefined function lock_acquire() in includes/bootstrap.inc on line 3106
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Call to undefined function lock_acquire() in
includes/bootstrap.inc, line 3106

Comments

SocialNicheGuru’s picture

If I run drush rr, then I get this:

drush rr
The drush command 'rr' could not be found. Run `drush cache-clear drush` to [error]
clear the commandfile cache if you have installed new extensions.
Could not find a Drupal settings.php file at ./sites/default/settings.php.

rfay’s picture

Category: bug » support

Well, if drush rr isn't recognized, then you don't have a bug in this tool. Your problem is that you either haven't installed it right (see the project page) or you need to clear *drush's cache*, which it offerec to you.

Rebuilding the registry cache with drush cc registry would not be expected to work if drush rr is needed.

Not that you may actually have a code problem.

And it looks like you're trying to run this when not in a drupal install (it can't find the settings.php).

seanr’s picture

Category: support » bug

I just got the original error, and yes, I was in a Drupal install:

user@server:/www/example.com/htdocs$ drush rr

Fatal error: Call to undefined function lock_acquire() in /var/www/vhosts/example.com/htdocs/includes/bootstrap.inc on line 3106
Drush command terminated abnormally due to an unrecoverable error.                                                               [error]
Error: Call to undefined function lock_acquire() in /var/www/vhosts/example.com/htdocs/includes/bootstrap.inc, line 3106

(anonymized user, server, and domain, of course)

Kristen Pol’s picture

Hmmm... I'm getting the error too:

[dell:kristen:modules]$ drush rr
PHP Fatal error:  Call to undefined function lock_acquire() in /var/www/xxx/docroot/drupal/includes/bootstrap.inc on line 3121
Drush command terminated abnormally due to an unrecoverable error.            [error]
Error: Call to undefined function lock_acquire() in
/var/www/xxx/docroot/drupal/includes/bootstrap.inc, line 3121
rfay’s picture

Status: Active » Closed (duplicate)

This is a duplicate of #1565138: Need to include lock.inc with Drupal 7.14 (maybe 7.13 too). It's been fixed in dev for some time. I guess I should make a release.

rfay’s picture

I did release 7.x-1.9. However, I see that #1565138: Need to include lock.inc with Drupal 7.14 (maybe 7.13 too) was there in 7.x-1.8. Are you both sure you had 7.x-1.8? If so, please follow up over there and reopen that.

chriscalip’s picture

Issue summary: View changes

Error sighted on latest version of drupal and registry_rebuild. For anyone needing to keep forward with this error.
Simply update registry_rebuild.php

FROM :

$includes = array(
  $include_dir . '/bootstrap.inc',
  $include_dir . '/common.inc',
  $include_dir . '/database.inc',
  $include_dir . '/schema.inc',
  $include_dir . '/actions.inc',
  $include_dir . '/entity.inc',
  $module_dir  . '/system/system.module',
  $include_dir . '/database/query.inc',
  $include_dir . '/database/select.inc',
  $include_dir . '/registry.inc',
  $include_dir . '/module.inc',
  $include_dir . '/menu.inc',
  $include_dir . '/file.inc',
  $include_dir . '/theme.inc',
);

TO :

$includes = array(
  $include_dir . '/bootstrap.inc',
  $include_dir . '/common.inc',
  $include_dir . '/database.inc',
  $include_dir . '/schema.inc',
  $include_dir . '/actions.inc',
  $include_dir . '/entity.inc',
  $module_dir  . '/system/system.module',
  $include_dir . '/database/query.inc',
  $include_dir . '/database/select.inc',
  $include_dir . '/registry.inc',
  $include_dir . '/module.inc',
  $include_dir . '/menu.inc',
  $include_dir . '/file.inc',
  $include_dir . '/theme.inc',
  $include_dir . '/lock.inc',
);
omega8cc’s picture

@chriscalip The lock.inc is conditionally added, to properly support external lock methods (like with Redis). Please make sure you are running latest rr version. The same logic is included in the command line and PHP version, however I don't think we have tested PHP script version to make sure the logic there works properly. Feel free to follow up in the related issue: #1971684: Registry rebuild does not work with non core lock.inc