Symptoms

  • The error message "PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'title' cannot be null" appears in the Drupal error log (admin/reports/dblog)
  • The website takes a lot longer to load the pages on which this error occurs

Investigation

You may find the broken entity by the following drush command:

drush eval 'foreach (entity_get_info() as $entity_type => $entity_info) { empty($entity_info['label']) && var_dump($entity_type, $entity_info); };'

It will print the invalid entity type.

Causes

The cause of the slowing down is simply due to the fact that the detailed error message which is written to the log is absolutely huge, and takes a long time to compute and write! See this post for an example of such a long message.

The cause of the error is when a module (almost certainly a contributed module, unless you are working on a development version of core) does not have a title value.

Solutions

Comments

leymannx’s picture

Had the same error. I use Aurora and finally had to rename the vendor folder to .vendor to prevent breaking Drupal/Drush. Read more here https://github.com/Snugug/generator-aurora/issues/4