Try to install any module with commits 754536aae580854ca3bc8a00bde39fe68a3df5a3 (from earlier today) or 68ce258d630aa8715d8adce6ef1a624a4e3917de (latest ATM).

You will be greeted with

Additional uncaught exception thrown while handling exception.

Original

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1: DELETE FROM {cache} WHERE (cid IN ()) ; Array ( ) in Drupal\Core\Database\Connection->query() (line 569 of /Users/wim.leers/Work/drupal-tres/core/lib/Drupal/Core/Database/Connection.php).

Additional

Exception: theme() may not be called until all modules are loaded. in theme() (line 522 of /Users/wim.leers/Work/drupal-tres/core/includes/theme.inc).

This happens when trying to enable the Actions, Language, Interface Translation or Testing modules. So I assume this happens for any module that you try to enable. Gábor Hojtsy tried this also, he was able to reproduce this. But after installing his site in a custom language right out of the box (e.g. Hungarian), he was able to install modules without problems.


Furthermore, it seems that the installation sometimes succeeds partially. I once got this after enabling Interface Translation:

InvalidArgumentException: Invalid translation language (en) specified. inDrupal\Core\Entity\ContentEntityBase->getTranslation() (line 656 of /Users/wim.leers/Work/drupal-tres/core/lib/Drupal/Core/Entity/ContentEntityBase.php).

and now after enabling Actions, I get this:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1: DELETE FROM {cache} WHERE (cid IN ()) ; Array ( ) in Drupal\Core\Cache\DatabaseBackend->deleteMultiple() (line 208 of /Users/wim.leers/Work/drupal-tres/core/lib/Drupal/Core/Cache/DatabaseBackend.php).
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1: DELETE FROM {cache} WHERE (cid IN ()) ; Array ( ) in Drupal\Core\Database\Connection->query() (line 569 of core/lib/Drupal/Core/Database/Connection.php).
Symfony\Component\Routing\Exception\RouteNotFoundException: Route "action.admin" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 127 of /Users/wim.leers/Work/drupal-tres/core/lib/Drupal/Core/Routing/RouteProvider.php).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers’s picture

Issue summary: View changes
Gábor Hojtsy’s picture

Seems to be related to trying to enable Lnaguage first, which itself drop this error:

"right syntax to use near '))' at line 1: DELETE FROM {cache} WHERE (cid IN ()) ; Array ( ) in Drupal\Core\Database\Connection->query()"

THEN trying to enable modules like action will produce the same cache error and also

"Symfony\Component\Routing\Exception\RouteNotFoundException: Route "action.admin" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() "

Gábor Hojtsy’s picture

Which makes the admin/modules page permanently hosed with the route error too :D

Wim Leers’s picture

Title: Drupal 8 HEAD broken: cannot install any module » Drupal 8 HEAD broken: installing Language module fails, after that cannot install any other module
Wim Leers’s picture

I was able to confirm Gábor's hypothesis/test results. The title is updated accordingly.

Furthermore, Alex Pott has indicated that this only happens in the Standard install profile.

Berdir’s picture

Can not reproduce, installing language works just fine here, with standard.

While not on standard, we have a crazy menu test that enables every.single.module. and then uninstalled them. If this would be a generic problem, I can't see how that could not fail when you have errors like this?

What's your environment? PHP version, ...

Also, in deleteMultiple(), check for an empty array and if so, print out the backtrace with debug_print_backtrace(DEBUG_BACKTRACE_NO_ARGS) to see where this is coming from.

alexpott’s picture

Status: Active » Needs review
FileSize
2.52 KB
3.62 KB

This being caused by language_list returning an empty array during module installation. Test only patch and fix attached.

amateescu’s picture

Gábor Hojtsy’s picture

+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageListModuleInstallTest.php
@@ -0,0 +1,50 @@
+    // Since language_list uses static caches we need to do this be enabling
+    // the module using a the UI.

+++ b/core/includes/bootstrap.inc
@@ -2429,7 +2429,10 @@ function language_list($flags = Language::STATE_CONFIGURABLE) {
+    // If the language module is enable but the configuration has not been
+    // written yet the returning an empty language list will cause errors. For
+    // example the cache clear in search_module_preinstall().
...
diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageListModuleInstallTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageListModuleInstallTest.php

Fix/test looks good. Only found English errors :)

"the returning an empty language" and

"do this be enabling ... using a the UI"

Otherwise would be easy to RTBC :)

Gábor Hojtsy’s picture

#2156945: Clean up installer entity defaults following bugfix is the same problem indeed, the empty language list temporarily. The added test will also be great to ensure #1862202: Objectify the language system will not reintroduce this issue :)

webchick’s picture

I'm comfortable fixing those English problems, as well as "If the language module is enable" on commit, so if that's all that's stopping you, go for the light green button. :D

The last submitted patch, 7: 2171015.7.will-fail.patch, failed testing.

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Regression, +D8MI, +language-base

Looks good, works well :)

Dries’s picture

Priority: Critical » Minor
Status: Reviewed & tested by the community » Needs work

Committed to 8.x. Some minor language issues that need to be addressed so leaving as 'needs works'.

webchick’s picture

Title: Drupal 8 HEAD broken: installing Language module fails, after that cannot install any other module » [Docs follow-up] Drupal 8 HEAD broken: installing Language module fails, after that cannot install any other module
Status: Needs work » Needs review
FileSize
1.64 KB

OOOH OOOH OOOH. I get commit credit on something. :D

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Good stuff.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed the doc/language fixes.

webchick’s picture

Title: [Docs follow-up] Drupal 8 HEAD broken: installing Language module fails, after that cannot install any other module » Drupal 8 HEAD broken: installing Language module fails, after that cannot install any other module
Priority: Minor » Critical

YAY! :D

Restoring old status.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.