I setup a rule to redirect users when a page is going to be viewed. As soon as I saved the rule I cannot go to any page because I set the redirect improperly. I am in the database and dropped/emptied the 3 tables I could find for rules which are; rules_rules, rules_sets and rules_scheduler. No luck on fixing the site. Whenh I manually delete the rules folder the site does get fixed, so I do know it is an issue with rules that I created. Any help would be great!

Comments

archnode’s picture

Component: Rules Core » Rules Engine

Go to your "system" table and set the status of rules to 0, put your rules folder back in and try to uninstall the module normally. Generally it's not recommended to either delete/empty tables or module folders that are in use.

Generally getting a redirect loop with rules is quite possible, but not the fault of rules.

jrivelli’s picture

Thank you for this advice. It was not rules fault. It was my fault. I use rules all the time and it's GREAT. I just set this poorly lol.

mitchell’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

deaconzero’s picture

deaconzero’s picture

Status: Closed (fixed) » Active

I have the same problem though I don't see rules in my system table. Any thoughts?

kbk’s picture

If you have rules in your /sites/all/modules folder then it should show up in the database table "systems" under the field "name". Change the status to 0, as mentioned above. It's also a good idea to truncate (empty) the "cache rules" table while you are in there.

klausi’s picture

Status: Active » Fixed

Reopen if still an issue.

deaconzero’s picture

I fixed it, but in a round about way. I never did see rules inside my system table, which is why I had to figure out another way. Thanks though :)

- Nick

Status: Fixed » Closed (fixed)

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

mck.koz’s picture

Status: Closed (fixed) » Active

I'm having a similar problem. I placed Rules into sites/all/modules, navigated to the Modules admin page and activated Rules and the Rules UI. After I saved, many links on my admin page were gone including the link to administer modules.

At first, I just deleted the Rules folder from sites/all/modules and had no luck so I searched the issue queue and found this post. I then followed the instructions to set the Status values in the System table to 0 and also cleared the Rules cache while leaving the Rules folder in place. Still no luck.

This is a major issue for me as I cannot properly admin my site, so prompt replies are greatly appreciated.

Thanks,

Mike

kbk’s picture

Status: Active » Closed (fixed)

First, I think your problem is different than the ones in this issue because (it seems) you didn't create any rules that would get you stuck in a loop. Did you run update.php after installing rules (then clear all caches, etc.)? After that, I would 1) check permissions, 2) remove Rule from modules folder and run update.php.
If nothing then, you should consider a new issue.

herb_miller’s picture

When I caused the infinite redirect I found that I needed to change the status of rules_admin to 0 as well.
Note: I had NOT deleted the rules modules.

kenneth001’s picture

just want to say thanks for this post it saved my life. I had rules stuck in a loop, and had to delete it. every time i reinstall, i was stuck in the same loop but after finding this post im back up and running...we all make mistakes.

Mat77’s picture

I had the same problem: just created a rule redirecting to a wrong URL, and no condition to the rule (no comment...).
So everytime I tried to access a page, I was either redirected to the wrong URL, or got an error (Too many redirection).

Here is how I fixed it (no need to uninstall the rules module):

Go to your database, table "rules_rules".
Delete the problematic rule. It's a serialized array, so kind of hard to read i agree, but you can still find out the title of your rule quite easily. It's most likely one of the last rows of the table.

Go to your database, table "cache_rules". Empty it.

I also flushed my "cache" table, but I don't think it was necessary.

Tada ! You can access your website now !

Hope this can help ;)

Mat

kenneth001’s picture

mat77 thank you but i uninstalled the rule module drop the rules tables and clear the cache, i then reinstalled the rules module and know im getting errors, after i reinstalled the modules. is there anything i can d to fix this problem?

