Hi Folks,

I'm not sure what I had done to cause this but now I'm getting 2 errors:

1. Warning: Cannot modify header information - headers already sent by (output started at /home/elfac/elfac.ca/drupal/includes/common.inc:2567) in drupal_send_headers() (line 1018 of /home/elfac/elfac.ca/drupal/includes/bootstrap.inc).

2. PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'elfac_dev.field_deleted_data_13' doesn't exist: SELECT field_deleted_data_130.entity_type AS entity_type, field_deleted_data_130.entity_id AS entity_id, field_deleted_data_130.revision_id AS revision_id, field_deleted_data_130.bundle AS bundle FROM {field_deleted_data_13} field_deleted_data_130 WHERE (field_deleted_data_130.deleted = :db_condition_placeholder_0) AND (field_deleted_data_130.bundle = :db_condition_placeholder_1) LIMIT 10 OFFSET 0; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => sermon ) in field_sql_storage_field_storage_query() (line 553 of /home/elfac/elfac.ca/drupal/modules/field/modules/field_sql_storage/field_sql_storage.module).

For the second error... I deleted a field from CCK, which the system created field_deleted_data_13. Then from MySQL I dropped the field_deleted_data_13. I guess the system doesn't like this, and is still trying to reference the table somewhere.

I've tried flushing all cache and search entries, and I no longer have any views, and I've tried exporting the whole database and searching where the "field_deleted_data_13" table is still referenced; unfortunately, there isn't anything.

These 2 errors are happening on all pages, which I believe is preventing my CRON from running.

I appreciate someone can guide me in the right direction to resolve this issue.

Thanks.

Comments

ERWood’s picture

I had the EXACT same two messages mysteriously appear yesterday two after deleting a field_. Can't find where the system is still storing the field I deleted either.

I too would love any help in fixing this!

cloporto’s picture

Exactly the same problem! Did you find a solution?

Thanks

ivan.baca’s picture

i have found one. There is a table in drupal called field_config and there is old version of the field still there. Remove it and it should start to work. It helped me.

soshial’s picture

Title: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 » PDOException: SQLSTATE[42S02]: 'field_deleted_data_' doesn't exist
Category: support » bug
Priority: Normal » Major

I had the same issue in module-uninstall function trying to run field_purge_batch() after deleting some fields and their instances.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'synopsis_library.prf_field_deleted_data_5' doesn't exist: SELECT DISTINCT field_deleted_data_50.entity_type AS entity_type, field_deleted_data_50.entity_id AS entity_id, field_deleted_data_50.revision_id AS revision_id, field_deleted_data_50.bundle AS bundle FROM {field_deleted_data_5} field_deleted_data_50 WHERE (field_deleted_data_50.deleted = :db_condition_placeholder_0) AND (field_deleted_data_50.bundle = :db_condition_placeholder_1) LIMIT 0 OFFSET 0; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => book ) in field_sql_storage_field_storage_query() (line 577 of /srv/www/htdocs/modules/field/modules/field_sql_storage/field_sql_storage.module).

Removing the specified fields from field_config does help avoiding the problem but does not help get rid of the redundant tables (..._field_data_field_... and ..._field_revision_field_...).

jahalapeno’s picture

I've had almost exactly the same error, only with it being unable to locate the table for body instead of deleted data. Here's the message.

•	Warning: Cannot modify header information - headers already sent by (output started at website/includes/common.inc:2562) 
in drupal_send_headers()  (line 1039 of website/includes/bootstrap.inc).
•	PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'website.field_data_field_body' doesn't exist: 
SELECT field_data_field_body0.entity_type AS entity_type, field_data_field_body0.entity_id AS entity_id, 
field_data_field_body0.revision_id AS revision_id, 
field_data_field_body0.bundle AS bundle FROM {field_data_field_body} field_data_field_body0 WHERE (field_data_field_body0.deleted = :db_condition_placeholder_0) AND (field_data_field_body0.bundle = :db_condition_placeholder_1) LIMIT 10 OFFSET 0; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => new_home_page ) in field_sql_storage_field_storage_query() 
(line 568 of website/modules/field/modules/field_sql_storage/field_sql_storage.module).

This occurred after installing a new theme, and the PageTheme module to try it out on a few test pages before applying it to the whole site. I created and deleted a new content type with a field "body" once or twice, and sometime around then every page on the site started throwing this error. Additionally, the new theme wouldn't apply the custom CSS to the pages it was assigned, it would load the default schema. It would save the settings in the interface, but throw this error and not apply the colors.

•	Notice: Undefined index: text in _color_rewrite_stylesheet() (line 448 of website/modules/color/color.module).
•	Notice: Undefined index: text in _color_rewrite_stylesheet() (line 448 of website/modules/color/color.module).

To clarify, the header and PDOException are occuring on all pages, regardless of theme.

I talked to some folks around the office about this, and one of the more experienced drupal users told me it likely isn't field_config's problem, but rather something with the theme. We ran update.php, and that had no effect either. Any ideas what might have caused this/how to resolve it?

ressa’s picture

I am not using this install profile, but after removing some fields from a content type I also ended up with a few extra tables named like this: FIELD_NAME.field_deleted_data_NUMBER

I removed the fields from the tables 'field_config' and 'field_config_instance', and now don't get the error message after running cron any longer.

greggles’s picture

Project: SQL » Drupal core
Version: 5.x-1.x-dev » 7.x-dev
Component: Code » field system
Category: bug » support
Status: Active » Fixed

This issue is in drupal core, not the SQL project.

There's a description of how to fix it at http://drupal.stackexchange.com/questions/27158/error-when-deleting-some...

Status: Fixed » Closed (fixed)

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