Hi,

I was unable to install relation on one of my sites and after much struggle, I determined that the apachesolr module was triggering this error when installing relation:

WD php: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal-7-mbase.relation_type' doesn't exist: SELECT [error]
t__0.*
FROM 
{relation_type} t__0; Array
(
)
 in ctools_export_load_object() (line 457 of ...sites/all/modules/ctools/includes/export.inc). [0.67 sec, 42.79 MB]

A basic workaround is to preload the relation tables from a working installation. But I would like to solve this problem since I am hoping to share my relation configuration as a Feature. If I install relation first, then apachesolr, all goes well. I'll do some more testing to verify that I can actually create relation types and index content, etc. But, again, I want to be able to install the new feature on instances that are already running apachesolr.

I tested this on a clean minimal D7.12 installation with the following versions of relevant modules:
apachesolr 7.x-1.0-beta16
ctools 7.x-1.0-rc1+116-dev
relation 7.x-1.0-beta3+60-dev

I had the the same results, thought, using various version combinations of ctools/relation and apachesolr.

There error seems related to these closed issues, so not sure if this is a duplicate: http://drupal.org/node/1333996 and http://drupal.org/node/1144156

Thanks for any suggestions on how to troubleshoot further. In the scond issues (above), chx says, "... somehow you got into relation_get_types when the module is not yet installed?" I'll try to dump a stack trace in there and see if I can figure out some more.

-Travis

Comments

johnnykrisma’s picture

Just a "me too" on this error. Just recently installed Relation and turned it on, and I get this error.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ucdc_drupal.relation_type' doesn't exist: SELECT t__0.* FROM {relation_type} t__0; Array ( ) in ctools_export_load_object() (line 457 of \sites\all\modules\ctools\includes\export.inc).
The website encountered an unexpected error. Please try again later.

Ended up removing the module folder and the site came back. Tried RC1 this morning pin the hopes that the offending issue was gone, but same outcome.

~John

chx’s picture

Does this happen if you don't have ctools? We no longer require ctools. I am aware apachesolr doing unholy things during install, alas. I am not sure I will not refuse fixing this.

travismccauley’s picture

I just tried again with a clean drupal core v7.12, apachesolr-beta16 and relation-rc2. No Ctools. I'm seeing the same problem. I'm not using relation module right now so this is not urgent for my use.

WD php: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table                [error]
'd7-sandbox.relation_type' doesn't exist: SELECT rt.relation_type AS relation_type, rt.label AS
label, rt.reverse_label AS reverse_label, rt.directional AS directional, rt.transitive AS
transitive, rt.r_unique AS r_unique, rt.min_arity AS min_arity, rt.max_arity AS max_arity
FROM 
{relation_type} rt; Array
(
)
 in relation_get_types() (line 471 of sites/all/modules/relation/relation.module).
zeip’s picture

Happened for me too when I tried to enable Relation on an existing site. However, it seems that the site doesn't have Solr installed (though it has a vast list of other modules.) The error was from Ctools export, since that's enabled also.

dzieyzone’s picture

Install the relation_endpoint first before installing the relation module solves the problem.

mikran’s picture

Status: Active » Closed (cannot reproduce)

relation_endpoint is dependency to relation now at least so I assume this bug is not valid anymore. I was unable to reproduce with the latest version of all mentioned modules.

mikran’s picture

Issue summary: View changes

editing out redundant error msg