Just updated to today's version of OG 7.x-1.1 and got the following:
Class 'OgMetadataController' not found in /sites/all/modules/entity/entity.info.inc on line 23

Marking critical since, well...it hosed everything :)

Comments

Rob_Feature’s picture

Priority: Critical » Normal

After this I got a bunch of notices about migrating data...maybe it was related? (didn't have OG migrate module enabled when I got this error...). Site came back up, so downgrading status.

amitaibu’s picture

Category: bug » support
Status: Active » Fixed

Please reopen if update.php + cache clear + og migrate didn't help

Rob_Feature’s picture

It appears this went away after og migrate.

gumdrop’s picture

Priority: Normal » Critical
Status: Fixed » Needs review

OK managed to clear cache

amitaibu’s picture

Priority: Critical » Normal
Status: Needs review » Fixed
mobonobomo’s picture

Where can I find "og migrate"? I'm getting the same error:

Fatal error: Class 'OgMetadataController' not found in /sites/all/modules/entity/entity.info.inc on line 23

...on upgrade to OG 7.x-1.1. Also, I upgraded Entity API to 7.x-1.0-beta10; is there a recommended version of Entity API?

stevebab’s picture

Exact same error here -- I can't get to admin/build/modules (or /admin or /* or anything other than the home page) in order to enable og migrate... I get a white screen on every url.

Update.php returns "Fatal error: Class 'OgMetadataController' not found in /sites/all/modules/entity/entity.info.inc on line 23" .

Any help out there?

MGParisi’s picture

Priority: Normal » Critical
Status: Fixed » Active

same as #7,

Couldnt uninstall OG, hosed everything... Replacing OG, no help... Changing version of Entity, sorry...

MGParisi’s picture

Thank God for Backup and Migrate, lost 8 minutes of data. Ran Migrate, but cant uninstall without crashing my site.

Edit: OG Uninstalls list?

MGParisi’s picture

got rid of it... I don't know if I can ever install it again:(

I had to remove the node panel, all views (or disable them), and just about everything that was related to it, including fields. Then I un-checked it, got an error, had no uninstall.. after that I went into the database, cleaned out the system table of all og starting fields and deleted all og tables.... I hope it all works right, but I got a backup.

Anything else that has to be cleaned up?

BrightBold’s picture

@MGParisi - See my comment #1182966-2: Cannot fully uninstall or reinstall OG for all the things I deleted from the database when I was having trouble uninstalling and reinstalling OG (as a result, I believe, of #943772: field_delete_field() and others fail for inactive fields.)

RobKoberg’s picture

After updating og, I was having the same problem and now have a related problem. I combed through the DB and removed everything I could find related to OG (download sql dump and search for Og and og_). After cleaning everything(?), I tried to reinstall og, which failed. After cleaning again, I tried og-dev. When I install (through drush or the drupal modules ui) og says it is enabled in the web ui but no og tables are created. drush pm-info og says it is not installed. Entries *are* added to the system, registry and registry_files table, so I assume that is why the web ui says it is installed. Running drush updb and cache-clear and core-cron (last two many, many times) does nothing as I think the code pasted below stops everything?? Any idea on how to fix or further debug? I saw something earlier that said to run an individual update, but how do you run a specific update? I can't find anything relevant about how to do this from google or drupal searches.

It seems the problem is around line 202 of og.module (og-dev):

function og_entity_info_alter(&$entity_info) {
  // If we're updating, the schema may not be ready yet.
  if (!class_exists('EntityAPIController') || !class_exists('OgMembershipTypeUIController')) {
    return;
  }
  foreach (og_membership_type_load() as $type_name => $type) {
...

The relevant part of the stack trace is:

PHP  16. og_entity_info_alter() /Users/rkoberg/Sites/nfte/www/includes/module.inc:1004
PHP  17. og_membership_type_load() /Users/rkoberg/Sites/nfte/www/sites/all/modules/og/og.module:202
PHP  18. entity_load_multiple_by_name() /Users/rkoberg/Sites/nfte/www/sites/all/modules/og/og.module:927
PHP  19. entity_load() /Users/rkoberg/Sites/nfte/www/sites/all/modules/entity/entity.module:143
PHP  20. entity_get_controller() /Users/rkoberg/Sites/nfte/www/includes/common.inc:7473

Fatal error: Class name must be a valid object or a string in /Users/rkoberg/Sites/nfte/www/includes/common.inc on line 7506
RobKoberg’s picture

BTW, when trying to disable the psuedo-enabled og module, I get this stack trace:

rkmba:www rkoberg$ drush dis og
The following extensions will be disabled: og
Do you really want to continue? (y/n): y
PHP Fatal error:  Class 'OgMembershipTypeUIController' not found in /Users/rkoberg/Sites/nfte/www/sites/all/modules/entity/entity.module on line 893
PHP Stack trace:
PHP   1. {main}() /Users/rkoberg/drush/drush.php:0
PHP   2. drush_main() /Users/rkoberg/drush/drush.php:14
PHP   3. drush_dispatch() /Users/rkoberg/drush/drush.php:82
PHP   4. call_user_func_array() /Users/rkoberg/drush/includes/command.inc:216
PHP   5. drush_command() /Users/rkoberg/drush/includes/command.inc:216
PHP   6. _drush_invoke() /Users/rkoberg/drush/includes/command.inc:881
PHP   7. call_user_func_array() /Users/rkoberg/drush/includes/command.inc:125
PHP   8. drush_pm_disable() /Users/rkoberg/drush/includes/command.inc:125
PHP   9. drush_system_modules_form_submit() /Users/rkoberg/drush/commands/pm/pm.drush.inc:905
PHP  10. drupal_flush_all_caches() /Users/rkoberg/drush/commands/core/drupal/environment.inc:144
PHP  11. menu_rebuild() /Users/rkoberg/Sites/nfte/www/includes/common.inc:7141
PHP  12. menu_router_build() /Users/rkoberg/Sites/nfte/www/includes/menu.inc:2590
PHP  13. call_user_func() /Users/rkoberg/Sites/nfte/www/includes/menu.inc:2621
PHP  14. entity_menu() /Users/rkoberg/Sites/nfte/www/includes/menu.inc:2621
PHP  15. entity_ui_controller() /Users/rkoberg/Sites/nfte/www/sites/all/modules/entity/entity.module:915
PHP  16. entity_ui_controller() /Users/rkoberg/Sites/nfte/www/sites/all/modules/entity/entity.module:899

Fatal error: Class 'OgMembershipTypeUIController' not found in /Users/rkoberg/Sites/nfte/www/sites/all/modules/entity/entity.module on line 893

Call Stack:
    0.0022     703072   1. {main}() /Users/rkoberg/drush/drush.php:0
    0.0323    4413128   2. drush_main() /Users/rkoberg/drush/drush.php:14
    1.7783   66259016   3. drush_dispatch() /Users/rkoberg/drush/drush.php:82
    1.8286   66830328   4. call_user_func_array() /Users/rkoberg/drush/includes/command.inc:216
    1.8286   66830816   5. drush_command() /Users/rkoberg/drush/includes/command.inc:216
    1.8293   66836120   6. _drush_invoke() /Users/rkoberg/drush/includes/command.inc:881
    1.8319   66886336   7. call_user_func_array() /Users/rkoberg/drush/includes/command.inc:125
    1.8319   66886824   8. drush_pm_disable() /Users/rkoberg/drush/includes/command.inc:125
    7.3059  101848096   9. drush_system_modules_form_submit() /Users/rkoberg/drush/commands/pm/pm.drush.inc:905
    9.5091  121808128  10. drupal_flush_all_caches() /Users/rkoberg/drush/commands/core/drupal/environment.inc:144
    9.7195  118606552  11. menu_rebuild() /Users/rkoberg/Sites/nfte/www/includes/common.inc:7141
    9.7201  118607928  12. menu_router_build() /Users/rkoberg/Sites/nfte/www/includes/menu.inc:2590
   10.1811  124254888  13. call_user_func() /Users/rkoberg/Sites/nfte/www/includes/menu.inc:2621
   10.1812  124254888  14. entity_menu() /Users/rkoberg/Sites/nfte/www/includes/menu.inc:2621
   10.1812  124255200  15. entity_ui_controller() /Users/rkoberg/Sites/nfte/www/sites/all/modules/entity/entity.module:915
   10.1814  124258584  16. entity_ui_controller() /Users/rkoberg/Sites/nfte/www/sites/all/modules/entity/entity.module:899

Drush command terminated abnormally due to an unrecoverable error.                                                                                                                               [error]
Error: Class 'OgMembershipTypeUIController' not found in /Users/rkoberg/Sites/nfte/www/sites/all/modules/entity/entity.module, line 893
BrightBold’s picture

@RobKoberg - Your stack trace is over my head, but I noticed you searched your SQL dump for "og" and "og_", but if you look at the link in my comment #11, you'll see that some of the entries used "group" instead of "og." So I'd recommend re-trying your uninstall/delete process but including "group" in your search.

RobKoberg’s picture

Started fresh... One thing I am seeing is OG and UUID do not work together. I had installed UUID for promoting between staging and/or dev versions. I had hoped to be able to use node export features to get content in my 'new' version.

Initially, I had installed UUID before OG and OG would not install. Started fresh again... and enabled things in very small groups and this is where I noticed the incompatibility. Can't spend time digging too deep right now as I have to have this site up and running tomorrow.

renat’s picture

Faced the same problem trying to uninstall OG-7.1, so subscribe. Drupal 7.8, cache was cleared, cron was fired, update.php was fired, OG Migrate was fired, too.

amitaibu’s picture

> I had installed UUID before OG and OG would not install

I don't know this module, but if you have other updates I'd be happy to hear.

Anonymous’s picture

Since there hasn't been much help with this, here's a quick and dirty fix to get the site back online...

1) enable og_migrate module manually: UPDATE system SET status=1 WHERE name = 'og_migrate';

2) Create og_migrate table:

CREATE TABLE `og_migrate` (
  `plugin` varchar(255) NOT NULL DEFAULT '' COMMENT 'The plugin name.',
  `status` smallint(6) NOT NULL DEFAULT '0' COMMENT 'The plugin’s status. Not executed, executed or failed.',
  PRIMARY KEY (`plugin`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Store information related to the organic groups migration.';

3) edit sites/all/modules/entity/entity.info.inc and add the following after line 22, so it looks like this:

    if (!empty($info['metadata controller class'])) {
      include_once '/var/www/sites/all/modules/og/includes/og.info.inc'; /* add this line */
      $controller = new $info['metadata controller class']($type);
      $items += $controller->entityPropertyInfo();
    }

4) Remove line from sites/all/modules/entity/entity.info.inc

Congrats, your site should be running again. As far as I can tell from looking at what og_migrate does, I don't believe this should cause any lasting problems and the site should be fine after this, no guarantees though... Also some of these steps may not be necessary or could be done in different order, but this is what I did and it worked so...

WriteCo’s picture

My site is not working at all. I cannot wait to get rid of organic groups. I cannot run cron, I cannot clear caches, I cannot run the update script, I can only see pages that were cached on my system. I have tried the various fixes for OG and I only get new errors.

How do I get rid of OG from the DB or command line or some combination of anything, since the web site is completely hosed?

BrightBold’s picture

@writeco — Have you tried the database deletions I link to in #11? That worked for me. You can also clear the cache from the database by truncating (not dropping!) all tables that start with "cache".

WriteCo’s picture

Alright. I rolled back OG, entity, and views to previous versions in hopes of restoring previous compatibility. When that didn't work, go figure, I disabled those modules in the DB. Like, what's it gonna hurt?, the site is hosed, anyway. I then cleared the main cache and any other cache in the DB that looked like it might be relevant. Still no site, but, woohoo, just shoot me, I got my update page back. No updates are necessary, according to my site, but bookoo errors from OG_Migrate.

I re-enabled entity and views, der (duh), and disabled something that threw off an error. Cleared all caches at the DB again, went through update again for some new errors and no updates, but now I can get a page and, more importantly, my modules page.

I disabled all modules using entity or views... . I deleted the Filtered HTML text format because it threw off errors and I just don't give a flip anymore. I grabbed the latest releases of my rolled back modules, updated the site, and errors begone!

Now I am going back to uninstalling OG completely and I am trying to find the table that contains that disabled text format so I can re-enable it and recover the content that disappeared with the format.

I really had other plans this weekend.

drasgardian’s picture

I managed to clear this issue by running the following with drush

drush php-eval 'entity_info_cache_clear();'

The issue relates to #996236: drupal_flush_all_caches() does not clear entity info cache

srsbl’s picture

Also getting the message of several classes (OgMetadataController, OgMembershipTypeUIController, OgViewsController) not found in entity.

zhenjan’s picture

Version: 7.x-1.1 » 7.x-1.3

looks, that problem is not solved? when i'm trying to uninstall OG module (switch off module on admin/modules page and after delete it in Uninstall tab) i'm getting the same error. i'm using the latest version of the module. any of the solution above doesn't works for me. Is it a way to delete this module?

nicholasyonko’s picture

This fixed it for me.

ununpentium’s picture

The solution in #20 worked in making the website accessible again; no need to delete any tables:

You can also clear the cache from the database by truncating (not dropping!) all tables that start with "cache".

OG has a horrible uninstall process.

fago’s picture

Make sure you've updated to drupal 7.12, that should fix entity-cache clearing issues.

thinkyhead’s picture

Using Drupal 7.23 I ran into issues updating to the latest OG and Entity modules. It threw this error, plus complained about the missing field property getter function. To get around it all I installed these related modules manually instead of using drush, and ran updb after each install. Sometimes it's just a matter of OG not having a lower weight than the other modules that depend on it.