user warning: Table 'MYsitesname.cache_rules' doesn't exist query: SELECT data, created, headers, expire, serialized FROM cache_rules WHERE cid = 'include_rules' in /home/content/45/7823145/html/includes/cache.inc on line 25.
user warning: Table 'mysitesname.cache_rules' doesn't exist query: UPDATE cache_rules SET data = 'a:18:{i:0;s:55:\"sites/all/modules/relativity/rules/rules.data_types.inc\";i:1;s:54:\"sites/all/modules/relativity/rules/rules.variables.inc\";i:2;s:61:\"sites/all/modules/relativity/rules/rules.input_evaluators.inc\";i:3;s:41:\"./sites/all/modules/boost/boost.rules.inc\";i:4;s:62:\"./sites/all/modules/relativity/rules/modules/comment.rules.inc\";i:5;s:59:\"./sites/all/modules/relativity/rules/modules/node.rules.inc\";i:6;s:59:\"./sites/all/modules/relativity/rules/modules/path.rules.inc\";i:7;s:58:\"./sites/all/modules/relativity/rules/modules/php.rules.inc\";i:8;s:61:\"./sites/all/modules/relativity/rules/modules/system.rules.inc\";i:9;s:63:\"./sites/all/modules/relativity/rules/modules/taxonomy.rules.inc\";i:10;s:59:\"./sites/all/modules/relativity/rules/modules/user.rules.inc\";i:11;s:50:\"./sites/all/modules/cck/includes/content.rules.inc\";i:12;s:69:\"./sites/all/modules/cck/modules/nodereference/nodereference.rules.inc\";i:13;s:69:\"./sites/all/modules/cck/modules/userreference/userreference.rules.inc\";i:14;s:67:\"./sites/all/modules/rules/rules_scheduler/rules_scheduler.rules.inc\";i:15;s:38:\"./modules/acquia/token/token.rules.inc\";i:16;s:60:\"./sites/all/modules/relativity/rules/modules/rules.rules.inc\";i:17;s:59:\"./sites/all/modules/rules/rules_forms/rules_forms.rules.inc\";}', created = 1307542435, expire = 0, headers = '', serialized = 1 WHERE cid = 'include_rules' in /home/content/45/7823145/html/includes/cache.inc on line 108.
user warning: Table 'mysitesname.cache_rules' doesn't exist query: SELECT data, created, headers, expire, serialized FROM cache_rules WHERE cid = 'set_event_init' in /home/content/45/7823145/html/includes/cache.inc on line 25.
user warning: Table 'mysitesname.cache_rules' doesn't exist query: SELECT data, created, headers, expire, serialized FROM cache_rules WHERE cid = 'include_rules' in /home/content/45/7823145/html/includes/cache.inc on line 25.
user warning: Table mysitesname.cache_rules' doesn't exist query: UPDATE cache_rules SET data = 'a:18:{i:0;s:55:\"sites/all/modules/relativity/rules/rules.data_types.inc\";i:1;s:54:\"sites/all/modules/relativity/rules/rules.variables.inc\";i:2;s:61:\"sites/all/modules/relativity/rules/rules.input_evaluators.inc\";i:3;s:41:\"./sites/all/modules/boost/boost.rules.inc\";i:4;s:62:\"./sites/all/modules/relativity/rules/modules/comment.rules.inc\";i:5;s:59:\"./sites/all/modules/relativity/rules/modules/node.rules.inc\";i:6;s:59:\"./sites/all/modules/relativity/rules/modules/path.rules.inc\";i:7;s:58:\"./sites/all/modules/relativity/rules/modules/php.rules.inc\";i:8;s:61:\"./sites/all/modules/relativity/rules/modules/system.rules.inc\";i:9;s:63:\"./sites/all/modules/relativity/rules/modules/taxonomy.rules.inc\";i:10;s:59:\"./sites/all/modules/relativity/rules/modules/user.rules.inc\";i:11;s:50:\"./sites/all/modules/cck/includes/content.rules.inc\";i:12;s:69:\"./sites/all/modules/cck/modules/nodereference/nodereference.rules.inc\";i:13;s:69:\"./sites/all/modules/cck/modules/userreference/userreference.rules.inc\";i:14;s:67:\"./sites/all/modules/rules/rules_scheduler/rules_scheduler.rules.inc\";i:15;s:38:\"./modules/acquia/token/token.rules.inc\";i:16;s:60:\"./sites/all/modules/relativity/rules/modules/rules.rules.inc\";i:17;s:59:\"./sites/all/modules/rules/rules_forms/rules_forms.rules.inc\";}', created = 1307542441, expire = 0, headers = '', serialized = 1 WHERE cid = 'include_rules' in /home/content/45/7823145/html/includes/cache.inc on line 108.
user warning: Table 'mysitesname.rules_rules' doesn't exist query: SELECT * FROM rules_rules ORDER by name in /home/content/45/7823145/html/sites/all/modules/relativity/rules/rules.module on line 798.
user warning: Table 'mysitesname.cache_rules' doesn't exist query: SELECT data, created, headers, expire, serialized FROM cache_rules WHERE cid = 'include_rules_defaults' in /home/content/45/7823145/html/includes/cache.inc on line 25.
user warning: Table 'mysitename.cache_rules' doesn't exist query: UPDATE cache_rules SET data = 'a:0:{}', created = 1307542441, expire = 0, headers = '', serialized = 1 WHERE cid = 'include_rules_defaults' in /home/content/45/7823145/html/includes/cache.inc on line 108.
user warning: Table 'mysitename.rules_sets' doesn't exist query: SELECT * FROM rules_sets ORDER by name in /home/content/45/7823145/html/sites/all/modules/relativity/rules/rules.module on line 798.
user warning: Table 'mysitenae.cache_rules' doesn't exist query: TRUNCATE TABLE cache_rules in /home/content/45/7823145/html/includes/cache.inc on line 171.

kenneth001’s picture

is there anything i can do to get rules to work again on my site?

kenneth001’s picture

problem fixed. what i did was create another localhost site with the same name. i then installed the rules module on the localhost site.
went to phpmyadmin on the localhost site and exported the rules table all four of them. then i imported them in the phpmyadmin on my live site. then i ran a php update and did a cron run. i can know use rules again.

barraponto’s picture

@kenneth001 please follow that issue in #282824: Tables aren't installed in first installation, I'll post there too.