0

Drupal 8. Every time I enable a new module via the admin pages, I get a blank page with this error message: "The website encountered an unexpected error. Please try again later."

When I navigate back to the modules list page, the module installation appears to have worked fine. But I'm guessing that might not always be the case.

Can somebody help me to debug it?

This error doesn't appear when using drush. I'm on a dev setup (Windows 10, xampp).

Nothing is logged in the report page (admin/reports/dblog), except to say that the module was installed.

In the PHP error logs, I find the following:

[04-Jan-2017 16:36:21 Europe/Paris] Failed to log error: Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array
(
    [:db_insert_placeholder_0] => 1
    [:db_insert_placeholder_1] => php
    [:db_insert_placeholder_2] => %type: @message in %function (line %line of %file).
    [:db_insert_placeholder_3] => a:6:{s:5:"%type";s:45:"Drupal\Core\Database\DatabaseExceptionWrapper";s:8:"@message";s:842396:"SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.: INSERT INTO {batch} (bid, timestamp, token, batch) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array
(
    [:db_insert_placeholder_0] => 15
    [:db_insert_placeholder_1] => 1483544168
    [:db_insert_placeholder_2] => F0e36VAW5PSa8Cjxi0hogaimFU_Z6CpyLaO2FWOS2pw
    [:db_insert_placeholder_3] => a:12:{s:4:"sets";a:5:{i:0;a:15:{s:7:"sandbox";a:0:{}s:7:"results";a:0:{}s:7:"success";b:0;s:5:"start";i:0;s:7:"elapsed";i:0;s:5:"title";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:"

[04-Jan-2017 16:36:21 Europe/Paris] Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array
(
    [:db_insert_placeholder_0] => 1
    [:db_insert_placeholder_1] => php
    [:db_insert_placeholder_2] => %type: @message in %function (line %line of %file).
    [:db_insert_placeholder_3] => a:6:{s:5:"%type";s:45:"Drupal\Core\Database\DatabaseExceptionWrapper";s:8:"@message";s:842396:"SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.: INSERT INTO {batch} (bid, timestamp, token, batch) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array
(
    [:db_insert_placeholder_0] => 15
    [:db_insert_placeholder_1] => 1483544168
    [:db_insert_placeholder_2] => F0e36VAW5PSa8Cjxi0hogaimFU_Z6CpyLaO2FWOS2pw
    [:db_insert_placeholder_3] => a:12:{s:4:"sets";a:5:{i:0;a:15:{s:7:"sandbox";a:0:{}s:7:"results";a:0:{}s:7:"success";b:0;s:5:"start";i:0;s:7:"elapsed";i:0;s:5:"title";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:"

UPDATE

Following Berdir's advice, I have enabled a more dev-friendly Drupal config (example.settings.local.php), and I can now see the error message in its entirety instead of the "unexpected error" generic message.

This error message is HUGE: 2,2MB of text (!), most of it on one line, so I can't reproduce it here entirely. I'll just post a good chunk of its beginning and its ending:

The website encountered an unexpected error. Please try again later.
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => php [:db_insert_placeholder_2] => %type: @message in %function (line %line of %file). [:db_insert_placeholder_3] => a:6:{s:5:"%type";s:45:"Drupal\Core\Database\DatabaseExceptionWrapper";s:8:"@message";s:2255682:"SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.: INSERT INTO {batch} (bid, timestamp, token, batch) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => 17 [:db_insert_placeholder_1] => 1483560842 [:db_insert_placeholder_2] => IULM8yBE6uEsZdvKg8X3RtLYaKgtafNbKHJbfolwoAo [:db_insert_placeholder_3] => a:12:{s:4:"sets";a:4:{i:0;a:15:{s:7:"sandbox";a:0:{}s:7:"results";a:0:{}s:7:"success";b:0;s:5:"start";i:0;s:7:"elapsed";i:0;s:5:"title";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:"*string";s:35:"Updating configuration translations";s:12:"*arguments";a:0:{}s:10:"*options";a:0:{}}s:12:"init_message";s:40:"Starting configuration update<br/>&nbsp;";s:13:"error_message";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:"*string";s:41:"Error updating configuration translations";s:12:"*arguments";a:0:{}s:10:"*options";a:0:{}}s:4:"file";s:35:"core/modules/locale/locale.bulk.inc";s:9:"completed";s:28:"locale_config_batch_finished";s:16:"progress_message";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:"*string";s:29:"Completed @current of @total.";s:12:"*arguments";a:0:{}s:10:"*options";a:0:{}}s:3:"css";a:0:{}s:5:"total";i:10;s:5:"count";i:10;s:5:"queue";a:2:{s:4:"name";s:17:"drupal_batch:17:0";s:5:"class";s:23:"Drupal\Core\Queue\Batch";}}i:1;a:1:{s:11:"form_submit";s:50:"module_filter_system_modules_recent_enabled_submit";}i:2;a:1:{s:11:"form_submit";s:44:"module_filter_system_modules_redirect_submit";}i:3;a:1:{s:11:"form_submit";s:27:"update_storage_clear_submit";}}s:16:"has_form_submits";b:1;s:10:"form_state";O:26:"Drupal\Core\Form\FormState":33:{s:16:"*complete_form";a:32:{s:11:"#attributes";a:2:{s:5:"class";a:1:{

[...]

a:1:{s:20:"data-drupal-selector";s:11:"edit-submit";}s:14:"#title_display";s:6:"before";s:20:"#description_display";s:5:"after";s:7:"#errors";N;s:3:"#id";s:11:"edit-submit";}}s:12:"*temporary";a:0:{}s:22:"*validation_complete";b:1;s:9:"*errors";a:0:{}s:26:"*limit_validation_errors";N;s:20:"*validate_handlers";a:0:{}s:18:"*submit_handlers";a:0:{}}s:11:"progressive";b:1;s:11:"current_set";i:0;s:3:"url";O:15:"Drupal\Core\Url":11:{s:15:"*urlGenerator";N;s:15:"*urlAssembler";N;s:16:"*accessManager";N;s:12:"*routeName";s:22:"system.batch_page.html";s:18:"*routeParameters";a:0:{}s:10:"*options";a:0:{}s:11:"*external";b:0;s:11:"*unrouted";b:0;s:6:"*uri";N;s:15:"*internalPath";N;s:14:"*_serviceIds";a:0:{}}s:10:"source_url";O:15:"Drupal\Core\Url":11:{s:15:"*urlGenerator";N;s:15:"*urlAssembler";N;s:16:"*accessManager";N;s:12:"*routeName";s:19:"system.modules_list";s:18:"*routeParameters";a:0:{}s:10:"*options";a:0:{}s:11:"*external";b:0;s:11:"*unrouted";b:0;s:6:"*uri";N;s:15:"*internalPath";N;s:14:"*_serviceIds";a:0:{}}s:14:"batch_redirect";N;s:5:"theme";s:5:"seven";s:17:"redirect_callback";N;s:2:"id";s:2:"17";s:13:"error_message";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:"*string";s:58:"Please continue to <a href=":error_url">the error page</a>";s:12:"*arguments";a:1:{s:10:":error_url";s:46:"/my-project/www/en/batch?id=17&op=finished";}s:10:"*options";a:0:{}}} ) ";s:9:"%function";s:42:"Drupal\Core\Batch\BatchStorage->doCreate()";s:5:"%file";s:78:"C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\Batch\BatchStorage.php";s:5:"%line";i:159;s:17:"@backtrace_string";s:5074:"#0 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\Database\Connection.php(635): Drupal\Core\Database\Connection->handleQueryException(Object(PDOException), 'INSERT INTO {ba...', Array, Array) #1 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\Database\Driver\mysql\Connection.php(81): Drupal\Core\Database\Connection->query('INSERT INTO {ba...', Array, Array) #2 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\Database\Driver\mysql\Insert.php(32): Drupal\Core\Database\Driver\mysql\Connection->query('INSERT INTO {ba...', Array, Array) #3 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\Batch\BatchStorage.php(159): Drupal\Core\Database\Driver\mysql\Insert->execute() #4 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\Batch\BatchStorage.php(129): Drupal\Core\Batch\BatchStorage->doCreate(Array) #5 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\ProxyClass\Batch\BatchStorage.php(107): Drupal\Core\Batch\BatchStorage->create(Array) #6 C:\xampp\htdocs\my-project\www\core\includes\form.inc(849): Drupal\Core\ProxyClass\Batch\BatchStorage->create(Array) #7 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\Form\FormSubmitter.php(62): batch_process() #8 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\Form\FormBuilder.php(585): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState)) #9 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\Form\FormBuilder.php(314): Drupal\Core\Form\FormBuilder->processForm('system_modules', Array, Object(Drupal\Core\Form\FormState)) #10 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\Controller\FormController.php(74): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\system\Form\ModulesListForm), Object(Drupal\Core\Form\FormState)) #11 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) #12 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #13 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\Render\Renderer.php(574): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #14 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #15 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #16 [internal function]: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #17 C:\xampp\htdocs\my-project\www\vendor\symfony\http-kernel\HttpKernel.php(139): call_user_func_array(Object(Closure), Array) #18 C:\xampp\htdocs\my-project\www\vendor\symfony\http-kernel\HttpKernel.php(62): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #19 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\StackMiddleware\Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\StackMiddleware\KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 C:\xampp\htdocs\my-project\www\core\modules\page_cache\src\StackMiddleware\PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 C:\xampp\htdocs\my-project\www\core\modules\page_cache\src\StackMiddleware\PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\StackMiddleware\ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\StackMiddleware\NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 C:\xampp\htdocs\my-project\www\vendor\stack\builder\src\Stack\StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 C:\xampp\htdocs\my-project\www\core\lib\Drupal\Core\DrupalKernel.php(652): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #27 C:\xampp\htdocs\my-project\www\index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #28 {main}";} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://localhost/my-project/www/en/admin/modules [:db_insert_placeholder_7] => http://localhost/my-project/www/en/admin/modules [:db_insert_placeholder_8] => ::1 [:db_insert_placeholder_9] => 1483560855 ) in Drupal\dblog\Logger\DbLog->log() (line 79 of core\modules\dblog\src\Logger\DbLog.php).

Drupal\dblog\Logger\DbLog->log(3, '%type: @message in %function (line %line of %file).', Array) (Line: 104)
Drupal\dblog\Logger\DbLog->log(3, '%type: @message in %function (line %line of %file).', Array) (Line: 136)
Drupal\Core\Logger\LoggerChannel->log(3, '%type: @message in %function (line %line of %file).', Array) (Line: 65)
Drupal\Core\EventSubscriber\ExceptionLoggingSubscriber->onError(Object) (Line: 92)
Drupal\Core\EventSubscriber\ExceptionLoggingSubscriber->onException(Object, 'kernel.exception', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.exception', Object) (Line: 216)
Symfony\Component\HttpKernel\HttpKernel->handleException(Object, Object, 1) (Line: 70)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
  • It doesn't get logged because apparently the log message is too long to be saved. That's what that error is saying. When working locally, I recommend always use the example.settings.local.php in sites/. Or at least set error display to verbose, so you should see the actual error on the screen. Could be a timeout or another thing that is too big – Berdir Jan 4 '17 at 20:00
  • Thanks for the tip, I didn't know about example.settings.local.php. I've now enabled it and I tried installing another module. Still can't make sense of it, though. :/ I've updated my post with more information. – s427 Jan 4 '17 at 20:36
3

I'm wondering if disabling module_filter fixes this?

EDIT: Unlikely - I think we're just hitting an interesting limit of a batching at the end of the modules form... we add the form state to the batch in \Drupal\Core\Form\FormSubmitter::doSubmitForm()

EDIT2: So the answer turns out to be mysql setting. The innodb_log_file_size needs increasing. See https://stackoverflow.com/questions/15585602/change-limit-for-mysql-row-size-too-large for more. And http://www.md-systems.ch/de/blog/techblog/2012/02/15/improve-mysql-performance is a good place to start for a good my.cnf for Drupal development

  • Indeed, uninstalling the module_filter did not fix the problem. – s427 Jan 5 '17 at 12:34
  • How many contrib and custom modules do you have installed and how many languages? – alexpott Jan 5 '17 at 12:41
  • 1
    Also looking at stackoverflow.com/questions/15585602/… - did you try increasing innodb_log_file_size? md-systems.ch/de/blog/techblog/2012/02/15/… is a good place to start for a good my.cnf for Drupal development – alexpott Jan 5 '17 at 12:44
  • Two languages (English/French), no custom module, and 18 contrib modules installed (I'm counting the subfolders in the "modules" folder, so there's more enabled modules in total)... Although at least 6 of them were not yet enabled when I started seeing this problem. – s427 Jan 5 '17 at 12:58
  • HAH! Indeed, raising the value for innodb_log_file_size (from 5MB to 32MB) did get rid of the problem! Thanks for the tip! – s427 Jan 5 '17 at 13:01
1

So apparently the actual error is "Error updating configuration translations"

I guess you have config_translation enabled?

The fact that this happens when that err happens is thrown is a core bug that we should fix. Not sure what your actual problem is, though and why it results in this.

It is apparently defined as error_message in locale_config_batch_build for the batch that is triggered. I do have seen problems before that this batch loops forever but didn't get this error. It doesn't happen on drush because drush afaik doesn't trigger locale/config_update.

Are you sure that there's nothing else in the logs, some php notices or so?

Update

Looks like I misread that a bit, it seems the original exception is this:

SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.: INSERT INTO {batch} (bid, timestamp, token, batch) ...

so apparently the batch callback is storing a huge amount of data in there so that gets too big. Not sure why it does there, looks like there is a form_state object in there. I suggest you create a core issue.

  • No, I don't see anything more in the PHP error logs at the time the error occurred. And yes, it's a multilingual site so config_translation is enabled. There are only tow languages enabled (English/French), although I noticed that no French translation seems to have been imported at all, which seems to point to a problem there... – s427 Jan 5 '17 at 12:52
  • Following alexpott's suggestion (other answer), I raised the innodb_log_file_size value from 5MB to 32MB in the mysql settings, and it got rid of the problem. – s427 Jan 5 '17 at 13:02
  • Do you think I should still create a core issue? – s427 Jan 5 '17 at 13:10
  • This reminds me: I ran into a similar problem a few years ago, with D7, and it was related to the l10n_update module. Same symptom: huge error message (1,8MB) when trying to install a module. Disabling the l10n_update module made the problem go away. I posted about it on d.o: drupal.org/node/2226963 but never got to solve it... – s427 Jan 5 '17 at 13:16

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.