Hi all!
I am having an error on activating the module by drush.
the error is:
Fatal error: Class 'RulesEventSet' not found in [...]modules/contrib/rules/rules.module on line 336

it breaks the site completely.

as I couldn't do anything, I commented out the line, and at least could disable the module by drush, as by interface it would give other error about class RulesLog not found.

If a similar issue already existss (I couldn't find any), please point me towards it.

Comments

strawman’s picture

yup. Whole site fully down now... :(
Not even using Drush. Just the regular install.
Any solution?

strawman’s picture

Could really use a hand on this as I'm needing the awesomeness of Rules...
I have the domain module installed which was my only thought as to why it might have some issues but am unsure. I've looked around and have spotted some other folk in the same situation though not necessarily on a clean install.
Currently running:
Drupal 7.28
ctools 1.4
date 2.7
domain access 3.11
service links 2.2
views 3.8
jquery update 2.4
ckeditor 1.14

and a few smaller modules that I feel would be outside of the issue considering what they do and what I've looked at within their code.

I currently have Rules 2.7 installed on a Drupal 7.26 site, so I'm not sure if there is a conflict between 7.28 and 7.26 with Rules.

The error I'm receiving is the same as dunecat lists in the main description.

Any other info needed?

strawman’s picture

So Dunecat,

I came accross a patch that will atleast get the module installed. Its from another issue but seemed to work at least. The patch is located here. : https://drupal.org/files/1541888-rules-RulesEventSet-10.patch
The line numbers are different since its for an older version but apparently it works well. At least Rules is installed and working well so far.

so apply the patch to line 336 instead of the line 224 mentioned in the patch.

Hope this helps :)

kappaluppa’s picture

Did you ever figure out what is happening here? I am getting this error everytime I run update.php, and same thing- site goes down. I just have to reload the page and and the site comes back.

This happened with Drupal 7.27 & now 7.28. I'm also using Rules 7.x-2.7.

strawman’s picture

I basically followed this thread here:
https://www.drupal.org/node/1541888#comment-8864473

And applied the patch mentioned in comment 15

All is backup and running apparently even with my recent update to D 7.28 :)
Hope this helps.

dunecat’s picture

@strawman

sorry, I kind of fell out of the loop lately. Thanks a lot for your suggestion.
I didn't try the patch yet, as I figured that I didn't have to use rules for what I needed finally. I will let you know as soon as I try to apply it.

@kappaluppa
I think this issue/thread might be relevant for the explanation of what's going on and why everything crashes
https://www.drupal.org/node/2090511
I have an impression that with 2.7 version something similar going on.

bigbozz’s picture

Same problem here.

(well-known) solution that make the site work again after WSOD. Delete the module on ftp.
[sitename]/sites/all/modules/rules.

@Strawman: no conflict between 7.26 en 7.28. I have 7.28 and the same problem.
But when i try to apply the patch, i get serval other errors... Do i something wrong?

EDIT: sorry, the patch and the module works fine now. I had forgotten a '}' in the code. Forget what I said please.

fyberoptik’s picture

Same issue, I deleted the module from the directory and refreshed the site.

Managed to comment out the lines 334 to 337 in rules.module, this let me re-enabled the rules module successfully.

I then undid the changes to lines 334-337 and the module is working fine now.

Bit of a hack and not ideal, but got the job done.

Martin.’s picture

StatusFileSize
new621 bytes

I created the patch for this version using the patch given in comment #5. It allows to install the project correctly.

begun’s picture

The patch in #9 solved this issue on my system.

dave kopecek’s picture

I was able to fix my WSOD with REGISTRY REBUILD:

https://www.drupal.org/project/registry_rebuild

This doesn't fix the cause of the underlying issue, but once the registry was rebuilt everything seemed to click back into place.

burningdog’s picture

Status: Active » Reviewed & tested by the community

I had the same issue - couldn't even enable Rules on a site because of this error. Patch at #9 fixed it.

I don't see any downsides of wrapping RulesEventSet::rebuildEventCache(); in a if (class_exists('RulesEventSet')) { statement.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 9: Rules-RulesEventSet-2275963.patch, failed testing.

druderman’s picture

This work-around seems to work for our server environment here which was exhibiting the problem. I think it has to do with APC and opcode caching and race conditions. It actually installs just fine in my LAMP stack and elsewhere.

