When exporting configuration in 8.3.x, a value for `profile` gets added to `core.extension.yml`. However, attempting to use `config_installer` with a configuration set that includes the `core.extention.profile` value causes the configuration to fail validation:

The configuration cannot be imported because it failed validation for the following reasons:
Cannot change the install profile from config_installer to once Drupal is installed.

Comments

derek.deraps created an issue. See original summary.

dobrzyns’s picture

I was able to resolve this issue by also setting the install profile to config_installer in settings.php

$settings['install_profile'] = 'config_installer';
ericras’s picture

Setting $settings['install_profile'] = 'config_installer'; doesn't work for me.

This seems to be introduced by #2156401: Write install_profile value to configuration and only to settings.php if it is writeable

http://cgit.drupalcode.org/drupal/commit/core/lib/Drupal/Core/EventSubsc...

This only occurs when core.extension.profile = config_installer and I try to install in the browser. It works with core.extension.profile = standard. However, I seem to need that set to config_installer to also install multisites with drush.

GaëlG’s picture

I had the same problem. A workaround is to temporarily comment out the line in ConfigImportSubscriber.php:

//      $config_importer->logError($this->t('Cannot change the install profile from %new_profile to %profile once Drupal is installed.', ['%profile' => $install_profile, '%new_profile' => $core_extension['profile']]));

Then you can uncomment, next imports work fine.

jonnyeom’s picture

Commenting out the check as #4 stated does bypass this error. I got this error with while trying to add/install another site (multisite setup) using the GUI.
The problems seems to be that even though the new site will share the core.extension in the config directory, drupal is checking the existing core.extension.profile with NULL (since the site has not been setup yet).

imre.horjan’s picture

Hi, here's a workaround and my suggested solution to solve this in core: https://www.drupal.org/node/2867834#comment-12102407

andypost’s picture

Steps
1. install drupal drush si minimal
2. export config drush cex
3. try re-install drush si config_installer config_installer_sync_configure_form.sync_directory=sites/default/files/config_.../sync
4. expected install but but receive exception

drush si config_installer config_installer_sync_configure_form.sync_directory=sites/default/files/config_IQkUD0zKDwpE-N9CHwoNfpKbw6L_z-vsQ4UAqLAoFM2u6k3n2AWClbfeEgvgRsEs6AYoqvzByw/sync
You are about to DROP all tables in your 'sqlite.db' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the --notify global option.                                                                                                               [ok]
Drupal\Core\Installer\Exception\InstallProfileMismatchException: The selected profile <em class="placeholder">config_installer</em> does not match the install_profile setting, which is <em            [error]
class="placeholder">minimal</em>. Cannot write updated setting to <em class="placeholder">sites/default/settings.php</em>. in /var/www/html/web/core/includes/install.core.inc:2217
Stack trace:
#0 /var/www/html/web/core/includes/install.core.inc(662): install_write_profile(Array)
#1 /var/www/html/web/core/includes/install.core.inc(540): install_run_task(Array, Array)
#2 /var/www/html/web/core/includes/install.core.inc(117): install_run_tasks(Array)
#3 phar:///usr/bin/drush/includes/drush.inc(726): install_drupal(Object(Composer\Autoload\ClassLoader), Array)
#4 phar:///usr/bin/drush/includes/drush.inc(711): drush_call_user_func_array('install_drupal', Array)
#5 phar:///usr/bin/drush/commands/core/drupal/site_install.inc(82): drush_op('install_drupal', Object(Composer\Autoload\ClassLoader), Array)
#6 phar:///usr/bin/drush/commands/core/site_install.drush.inc(255): drush_core_site_install_version('config_installe...', Array)
#7 phar:///usr/bin/drush/includes/command.inc(422): drush_core_site_install('config_installe...', 'config_installe...')
#8 phar:///usr/bin/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#9 phar:///usr/bin/drush/includes/command.inc(199): drush_command('config_installe...', 'config_installe...')
#10 phar:///usr/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#11 phar:///usr/bin/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#12 phar:///usr/bin/drush/includes/startup.inc(458): drush_main()
#13 phar:///usr/bin/drush/includes/startup.inc(365): drush_run_main(false, '/', 'Phar detected. ...')
#14 phar:///usr/bin/drush/drush(114): drush_startup(Array)
#15 /usr/bin/drush(10): require('phar:///usr/bin...')
#16 {main}

The only way to reinstall again is remove line $settings['install_profile'] = 'minimal'; from settings.php

Very probably issue in drush (8.1.12) that still adds install profile to settings.php

Julfabre’s picture

Status: Active » Closed (duplicate)

It's seems to be a duplicated issue with this one https://www.drupal.org/node/2729243

andypost’s picture