Upgraded from D6.20 to D7.0, install looked OK but the first thing I do is create a new image style and I get this error

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'tuneup_drupal7.image_effects' doesn't exist: SELECT image_effects.* FROM {image_effects} image_effects ORDER BY image_effects.weight ASC; Array ( ) in image_effects() (line 976 of /home/tuneup/public_html/drupal/modules/image/image.module).

I got a similar error using the Media module so I deleted the database, restored from backup and reinstalled but the problem seems to be in core. I'm running php 5.2.15 and SQL 5.0.91

Thought I'd run it past the forum before submitting a support request (or bug report?)

Cheers

Comments

DiGiT’s picture

I ran into the same problem and found that there is a typo in image.install

image.install version: $Id: image.install,v 1.14 2010/11/21 09:24:41 webchick Exp $

line 231 was: db_create_table('image_effect', $schema['image_effects']);
but should be: db_create_table('image_effects', $schema['image_effects']);

Changing the name of the table image_effect to image_effects via phpmyadmin seems to have resolved my problems.

pfaocle’s picture

Manish Pandya’s picture

You will need to create the same table

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'iwf.field_data_field_the_board_right_side_image' doesn't exist: SELECT DISTINCT field_data_field_the_board_right_side_image0.entity_type AS entity_type, field_data_field_the_board_right_side_image0.entity_id AS entity_id, field_data_field_the_board_right_side_image0.revision_id AS revision_id, field_data_field_the_board_right_side_image0.bundle AS bundle FROM {field_data_field_the_board_right_side_image} field_data_field_the_board_right_side_image0 WHERE (field_data_field_the_board_right_side_image0.deleted = :db_condition_placeholder_0) AND (field_data_field_the_board_right_side_image0.bundle = :db_condition_placeholder_1) LIMIT 10 OFFSET 0;

Now create missing table

