In one of my sites I get a constant error in every second Cron operation. Here is a screenshot from Recent log messages:Screenshot from Recent log messages:

The list is very long, showing only a few lines of Recent log messages.

And this is the error itself:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'slimcom_www.field_data_field_metodika' doesn't exist: SELECT DISTINCT field_data_field_metodika0.entity_type AS entity_type, field_data_field_metodika0.entity_id AS entity_id, field_data_field_metodika0.revision_id AS revision_id, field_data_field_metodika0.bundle AS bundle FROM {field_data_field_metodika} field_data_field_metodika0 WHERE (field_data_field_metodika0.deleted = :db_condition_placeholder_0) AND (field_data_field_metodika0.bundle = :db_condition_placeholder_1) AND(( ( EXISTS (SELECT fm_access.fid AS fid FROM {file_managed} fm_access WHERE ( (fm_access.uri LIKE :db_condition_placeholder_2 ESCAPE '\\') )AND (field_data_field_metodika0.entity_id = fm_access.fid) )) AND (field_data_field_metodika0.entity_type = :db_condition_placeholder_3) )OR (field_data_field_metodika0.entity_type <> :db_condition_placeholder_4) ) LIMIT 200 OFFSET 0; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => metodika [:db_condition_placeholder_2] => public% [:db_condition_placeholder_3] => file [:db_condition_placeholder_4] => file ) in field_sql_storage_field_storage_query() (line 590 of /home/slimcom/public_html/core/modules/field/modules/field_sql_storage/field_sql_storage.module).

A few months ago a strange thing happened with the same site - I had made a Content type with 7-8 custom fields , and then I deleted two of those fields (of type select list if I remember correctly). After deleting, a white screen appears instead of an administrative page for editing the content type (without any message about completed operation or error) clean white screen, the site just disappeared , but then when I go to the front page, everything works fine. The fields are really deleted, they do not appear when editing or creating new content of this type, no other problems arise.

A lot of content of this kind was created on the site after that, there were no problems.

I assume that this error is displayed because something went wrong when deleting the fields and the white screen described above appears, but I'm not sure because I haven't noticed when this error appeared first, it may be due to something else.

It does not interfere with the operation of the site, but it is annoying and I want to fix it and not see more such entries in Recent log messages.

I would be grateful for some guidance on how to resolve this issue, and I also assume that this may be a misbehavior of the system that needs to be investigated, so I decided to publish this post. Thanks in advance.

Comments

I don't know what is causing the problem, but I can say that this is happening every cron run, not every second. If you look closer, you will see that each pair of messages is running within seconds of each other.  That suggests to me that each cron run is generating two messages. First the error and then the "cron run complete" message.

Hopefully someone else can provide insights on the actual cause of the error.

If you look in your config folder do you see any stray config files that didn't get cleared out when you deleted those fields? (e.g. something with field.instance...field_metodika.json in the filename most likely).

If so, backup that file (just in case) and then try removing it from the config folder.

Thank you so much! I will do what is suggested over the weekend and report here what I have found.