Closed (fixed)
Project:
Rules
Version:
7.x-2.x-dev
Component:
Rules Core
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Dec 2010 at 02:28 UTC
Updated:
22 Oct 2012 at 19:36 UTC
I've tried both the alpha3 and -dev releases of Rules today, on an upgraded Drupal site (which had Rules for Drupal 6), and I get the following error on the screen:
The website encountered an unexpected error. Please try again later.
And this error in the logs:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'midweste_midwest.rules_config' doesn't exist: SELECT base.id AS id, base.name AS name, base.module AS module, base.label AS label, base.plugin AS plugin, base.active AS active, base.weight AS weight, base.data AS data FROM {rules_config} base; Array ( ) in EntityAPIController->query() (line 155 of /home/midweste/public_html/sites/all/modules/entity/entity/entity.controller.inc).
If I go into the database and disable the rules module by setting the 'status' column of rules.module to 0, my site comes back alive again. Any ideas as to how I can troubleshoot this further? I have Views 3.x dev, and Entities API beta3.
Comments
Comment #1
geerlingguy commentedWow. That post looks strange - should've proofread first. Basically, it looks like there are no Rules updates available when I run update.php, and, obviously, the rules_config table has never been created on my site.
Comment #2
fagoThis is, as there is no upgrade-path yet.
Comment #3
geerlingguy commentedHmm... Sad face :(
I can't offer too much help here, as I have little to no experience with dbtng, or update scripts and schemas, but I will definitely help with testing, as I have a site without Rules until i can get it upgraded.
Comment #4
rszrama commentedIf I may, I'd say that Rules 1 and Rules 2 are soooo different that attempting an automated upgrade path while very valuable would be a huge waste of resources. I think the best thing for updaters to do will be to backup their sites, uninstall Rules 1, update to D7, install Rules 2, and rebuild their Rules from scratch. I'm not sure what the module itself can or should do other than throw a meaningful error message if someone attempts an update without a complete reinstall.
Comment #5
geerlingguy commentedThen an error message should be thrown, in that case, and in that error message, it would probably be best if it included a link to further information on how to go about manually upgrading. Additionally, some way to wipe out the old Rules tables after an upgrade to Drupal 7 would be greatly appreciated. It stinks that, since I've already upgraded to D7, and don't want to restore back to D6 to uninstall Rules, then re-upgrade, that I now have to manually go in and wipe the Rules tables—and I can imagine that will be a huge upgrade WTF for many users.
A few of my sites use rules more than anything else to do heavy lifting (mostly because I don't have access to the code)... so this is going to be a tough pill to swallow.
Comment #6
rszrama commentedYeah, the method I described would only work if you forced a full uninstall prior to doing the update from D6 to D7.
Comment #7
geerlingguy commentedFor those who need to upgrade manually from D6 1.x to D7 2.x, but already have legacy DB stuff causing Rules to barf on enabling in D7, here are the steps you'll need to take to be able to install Rules:
Comment #8
emcostello commentedWhen you say disable those tables, can you tell me exactly what you mean? I am knew to all of this. I am in myphpadmin and I thought I disabled all of the rules tables but my site is still completely down. Please help!
Comment #9
emcostello commentedOk, I just reverted back to a backup. So is there a way to use rules without it causing a meltdown?
Comment #10
geerlingguy commentedUmm... updated the post above - I meant to say 'Delete' or 'DROP'. Always make backups first, of course.
Comment #11
fagoI've just committed a basic upgrade path to D7, with just makes sure Rules 2.x tables are properly created and keeps the old Rules 1.x tables there. So your rules won't be updated yet.
For updating rules we should probably add a small form somewhere, with which one can manually invoke the rule-update procedure. Leaving the issue open for that.
>Ok, I just reverted back to a backup. So is there a way to use rules without it causing a meltdown?
Yes - use the next dev snapshot and run update.php!
Comment #12
strellman commentedI tried to uninstall Rules UI (so I could uninstall Rules) after upgrading to D7 and got this
Fatal error: Call to undefined function rules_ui() in /home1/explore8/public_html/sites/all/modules/rules/rules_admin/rules_admin.module on line 13
I tried dropping tables and variables as in #7, but update.php still thinks it needs to do something to rules.
Next I'll try removing the rules folder, because it isn't even enabled.
It would be nice if update.php would recognize a d6 rules module and drop the old tables for a clean install.
When you have 30 modules, it is hard to know which ones require complete removal before upgrade to D7
Comment #13
fagook, I worked on that and added the Rules conversion support + an API for contributed modules to define how their actions and conditions should be converted (see api.php). In my tests converting rules way fine - see README.txt for details on how to do it.
I've also added definitions for all the rules integration of Rules 1.x, however those definitions are not yet 100% complete and not well-tested. Mostly, taxonomy rules integration conversion code is not yet complete. Let's handle that in follow-up issues.
Comment #14
alpp commentedhi, what exactly should we do to convert a rule from drupal 6 to the rules in drupal 7?
today i installed the new dev version of rules and tried to import drupal 6 rules and got the following error:
* Import failed.
* Unable to parse the pasted export.
am i missing something about this?
Comment #15
alpp commentedyes i was missing the whole thing. i got how it works and tried for the example rule, it works just fine.
but i have another problem, i need to get the new rules of a module that is not yet ready for drupal 7, is there a way that it can be done thrıugh a import-export base?
Comment #17
focal55 commentedSee readme.txt in module for help Upgrade from Rules 6.x-1.x to Rules 7.x-2.x.