Problem/Motivation
It appears that it is (now) not possible to install Drupal 8 with the standard or testing profile, and your own $config_directories
setting.
Users should be allowed to set their own $config_directories
(and database connection details, etc.) in settings.php before installing.
Steps to reproduce
1. Before installing, open settings.php (or settings.local.php) and customize $config_directories
:
$config_directories = array(
CONFIG_ACTIVE_DIRECTORY => '/some/valid/file/path/active',
CONFIG_STAGING_DIRECTORY => '/some/valid/file/path/staging',
);
2. Install the standard profile (either via drush si
or core/install.php)
3. You will receive the error message:
exception 'Drupal\Core\Config\PreExistingConfigException' with message 'Configuration objects (system.cron, system.theme) provided by standard already exist in active configuration' in
core/lib/Drupal/Core/Config/PreExistingConfigException.php:70
Stack trace:
#0 core/lib/Drupal/Core/Config/ConfigInstaller.php(442):
Drupal\Core\Config\PreExistingConfigException::create('standard', Array)
#1 core/lib/Drupal/Core/Extension/ModuleInstaller.php(156):
Drupal\Core\Config\ConfigInstaller->checkConfigurationToInstall('module', 'standard')
#2 core/includes/install.core.inc(1630):
Drupal\Core\Extension\ModuleInstaller->install(Array, false)
#3 core/includes/install.core.inc(637):
install_install_profile(Array)
#4 core/includes/install.core.inc(517): install_run_task(Array,
Array)
#5 core/includes/install.core.inc(117): install_run_tasks(Array)
#6 ~/.composer/vendor/drush/drush/includes/drush.inc(706): install_drupal(Object(Composer\Autoload\ClassLoader), Array)
4. Repeat the process with the 'minimal' profile. The install will succeed.
5. Repeat the process with the 'testing' profile. The install will fail with a slightly different error, but the same basic problem: "Configuration objects (system.theme)
provided by testing already exist in active configuration"
Here's how to do the same thing with my attached test script. You may need to set some env vars or modify the script to set your DB credentials, etc.
# Fails.
sh ./test-2461341-with-vars.sh_.txt
# Succeeds.
PROFILE=minimal sh ./test-2461341-with-vars.sh_.txt
# Fails.
PROFILE=testing sh ./test-2461341-with-vars.sh_.txt
Comment | File | Size | Author |
---|---|---|---|
#2 | test-2461341-with-vars.sh_.txt | 1.57 KB | pjcdawkins |
Comments
Comment #1
pjcdawkins CreditAttribution: pjcdawkins commentedThis is clearly a bug in the standard profile - minimal works fine.
I've written a little test script to reproduce this consistently, on my machine at least - attached.
Comment #2
pjcdawkins CreditAttribution: pjcdawkins commentedMy test script had a couple of bugs.
It turns out that the 'testing' profile fails too, with a slightly different error. Updated summary.
Comment #3
alexpottI think you'll find this is a duplicate of #2451363: Ensure install_profile is exists in settings.php after installation
Just add
Or whatever profile you are testing and you'll find everything works as expected.
Leaving as active for confirmation. @pjcdawkins please close once you have confirmed. Re https://twitter.com/pjcdawkins/status/581828506126032896 - the installation process in D8 has more test coverage that any previous version of D8 btw - have a look at InstallerTestBase and the classes that extend from that.
Comment #4
pjcdawkins CreditAttribution: pjcdawkins commentedConfirmed - you're absolutely right. Thank you.
Comment #5
alexpottWe need to fix #2451363: Ensure install_profile is exists in settings.php after installation - and this is a dupe of that issue.