i've got a d7 site which rr can't heal.

made a site archive before i do some db-fu.
if you pm me an email address i upload you the archive somewhere (it has some git in it and is quite big)

$ drush rr -v
Initialized Drupal 7.3-dev root directory at /home/xl/workspace/sandbox                                                          [notice]
Initialized Drupal site default at sites/default                                                                                 [notice]
Registry has been rebuilt.                                                                                                       [notice]
Bootstrapping to DRUPAL_BOOTSTRAP_FULL.                                                                                          [notice]

Fatal error: Class 'DrupalDefaultEntityController' not found in /home/xl/workspace/sandbox/modules/user/user.module on line 280

Call Stack:
    0.0007     369112   1. {main}() /home/xl/workspace/drush/drush.php:0
    0.0338    2839788   2. drush_main() /home/xl/workspace/drush/drush.php:14
    0.1880   10033172   3. _drush_bootstrap_and_dispatch() /home/xl/workspace/drush/drush.php:58
    0.2424   10038872   4. drush_dispatch() /home/xl/workspace/drush/drush.php:89
    0.3434   10047580   5. call_user_func_array() /home/xl/workspace/drush/includes/command.inc:225
    0.3434   10047772   6. drush_registry_rebuild() /home/xl/workspace/drush/includes/command.inc:0
    1.3959   16992128   7. drupal_bootstrap() /home/xl/.drush/registry_rebuild/registry_rebuild.drush.inc:98
    1.6032   17881360   8. _drupal_bootstrap_page_header() /home/xl/workspace/sandbox/includes/bootstrap.inc:1924
    1.6032   17881436   9. bootstrap_invoke_all() /home/xl/workspace/sandbox/includes/bootstrap.inc:2147
    1.6033   17881780  10. module_invoke() /home/xl/workspace/sandbox/includes/bootstrap.inc:904
    1.6033   17882220  11. call_user_func_array() /home/xl/workspace/sandbox/includes/module.inc:795
    1.6033   17882412  12. devel_boot() /home/xl/workspace/sandbox/includes/module.inc:0
    1.6034   17882564  13. drupal_load() /home/xl/workspace/sandbox/sites/all/modules/devel/devel.module:581
    1.6148   18817044  14. include_once('/home/xl/workspace/sandbox/modules/user/user.module') /home/xl/workspace/sandbox/includes/bootstrap.inc:932

Drush command terminated abnormally due to an unrecoverable error.                                                            [error]
Error: Class 'DrupalDefaultEntityController' not found in /home/xl/workspace/sandbox/modules/user/user.module, line 280

Comments

rfay’s picture

Title: class not found after rr » Class 'DrupalDefaultEntityController' not found
Status: Active » Needs review
StatusFileSize
new489 bytes

This seems to fix it. I think the problem is that your database/codebase is so very old (7.2). But I don't see why we shouldn't add this.

rfay’s picture

Status: Needs review » Fixed

I went ahead and committed (as it seemed no harm), http://drupalcode.org/project/registry_rebuild.git/commitdiff/4e75d07

geek-merlin’s picture

this was a fast fix! kudos!

geek-merlin’s picture

Status: Fixed » Active

hmm, a first try gives me:

$ drush rr
The registry has been rebuilt.                                                                                                [success]
$ drush status
Drush command terminated abnormally due to an unrecoverable error.                                                            [error]
Error: Class 'DrupalDefaultEntityController' not found in /home/xl/workspace/sandbox/modules/user/user.module, line 280

rr does not freak out anymore, but registry seems not fixed

rfay’s picture

Status: Active » Needs work

I guess I jumped the gun. I'm not entirely sure this is worth following up though, as updating to 7.10 fixes the problem. I just did a "git checkout 7.10" and "drush updatedb" and all was well.

May very well be worth solving this, but it may be just an old remnant of ancient D7.

What's your opinion? Is it worth going forward to debug this, or should we just assume that people would be using more recent D7?

geek-merlin’s picture

Status: Needs work » Fixed

looks like the pragmatic solution is to just do the update.
anyone who googled this will now know what to do.
and anyone who notices that an update doesn't do the job should feel free to reopen.

have a nice day randy and cu at the commerce modules party!

geek-merlin’s picture

wow, this site is a nasty little bastard that might teach us a lesson or not.
in my place:
* checked out current core and drush updb
* drush status now works fine
* login and going to development/testing and got "class view not found"
* "drush upc" gave "Class 'DrupalQueue' not found"

geek-merlin’s picture

Status: Fixed » Active

first observations:
* table registry_file DOES contain modules/system/system.queue.inc
* table registry DOES NOT contain DrupalQueue
* file system DOES contain said file which looks fine and with same chmod as anyone around

geek-merlin’s picture

Title: Class 'DrupalDefaultEntityController' not found » corrupt registry table not fixed if registry_file table contains all files

WOW, what did the job:
* empty both registry tables
* drush rr

so it looks registry_rebuild does NOT parse files that are in the table even if class data may be corrupt.

i see 2 issues here:
* for best dx core should offer a full rebuild in case of class-not-found
* for now this drush module should "truncate table registry" - maybe warning user

rfay’s picture

Yeah, I've always wondered if it wouldn't be better to just start with an empty registry. However it works so well for so many things I'm hesitant to make such a significant change.

geek-merlin’s picture

perhaps a documented drush option.
let's call it "bazooka" :-)

rfay’s picture

I like it. Patches welcome, too.

rfay’s picture

Title: corrupt registry table not fixed if registry_file table contains all files » Provide drush option to flush the registry before rebuilding
Category: bug » feature
joachim’s picture

Just got bitten by this too. Would be very handy to have this!

joachim’s picture

Hmm, and again. I should maybe write this patch! :)

> However it works so well for so many things I'm hesitant to make such a significant change.

Accidentally copying a class name to another file, which then gets the registry stuck thinking the class is in file B rather than the correct, original file A! Currently drush rr won't fix this.

omega8cc’s picture

Status: Active » Needs review
StatusFileSize
new1.32 KB

Something like this?

omega8cc’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.