A complete crash of the admin/modules page occurs whenever the Entity Token module is enabled. The Entity API module can be enabled separately with no problem. The Error output is as follows:
===================================================

Additional uncaught exception thrown while handling exception.
Original

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {menu_router} WHERE path IN (:ancestors_0, :ancestors_1, :ancestors_2, :ancestors_3, :ancestors_4, :ancestors_5, :ancestors_6, :ancestors_7, :ancestors_8, :ancestors_9, :ancestors_10, :ancestors_11) ORDER BY fit DESC LIMIT 0, 1; Array ( [:ancestors_0] => admin/reports/updates/settings [:ancestors_1] => admin/reports/updates/% [:ancestors_2] => admin/reports/%/settings [:ancestors_3] => admin/reports/%/% [:ancestors_4] => admin/%/updates/settings [:ancestors_5] => admin/reports/updates [:ancestors_6] => admin/reports/% [:ancestors_7] => admin/%/updates [:ancestors_8] => admin/%/% [:ancestors_9] => admin/reports [:ancestors_10] => admin/% [:ancestors_11] => admin ) in menu_get_item() (line 443 of C:\mywebsite\includes\menu.inc).
Additional

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => php [:db_insert_placeholder_2] => %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] => a:6:{s:5:"%type";s:12:"PDOException";s:8:"!message";s:835:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {menu_router} WHERE path IN (:ancestors_0, :ancestors_1, :ancestors_2, :ancestors_3, :ancestors_4, :ancestors_5, :ancestors_6, :ancestors_7, :ancestors_8, :ancestors_9, :ancestors_10, :ancestors_11) ORDER BY fit DESC LIMIT 0, 1; Array ( [:ancestors_0] => admin/reports/updates/settings [:ancestors_1] => admin/reports/updates/% [:ancestors_2] => admin/reports/%/settings [:ancestors_3] => admin/reports/%/% [:ancestors_4] => admin/%/updates/settings [:ancestors_5] => admin/reports/updates [:ancestors_6] => admin/reports/% [:ancestors_7] => admin/%/updates [:ancestors_8] => admin/%/% [:ancestors_9] => admin/reports [:ancestors_10] => admin/% [:ancestors_11] => admin ) ";s:9:"%function";s:15:"menu_get_item()";s:5:"%file";s:39:"C:\mywebsite\includes\menu.inc";s:5:"%line";i:443;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://local.adug7.com/admin/modules [:db_insert_placeholder_7] => http://local.adug7.com/node [:db_insert_placeholder_8] => 127.0.0.1 [:db_insert_placeholder_9] => 1297809086 ) in dblog_watchdog() (line 155 of C:\mywebsite\modules\dblog\dblog.module).
Uncaught exception thrown in session handler.

PDOException: There is already an active transaction in _drupal_session_write() (line 204 of C:\mywebsite\includes\session.inc).

Comments

fago’s picture

>"MySQL server has gone away"
I don't see how entity tokens should cause the mysql server to go away ;)

However, just a wild guess - perhaps this is somehow related to #1058912: Prevent recursive tokens. That said, please try whether disabling the token module makes entity-tokens work.

zoon_unit’s picture

I have extremely generous memory allocation on my dev server. (xampp on Win7) Of course, once the module page crashes, I am unable to disable the module. :-) I have to restore from a mysql dump.

I can't disable the Token module because Pathauto (and several other modules) require it.

kpastore’s picture

I get a different error, but similar to these:
Notice: Undefined index: label in entity_metadata_token_info_alter() (Zeile 55 von /xxx/drupal7/sites/all/modules/entity/entity_metadata/entity_metadata.tokens.inc).
Notice: Undefined index: label in entity_metadata_token_info_alter() (Zeile 60 von /xxx/drupal7/sites/all/modules/entity/entity_metadata/entity_metadata.tokens.inc).

found in this thread:
https://drupal.org/node/995834

I have disabled the module for the time being. Will wait to see if upgrades are made.

davidwhthomas’s picture

The first post is unrelated to entity_token and is a mysql load issue
#3 is a trivial notice level error that may be fixed anytime.

klausi’s picture

Title: Drupal 7.0 CRASHES when Entity Token 1.0beta6 is Enabled » Notice: Undefined index: label in entity_metadata_token_info_alter()
Version: 7.x-1.0-beta6 » 7.x-1.x-dev
Priority: Critical » Normal
tebb’s picture

I have a site with the issue reported here: http://drupal.org/node/1099754
That issue has been closed as a duplicate of this issue.

That issue was: Undefined index: label in entity_token_token_info_alter() on lines 54 and 59.
Note: It's token_token rather than metadata_token.

#4 says this is "a trivial notice level error that may be fixed anytime."

Could someone tell me what the 'trivial fix' is then please?

The code starting at line 52 is:

      if (!isset($info['tokens'][$token_type][$name]) && (!isset($property['type']) || in_array($property['type'], $valid_types))) {
        $info['tokens'][$token_type][$name] = array(
          'name' => $property['label'],
          'type' => isset($property['type']) ? array_search($property['type'], $valid_types) : 'text',
          // Mark the token so we know we have to provide the value afterwards.
          'entity-token' => TRUE,
        );
        $info['tokens'][$token_type][$name]['description'] = isset($property['description']) ? $property['description'] : $property['label'];
      }
    }

So the notices come from:

Line 54: 'name' => $property['label'],
Line 59: $info['tokens'][$token_type][$name]['description'] = isset($property['description']) ? $property['description'] : $property['label'];

So I guess I replace 'label' with something else, but I don't know what, and I can't debug yet.

To get rid of the notices, I have to disable about 5 modules including Rules, so would like to get a real fix.

Any assistance you can give would be appreciated.

tebb’s picture

I tried Fago's suggestion in 1#, disabling token (and pathauto)

I still get the notices:

Notice: Undefined index: label in entity_token_token_info_alter() (line 54 of /pathToD7/sites/all/modules/entity/entity_token.tokens.inc).
Notice: Undefined index: label in entity_token_token_info_alter() (line 59 of /pathToD7/sites/all/modules/entity/entity_token.tokens.inc).

tebb’s picture

For me, this appears to have been an Organic Groups 7 issue.

Using hints from: https://drupal.org/node/995834 I added two lines with the 'label' and 'description' entries from the latest dev.

Lesson learned. The error message doesn't always indicate where the real issue is.

In particular, entity/entity cache issues I've had, actually originate in other modules.

Does everyone else have OG7 installed?

webankit’s picture

yes i have og installed...

tebb’s picture

@babbar.ankit

Have a look at https://drupal.org/node/995834

My guess is that one of the 'patches' there will fix the problem for you.

amitaibu’s picture

This is a duplicate of #995834: Undefined index: label in entity_metadata_token_info_alter(), which is already fixed in OG -dev.

fago’s picture

Status: Active » Closed (duplicate)

thanks

paskainos’s picture

I'm working on an (D7.2) OpenPublic (beta1 build200) / CiviCRM (4.0.4) install (OG is not installed) and getting the same error(s). Disabling the Token module in the db ('system' table >> token.module >> status: 0) brings the Modules page (admin/modules) up as expected, but obviously isn't a permanent solution.