ucdavis / sitefarm-distro-template

13 stars 9 forks source link

Uncaught exception during installer: PreExistingConfigException: Configuration objects (system.theme) provided by system already exist in active configuration #21

Closed dsnopek closed 5 years ago

dsnopek commented 6 years ago

I just did the following:

Here's the full stack trace:

Drupal\Core\Config\PreExistingConfigException: Configuration objects (system.theme) provided by system already exist in active configuration in Drupal\Core\Config\PreExistingConfigException::create() (line 65 of /app/web/core/lib/Drupal/Core/Config/PreExistingConfigException.php).

Drupal\Core\Config\PreExistingConfigException::create('system', Array) (Line: 492)
Drupal\Core\Config\ConfigInstaller->checkConfigurationToInstall('module', 'system') (Line: 132)
Drupal\Core\ProxyClass\Config\ConfigInstaller->checkConfigurationToInstall('module', 'system') (Line: 145)
Drupal\Core\Extension\ModuleInstaller->install(Array, ) (Line: 83)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, ) (Line: 635)
drupal_install_system(Array) (Line: 1050)
install_base_system(Array) (Line: 677)
install_run_task(Array, Array) (Line: 555)
install_run_tasks(Array) (Line: 117)
install_drupal(Object) (Line: 44)

There was an additional exception shown too, but I think it's just a result of the failed install. Here's the stack trace for that too:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal8.key_value' doesn't exist: SELECT 1 AS expression FROM {key_value} key_value WHERE (name = :db_condition_placeholder_0) AND (collection = :db_condition_placeholder_1); Array ( [:db_condition_placeholder_0] => system.theme.files [:db_condition_placeholder_1] => state ) in Drupal\Core\State\State->set() (line 71 of /app/web/core/lib/Drupal/Core/State/State.php).

Drupal\Core\State\State->set('system.theme.files', Array) (Line: 337)
Drupal\Core\Extension\ThemeHandler->rebuildThemeData() (Line: 73)
_drupal_maintenance_theme() (Line: 740)
drupal_maintenance_theme() (Line: 978)
install_display_output(Array, Array, Array) (Line: 260)
_drupal_log_error(Array, 1) (Line: 600)
_drupal_exception_handler(Object)
eguerin-ucsf commented 6 years ago

I have no idea why this happens, I think it is because of the system trying to start a profile install before one is selected, but haven't been able to like really solve the issue.

My hacktastic patch is this... Line 486 of /core/lib/Drupal/Core/Config/ConfigInstaller.php

if (!isset($profiles[$name])) {

to

if (!isset($profiles[$name]) && $name !='system') {

With this addiction the profile installer works okay as long as the database is clean of all tables.

mrkmiller commented 6 years ago

https://github.com/ucdavis/sitefarm_seed/pull/188 seemed to fix this issue for me.

mrkmiller commented 5 years ago

ucdavis/sitefarm_seed#198 should have made everything working with 8.6.