Site Fix

  • Delete Rules module directory from your site

Getting Rules to Work

  1. Download Rules 7.x-2.3
    $ drush --select dl rules
  2. Enable Rules
    $ drush en rules
  3. Download latest version of Rules
    $ drush dl rules
  4. Perform database updates
    $ drush updatedb

This issue is probably related.
https://www.drupal.org/node/2090511

rlmumford’s picture

Priority: Major » Critical

This is definitely critical. The idea that a module as important as rules can't be installed on any sites is insane!

theroyal’s picture

Druderman,
Thanks, your #14 solution seems to fix my problem,
I was not able to enable rules 2.7 on drupal 7.34 , it gives me WSOD,
but after deleting rules module from my module directory,
then downloaded v 2.3 and enabeling it, it didnt crash,
then deleted the rules directory
then downloading rules 2.7
then run update.php
it fixed 4 changes, i think one of them or more was my problem.
and now rules is working
but i need to test it deeply.

Thanks man you made my day :) after 4 hard days and nights. :)

btopro’s picture

confirming this issue. wasn't even able to undo via registry_rebuild (a new 1st for me!) and had to disable via database system table THEN run registry rebuild

btopro’s picture

Status: Needs work » Needs review
StatusFileSize
new462 bytes

re-roll of this patch, fixes issue for me and on to OTHER issues similar :)

Status: Needs review » Needs work

The last submitted patch, 18: rules-fatalerror-RulesEventSet-2275963-18.patch, failed testing.

markchitty’s picture

+1 on the fix in #14.

fago’s picture

Version: 7.x-2.7 » 7.x-2.8
Status: Needs work » Postponed (maintainer needs more info)

Rules 2.8 received some improvements which make it not run when drupal is not boostrapped. Please, verify the issue is there with 2.8 or later as well.

satoj’s picture

I applied # 9 "Rules-RulesEventSet-2275963.patch" on this page and the error was resolved. Thank you very much!
In addition to this error, an error occurred in the flag module, so it was patched together.

alexanderpas’s picture

Title: Fatal error: Class 'RulesEventSet' not found » Fatal error: Class 'RulesEventSet' not found in /sites/all/modules/rules/rules.module on line 391
Version: 7.x-2.8 » 7.x-2.9
Status: Postponed (maintainer needs more info) » Needs work

Just got it on Pantheon after clearing caches trough the dashboard, with Rules 2.9

For reference: Before clearing caches trough the dashboard, I was having the Unable to allocate memory for pool. warning from this article:

https://pantheon.io/docs/articles/sites/what-is-apc-and-what-is-it-used-...

After about 15 minutes, the error went away, but it is reproducable.

magicmyth’s picture

I've just run into this issue myself but not on a new install of Rules but a site that has recently upgraded to Rules 2.9. It does not appear to trigger on all pages but certainly does on dblog and the maintenance page. The issue did not show itself right away but a couple days later. The patch from 18 allowed the site to function again but that seems to be more of a workaround than a real solution. I have a near identical site that has yet to hit this issue so I'm not sure what the criteria for causing it is.

I was wondering if anyone here is using Elysia Cron running frequently via a crontab triggered drush command? I am seeing a lot of:

Warning: require_once(): Unable to allocate memory for pool. in menu_execute_active_handler()

and every once in a while

Cache rebuild lock hit

in my logs. Anyone else see similar when they get this issue? PHP has 256mb of memory available to it so I'm surprised to see an unable to allocate memory error.

I've modified the patch slightly so that it logs when the RulesEventSet class cannot be found so I can better keep an eye on the issue and hopefully find a clue to report.

chrisnovak’s picture

Wanted to let people know on this thread that I saw this error on a production site where the client said they had not changed anything. After running registry rebuild which fixed the issue, we realized that there were PHP out of memory issues being logged. Looks like out of memory issues can cause the registry to be corrupt?

vacilando’s picture

drush rr solves this indeed.

oleksii.tsulun’s picture

Hi!

I've uploaded the patch for Rules 7.x-2.7.

tormi’s picture

Version: 7.x-2.9 » 7.x-2.x-dev
Status: Needs work » Needs review
StatusFileSize
new497 bytes

Patch against 7.x-2.x-dev.

tr’s picture

Status: Needs review » Closed (duplicate)