I've the following error when running: drush status
Fatal error: Unsupported operand types in rules.module on line 227
Call Stack:
1. {main}() /usr/share/drush/drush.php:0
2. drush_main() /usr/share/drush/drush.php:40
3. drush_dispatch($command = array ('description' => 'Provides a birds-eye view of the current Drupal installation, if any.', 'bootstrap' => 0, 'aliases' => array (0 => 'status', 1 => 'st'), 'examples' => array ('drush status version' => 'Show all status lines that contain version information.', 'drush status --pipe' => 'A list key=value items separated by line breaks.', 'drush status drush-version --pipe' => 'Emit just the drush version with no label.'), 'arguments' => array (), 'options' => array ('show-passwords' => 'Show database password.'), 'command' => 'core-status', 'command-hook' => 'core-status', 'commandfile' => 'core', 'path' => '/usr/share/drush/commands/core', 'engines' => array (), 'callback' => 'drush_command', 'deprecated-aliases' => array (0 => 'core status'), 'extras' => array (), 'core' => array (), 'scope' => 'site', 'drupal dependencies' => array (), 'drush dependencies' => array (), 'bootstrap_errors' => array (), 'hidden' => FALSE, 'is_alias' => TRUE)) /usr/share/drush/drush.php:90
4. call_user_func_array('drush_command', array ()) /usr/share/drush/includes/drush.inc:51
5. drush_command() /usr/share/drush/includes/drush.inc:0
6. call_user_func_array('drush_invoke', array (0 => 'core-status')) /usr/share/drush/includes/command.inc:381
7. drush_invoke($command = 'core-status') /usr/share/drush/includes/command.inc:0
8. call_user_func_array('drush_core_status', array ()) /usr/share/drush/includes/command.inc:330
9. drush_core_status() /usr/share/drush/includes/command.inc:0
10. drush_bootstrap_max() /usr/share/drush/commands/core/core.drush.inc:562
11. drush_bootstrap($phase = 5) /usr/share/drush/includes/environment.inc:252
12. _drush_bootstrap_drupal_full() /usr/share/drush/includes/environment.inc:172
13. drupal_bootstrap($phase = 7, $new_phase = ???) /usr/share/drush/includes/environment.inc:750
14. _drupal_bootstrap_full() /var/www/drupal7/includes/bootstrap.inc:2259
15. module_invoke_all($hook = 'init') /var/www/drupal7/includes/common.inc:5145
16. call_user_func_array('rules_init', array ()) /var/www/drupal7/includes/module.inc:895
17. rules_init() /var/www/drupal7/includes/module.inc:0
18. rules_invoke_event('init') /var/www/drupal7/sites/all/modules/contrib/rules/rules.module:12
19. rules_get_cache($cid = 'event_init') /var/www/drupal7/sites/all/modules/contrib/rules/rules.module:969
20. RulesEventSet::rebuildEventCache() /var/www/drupal7/sites/all/modules/contrib/rules/rules.module:333
21. rules_fetch_data($hook = 'event_info') /var/www/drupal7/sites/all/modules/contrib/rules/includes/rules.plugins.inc:761
22. _drupal_error_handler($error_level = 8, $message = 'Undefined index: event_info', $filename = '/var/www/drupal7/sites/all/modules/contrib/rules/rules.module', $line = 227, $context = array ('hook' => 'event_info', 'data' => array ('event_info' => 0), 'discover' => array ('action_info' => 'RulesActionHandlerInterface', 'condition_info' => 'RulesConditionHandlerInterface', 'event_info' => 'RulesEventHandlerInterface'))) /var/www/drupal7/includes/bootstrap.inc:0
23. _drupal_error_handler_real($error_level = 8, $message = 'Undefined index: event_info', $filename = '/var/www/drupal7/sites/all/modules/contrib/rules/rules.module', $line = 227, $context = array ('hook' => 'event_info', 'data' => array ('event_info' => 0), 'discover' => array ('action_info' => 'RulesActionHandlerInterface', 'condition_info' => 'RulesConditionHandlerInterface', 'event_info' => 'RulesEventHandlerInterface'))) /var/www/drupal7/includes/bootstrap.inc:2312
24. _drupal_log_error($error = array ('%type' => 'Notice', '!message' => 'Undefined index: event_info', '%function' => 'rules_fetch_data()', '%file' => '/var/www/drupal7/sites/all/modules/contrib/rules/rules.module', '%line' => 227, 'severity_level' => 5), $fatal = FALSE) /var/www/drupal7/includes/errors.inc:75
25. watchdog($type = 'php', $message = '%type: !message in %function (line %line of %file).', $variables = array ('%type' => 'Notice', '!message' => 'Undefined index: event_info', '%function' => 'rules_fetch_data()', '%file' => '/var/www/drupal7/sites/all/modules/contrib/rules/rules.module', '%line' => 227, 'severity_level' => 5), $severity = 5, $link = ???) /var/www/drupal7/includes/errors.inc:202
26. module_invoke($module = 'rules', $hook = 'watchdog', array ('type' => 'php', 'message' => '%type: !message in %function (line %line of %file).', 'variables' => array ('%type' => 'Notice', '!message' => 'Undefined index: event_info', '%function' => 'rules_fetch_data()', '%file' => '/var/www/drupal7/sites/all/modules/contrib/rules/rules.module', '%line' => 227, 'severity_level' => 5), 'severity' => 5, 'link' => NULL, 'user' => class stdClass { public $uid = 0; public $hostname = '127.0.0.1'; public $roles = array (...); public $cache = 0 }, 'uid' => 0, 'request_uri' => 'http://default/index.php', 'referer' => '', 'ip' => '127.0.0.1', 'timestamp' => 1387812555)) /var/www/drupal7/includes/bootstrap.inc:1734
27. call_user_func_array('rules_watchdog', array (2 => array ('type' => 'php', 'message' => '%type: !message in %function (line %line of %file).', 'variables' => array (...), 'severity' => 5, 'link' => NULL, 'user' => class stdClass { ... }, 'uid' => 0, 'request_uri' => 'http://default/index.php', 'referer' => '', 'ip' => '127.0.0.1', 'timestamp' => 1387812555))) /var/www/drupal7/includes/module.inc:866
28. rules_watchdog($log_entry = array ('type' => 'php', 'message' => '%type: !message in %function (line %line of %file).', 'variables' => array ('%type' => 'Notice', '!message' => 'Undefined index: event_info', '%function' => 'rules_fetch_data()', '%file' => '/var/www/drupal7/sites/all/modules/contrib/rules/rules.module', '%line' => 227, 'severity_level' => 5), 'severity' => 5, 'link' => NULL, 'user' => class stdClass { public $uid = 0; public $hostname = '127.0.0.1'; public $roles = array (...); public $cache = 0 }, 'uid' => 0, 'request_uri' => 'http://default/index.php', 'referer' => '', 'ip' => '127.0.0.1', 'timestamp' => 1387812555)) /var/www/drupal7/includes/module.inc:0
29. rules_invoke_event('watchdog', array ('type' => 'php', 'message' => '%type: !message in %function (line %line of %file).', 'variables' => array ('%type' => 'Notice', '!message' => 'Undefined index: event_info', '%function' => 'rules_fetch_data()', '%file' => '/var/www/drupal7/sites/all/modules/contrib/rules/rules.module', '%line' => 227, 'severity_level' => 5), 'severity' => 5, 'link' => NULL, 'user' => class stdClass { public $uid = 0; public $hostname = '127.0.0.1'; public $roles = array (...); public $cache = 0 }, 'uid' => 0, 'request_uri' => 'http://default/index.php', 'referer' => '', 'ip' => '127.0.0.1', 'timestamp' => 1387812555)) /var/www/drupal7/sites/all/modules/contrib/rules/modules/events.inc:180
30. rules_get_cache($cid = 'event_watchdog') /var/www/drupal7/sites/all/modules/contrib/rules/rules.module:969
31. RulesEventSet::rebuildEventCache() /var/www/drupal7/sites/all/modules/contrib/rules/rules.module:333
32. rules_fetch_data($hook = 'event_info') /var/www/drupal7/sites/all/modules/contrib/rules/includes/rules.plugins.inc:761
Variables in local scope (#32):
$data = array ('event_info' => 0)
$discover = array ('action_info' => 'RulesActionHandlerInterface', 'condition_info' => 'RulesConditionHandlerInterface', 'event_info' => 'RulesEventHandlerInterface')
$hook = 'event_info'
$item = *uninitialized*
$module = *uninitialized*
$name = *uninitialized*
$result = *uninitialized*
I'm using memcached as my cache engine.
Any suggestion what it could be causing it?
Comments
Comment #1
kristen polI'm seeing the same error. Code is:
I'm surprised more people haven't chimed in with the same issue. Not sure what the fix is.
[UPDATE] Actually... mine was in rules.plugins.inc. I updated to the latest dev and cleared the cache a bunch of times and it is gone. I think it was just the cache clearing that fixed it but perhaps try the latest dev.
Comment #2
mschudders commentedPatch attached.
Not yet throurougly checked, but it removes the error so.
Comment #3
joelpittetI had the same error on -dev then went back to 2.6 and same thing. Deleted rules, cleared cache download -dev again and it's back to working, kinda similar to #1. After that the error didn't happen again even after
drush dis rules -yanddrush pmu rules -yanddrush en rules -yagain.Here's the callstack if that helps:
Comment #4
kenorb commentedComment #6
HeathN commentedTried 7.x-2.5, 7.x-2.6 and 7.x-2.x-dev all failed with this error:
Really need rules to be working. Is there anything I can do to get more helpful errors for you?
Edit: This is a fatal error, should we up the priority of this to major?
Comment #7
kenorb commented@HeathN: apply the patch, and re-attach to pass the tests
Comment #8
13rac1 commentedI applied this patch, but now I am getting
Fun Fun.
Comment #9
13rac1 commentedThe code in question is:
The value of $entity_type when the error occurs is: rules_config
An potentialy useful note: This only occurs on my local copy of the website. It works fine on dev, staging, and live.
Comment #10
13rac1 commentedI don't have a solution yet, but rebuilding the registry is a workaround: https://drupal.org/project/registry_rebuild
Comment #11
sobi3ch commented#10 works for me! But I need download registry_rebuild manually.
Follow this blog to do it.
Comment #12
suntower commentedI am having the same issue. I am converting a D6 site to D7.26.
I started with a clean D7.26 core, ran the updater to get the D7 db, then started adding D7 modules. After I added Rules, I got a WSOD and the error in Rules @ line 227.
I applied the patch from #2 which made no apparent difference. I tried the solution #10 and again no difference. I've had to disable Rules in order to move forward, but at some point, I'm gonna need it back.
Any suggestions?
Comment #13
jaskho commentedNeither the patch in #2 nor rebuilding the registry worked for me. However, the issue stopped occurring after I increased php memory limit (from 64M to 128M in my case). I haven't tried to debug the root cause (or even to confirm that memory is the actual problem), but I have been able to reproduce and then resolve the problem by adjusting memory_limit up/down. Worth a shot...
Comment #14
dremy commentedI was having this same problem and this worked for me from Stack Exchange:
Comment #15
maikeru commentedThe patch in #2 wasn't applying clean in our drush make process - find attached one that does.
Comment #16
kenorb commentedComment #17
alauddin commented#15 patch works.
thanks
Comment #18
khumbu commentedyes...it works...thx :)
Comment #19
kholloway commentedI had this issue on my local instance only after cloning a Dev database to my local.
The following solution worked for me:
Manually clear all sql cache tables (cache and all the cache_* tables)
Note:
You have to do it manually to your sql database as drush commands will keep throwing errors when they try to bootstrap the site. You may be able to do direct drush sql command line commands to truncate the tables as well but I didn't try that.
My local is working just fine now after doing that :)
Comment #20
alfthecat commentedApplied the patch after this issue killed a website completely.
It didn't solve my problem, patch applied but I got another error and the site still WSOD'd.
I tried manually truncating all my cache_ tables and the cache table itself (#2324587: Rules might be triggered too early in the bootstrap. To no avail.
Had to restore a backup.
Comment #22
geek-merlinUps, just seen that i created a dup over there at #2344579: WSOD: PHP Fatal error: Unsupported operand types in rules.module on line 234.
I think my patch there makes more sense.
I'm also facing the followup issue in #20.
Which more people experienced but no solution there: #2324587: Rules might be triggered too early in the bootstrap
Comment #23
geek-merlinI'm not really sure, but my gut feeling is that this issue is essentially the same as #2324587: Rules might be triggered too early in the bootstrap.
As over there here too the backtraces indicate that rules does an event cache rebuild too early in the bootstrap process, which leads to whitescreens that are hard to reproduce. So setting critical too, and we might want to close the other issue.
Comment #24
geek-merlinHere's how to reproduce the bug:
drush vset language_default notaserializedlanguageobjectThat hit me and threw gazillions of notices in early bootstrap so surely triggering this bug.
Comment #25
interdruper commentedPatch #22 solved the issue for me. Now the module can be enabled/disabled without drush errors.
Comment #26
alfthecat commentedI think it's too soon to mark this as reviewed and tested as we still have the # 20 issue (for some - on multilingual? - scenarios).
Comment #27
geek-merlinI think we should
* get the patch in - it fixes a coding bug and can be proven it can't harm
* attract fagos attention by setting this rtbc
* decide what to do with the underlying issue - imho "rules is not safe for early bootstrap events"
Comment #28
alfthecat commentedThis is getting really bad. Simply enabling the css_injector module wsod's a site. After the patch from #22 the site still remains dead and produces the error as described in #2324587: Rules might be triggered too early in the bootstrap.
I've been trying latest dev releases of entity api and rules. Deleting cache tables, it all doesn't help. The only option seems to be to restore a backup and uninstall rules as it's a hazard atm.
Comment #30
fagoThanks, I committed the fix from #22. Let's collaborate in #2324587: Rules might be triggered too early in the bootstrap on how to make things less error-prone.
Comment #32
Anselm commentedhttps://www.drupal.org/node/2161847#comment-9179137 worked for me! Thank you!