On a site I inherited, I can see cache_form is empty. It has been truncated some time ago. I have got an error crashing my site when accessing many type of forms: views exposed forms, forms to edit Views and node edit forms. The error is a MYSQL Incorrect key file error and is triggered by clear_cache_all(). There is an attempt to DELETE FROM cache_form, where a given form ID is found. However the table is empty so it does not work. I do not know why Drupal has to delete a cache entry from the table even for a new node. Is there a way to bypass the step where Drupal try to delete the cache entry?


This sounds like someone tried to do some optimization to {cache_form} through a MySQL interface and did something that makes it incompatible with Drupal, or the table is damaged due to a dull disk (see this happen before).

First make sure you have free disk space, and then do a CHECK TABLE cache_form; and see if there are any errors. If you see some, you can try the standard repair techniques, but it is often best to just re-create the table.

These steps are dangerous and can destroy your site. Make sure you have backups.

To re-create {cache_form} I would

Start a MySQL interface , and delete {cache_form}, eg DROP TABLE cache_form;

Recreate the table from a known good Drupal 7 install. I think this is the default:

CREATE TABLE `cache_form` (
  `cid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.',
  `data` longblob COMMENT 'A collection of data to cache.',
  `expire` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
  `created` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry was created.',
  `serialized` smallint(6) NOT NULL DEFAULT '0' COMMENT 'A flag to indicate whether content is serialized (1) or not (0).',
  PRIMARY KEY (`cid`),
  KEY `expire` (`expire`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Cache table for the form system to store recently built...';
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.