Drupal - Error: Call to undefined function system_rebuild_module_data()

I encountered this error when I deleted and tried to re-import my Drupal 8 database. I used the raw 

CREATE DATABASE drupal

thinking this was okay. Here are a couple symptoms:

  1. Error: Call to undefined function system_rebuild_module_data() with drush or
  2. Error message InvalidArgumentException: No check has been registered for access_check.permission on the frontend
  3. Theme without any styling

If you see any of this, and recently did any database work, it may be due to collation settings. To fix, backup your database, and recreate it with:

CREATE DATABASE drupal CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci

and then re-import your data.....Or if you are feeling lucky, use the existing import and run this:

ALTER DATABASE drupal CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

and therefore probably need, for each table,

ALTER TABLE drupal.table CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

 


Leave us a comment!