CREATE TABLE IF NOT EXISTS `field_data_field_the_board_right_side_image` (
`entity_type` varchar(128) NOT NULL DEFAULT '' COMMENT 'The entity type this data is attached to',
`bundle` varchar(128) NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
`deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted',
`entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
`revision_id` int(10) unsigned DEFAULT NULL COMMENT 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
`language` varchar(32) NOT NULL DEFAULT '' COMMENT 'The language for this data item.',
`delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
`field_the_board_right_side_image_fid` int(10) unsigned DEFAULT NULL COMMENT 'The file_managed.fid being referenced in this field.',
`field_the_board_right_side_image_alt` varchar(512) DEFAULT NULL COMMENT 'Alternative image text, for the image’s ’alt’ attribute.',
`field_the_board_right_side_image_title` varchar(1024) DEFAULT NULL COMMENT 'Image title text, for the image’s ’title’ attribute.',
`field_the_board_right_side_image_width` int(10) unsigned DEFAULT NULL COMMENT 'The width of the image in pixels.',
`field_the_board_right_side_image_height` int(10) unsigned DEFAULT NULL COMMENT 'The height of the image in pixels.',
PRIMARY KEY (`entity_type`,`entity_id`,`deleted`,`delta`,`language`),
KEY `entity_type` (`entity_type`),
KEY `bundle` (`bundle`),
KEY `deleted` (`deleted`),
KEY `entity_id` (`entity_id`),
KEY `revision_id` (`revision_id`),
KEY `language` (`language`),
KEY `field_the_board_right_side_image_fid` (`field_the_board_right_side_image_fid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data storage for field 13 (field_the_board_right_side_image)';

-- Dumping data for table `field_data_field_the_board_right_side_image`
--

gumpdotfr’s picture

I'm just sorry I don't know yet how to use your solution.
I have the choice:
either I backward my installation to an unbugged version of Drupal.
Or, I learn how to create that new table.
It must be too simple for you to explain but I'm new to drupal. Believe it or not I've spend 7days getting through just to get blocked by this bug.

Now I execute the first part of your code in PHPmyADMIN it makes the following error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'iwf.fie' at line 1

I spent sometime unsexfully trying to fix this issue
the second code was taken without trouble.

Maybe the solution might e fund here: https://dev.mysql.com/doc/refman/5.5/en/sql-syntax.html
Could it be a mere space or coma problem ?

31/07/2012 13:32 I might have fund !
http://localize.drupal.org/translate/downloads has NO updated language pack for DRUPAL 7.14 instead there is drupal-7.13.fr.po

Could have this file a specific structure that Drupal 7.14 couldn't interpret?

Manish Pandya’s picture

Hi,

First of all I have described what kind of error I was getting. It's related to my database and tables.

You have deleted a table unknowingly therefore you are getting the same error.

First of all fin dout what kind of error you are getting (which table)

Then check in phpmyadmin, you have that db in phpmyadmin ?
you won't find that table in phpmyadmin because it's not there and therefore you are getting this error.

You will need to make that table in phpmyadmin.

Cheers

Mr. Nx’s picture

PDOException : SQLSTATE[42S02]: Base table or view not found: 1146 Table 'naga8399_drpl1.services_endpoint' doesn't exist: SELECT * FROM {services_endpoint} AS se WHERE se.authentication NOT LIKE:services; Array ( [:services] => %services% ) in services_requirements() (line 101 of /home/naga8399/public_html/sites/all/modules/services/services.install )

i am getting this error, can you please provide me with the query to create my missing table... Pls

rwilson0429’s picture

Why not just delete the table. Seems counter intuitive to create a table that you don't need. A better solution may be to go into mysql and remove the field that is reported as being deleted from 'field_config' and 'field_config_instance'.

This can be done from phpmyadmin or drush.

drush sql-cli
mysql> DELETE FROM field_config WHERE field_name = [‘field_DELETED_FIELD’];
mysql> DELETE FROM field_config_instance WHERE field_name = [‘field_DELETED_FIELD’];

Clear cache after deleting. (for example: drush cc all).

That's what worked for me.

ReggieW

Mr. Nx’s picture

Thank you for the suggestion, looking into the db and removing the corresponding error tables and fields worked for me

dmengstrom’s picture

Hi,

I am getting the following error code and am hoping someone with better knowledge of databases can tell me what this code is referring to as the problem and what can I do to fix the situation. New to Drupal.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'macrevie_mrz.field_data_field_apple_comparison_tool' doesn't exist: SELECT t.* FROM {field_data_field_apple_comparison_tool} t WHERE (entity_type = :db_condition_placeholder_0) AND (entity_id IN (:db_condition_placeholder_1, :db_condition_placeholder_2, :db_condition_placeholder_3, :db_condition_placeholder_4, :db_condition_placeholder_5, :db_condition_placeholder_6, :db_condition_placeholder_7, :db_condition_placeholder_8, :db_condition_placeholder_9, :db_condition_placeholder_10, :db_condition_placeholder_11, :db_condition_placeholder_12, :db_condition_placeholder_13, :db_condition_placeholder_14)) AND (language IN (:db_condition_placeholder_15)) AND (deleted = :db_condition_placeholder_16) ORDER BY delta ASC; Array ( [:db_condition_placeholder_0] => node [:db_condition_placeholder_1] => 12 [:db_condition_placeholder_2] => 23 [:db_condition_placeholder_3] => 24 [:db_condition_placeholder_4] => 1815 [:db_condition_placeholder_5] => 2164 [:db_condition_placeholder_6] => 2176 [:db_condition_placeholder_7] => 2182 [:db_condition_placeholder_8] => 2187 [:db_condition_placeholder_9] => 2194 [:db_condition_placeholder_10] => 2360 [:db_condition_placeholder_11] => 2364 [:db_condition_placeholder_12] => 2365 [:db_condition_placeholder_13] => 2375 [:db_condition_placeholder_14] => 2376 [:db_condition_placeholder_15] => und [:db_condition_placeholder_16] => 0 ) in field_sql_storage_field_storage_load() (line 349 of /home/macrevie/public_html/macreviewzone/drupal/modules/field/modules/field_sql_storage/field_sql_storage.module).

Thanks,
David Engstrom

System Lord’s picture

dmengstrom, I have the exact error related to Privatemsg. I believe I've found why the error occurs but i'm not sure how to fix it. It's the call for the privatemsg settings from previous installs. I did have these tables in my DB but for some stupid reason I deleted them. Now the calls are made to non-existing tables. I found in my DB Cache>>Schema which contains all the references to these "call" and I feel like I can delete the Casche table, but I'm deathly afraid that that is NOT the right thing to do. However, I'm getting desperate to get privatemsg back on my site so I may end up deleting it. Ughh I do not have any DB experience. I shouldn't even be in PhpMyadmin!

Hope someone can help.

I'm wondering if I cant just comment out all the pm_setting calls from the privatemsg.module then finish my reinstall then go back and remove commenting?

UPDATE:

It seems that I have fixed my issue with this error. I went into my DB and did a full DB search for "privatemsg" and then in the results I deleted every reference made to "privatemsg." Error is gone and module installed fine.

startupright’s picture

Hi I'm having the same problem but with a different table - cache_page. If I do create this table myself how do I know what fields/columns to add to this table?

Clark Zhang’s picture

Hi, after import DB, I got the issue too.
Try:
drush updb
works for me.
Put these here if someone needed. :)

kambingfazil’s picture

check your settings.php and make sure your 'prefix' => '', is same prefix with your exported database

fkiner’s picture

This one worked for me. Thanks.