New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to site-install --config-dir with any profile other than minimal #2953

Closed
danepowell opened this Issue Sep 22, 2017 · 12 comments

Comments

Projects
None yet
6 participants
@danepowell
Contributor

danepowell commented Sep 22, 2017

As of #1921 and Drush 9, it's impossible to install a site using the config-dir parameter and any profile other than minimal.

This was apparently an intentional change to fix problems with UUID changes and content imports, but it had the side effect of basically breaking any profile other than minimal.

The problem is that once a site is installed with a given profile, you generally cannot change that profile via a configuration import. Attempting to do so results in all sorts of error messages like this:

Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization. in Drupal\Core\Config\ConfigImporter->validate() (line 728 of /var/www/foo/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php).
[error] The import failed due to the following reasons:
Unable to install the bar module since it does not exist.
Cannot change the install profile from foo to minimal once Drupal is installed.

Furthermore, when Drush forces the install profile to be minimal, that overwrites any value of $settings['install_profile']in settings.php to also be minimal. This could cause all kinds of problems. For instance, on read-only file systems, the install will completely fail. For other file systems, it will prevent you from changing to any other install profile, even if the config-import were successful. In fact, this might actually be what's generating the error message above (note that it's trying to change from a custom profile back to minimal for some reason).

I definitely think the original issue in #1921 needs to be solved, but not by forcing the install profile to be minimal. It's something that likely needs to be fixed upstream in Drupal core.

@greg-1-anderson

This comment has been minimized.

Show comment
Hide comment
@greg-1-anderson

greg-1-anderson Sep 22, 2017

Member

Shoot, I spent quite a bit of time figuring out how to make this work some time ago, but now I can't remember exactly what was necessary.

The reason I can't remember is that I decided it wasn't worth the complexity, when the config installer profile exists (and hopefully someday is heading to core). Now, I just use config installer, which works with any profile.

Member

greg-1-anderson commented Sep 22, 2017

Shoot, I spent quite a bit of time figuring out how to make this work some time ago, but now I can't remember exactly what was necessary.

The reason I can't remember is that I decided it wasn't worth the complexity, when the config installer profile exists (and hopefully someday is heading to core). Now, I just use config installer, which works with any profile.

@danepowell

This comment has been minimized.

Show comment
Hide comment
@danepowell

danepowell Sep 22, 2017

Contributor

The Config Installer profile is completely undocumented, can you propose how to use it to install something like a Lightning sub-profile? AFAICT, that's impossible.

Contributor

danepowell commented Sep 22, 2017

The Config Installer profile is completely undocumented, can you propose how to use it to install something like a Lightning sub-profile? AFAICT, that's impossible.

@greg-1-anderson

This comment has been minimized.

Show comment
Hide comment
@greg-1-anderson

greg-1-anderson Sep 23, 2017

Member

I think I did that, but my PR is out of date, and probably not working right now. It's not using config installer at the moment, though, so I'm not sure whether I did or did not try that permutation.

pantheon-systems/example-drops-8-composer#33

Member

greg-1-anderson commented Sep 23, 2017

I think I did that, but my PR is out of date, and probably not working right now. It's not using config installer at the moment, though, so I'm not sure whether I did or did not try that permutation.

pantheon-systems/example-drops-8-composer#33

@balsama

This comment has been minimized.

Show comment
Hide comment
@balsama

balsama Sep 28, 2017

Contributor

It looks like the Config Installer profile makes an exception and scans the directory of the profile listed in core.extensions.yml for extensions in addition to the regular places Drupal would look for extensions.

Unfortunately, if your site is using the core patch to allow for inherited profiles, there might be more than one profile directory that contains extensions to be enabled. And the Config Installer profile will fail during install because it can't find those extensions.

configure_configuration_import_location___drupal

I wouldn't expect Config Installer to be making that exception for parent profiles, just noting that it won't work with a profile like Lightning that contains extensions and is generally used as a base profile.

/cc @danepowell

Contributor

balsama commented Sep 28, 2017

It looks like the Config Installer profile makes an exception and scans the directory of the profile listed in core.extensions.yml for extensions in addition to the regular places Drupal would look for extensions.

Unfortunately, if your site is using the core patch to allow for inherited profiles, there might be more than one profile directory that contains extensions to be enabled. And the Config Installer profile will fail during install because it can't find those extensions.

configure_configuration_import_location___drupal

I wouldn't expect Config Installer to be making that exception for parent profiles, just noting that it won't work with a profile like Lightning that contains extensions and is generally used as a base profile.

/cc @danepowell

@alexpott

This comment has been minimized.

Show comment
Hide comment
@alexpott

alexpott Oct 5, 2017

Contributor

Forcing minimal seems really messy especially the install profile is stored in config now.

Contributor

alexpott commented Oct 5, 2017

Forcing minimal seems really messy especially the install profile is stored in config now.

@weitzman

This comment has been minimized.

Show comment
Hide comment
@weitzman

weitzman Oct 9, 2017

Member

I'd love some guidance from folks about how to proceed.

IIRC, the forcing of 'minimal' came after a steady stream of support requests from people trying to use --config-dir with standard profile. They were getting something like 'shortcut content must be deleted' before import'

Member

weitzman commented Oct 9, 2017

I'd love some guidance from folks about how to proceed.

IIRC, the forcing of 'minimal' came after a steady stream of support requests from people trying to use --config-dir with standard profile. They were getting something like 'shortcut content must be deleted' before import'

@alexpott

This comment has been minimized.

Show comment
Hide comment
@alexpott

alexpott Oct 9, 2017

Contributor

Well ideally we'd have https://www.drupal.org/node/2788777 in core and we'd just move https://www.drupal.org/project/install_profile_generator into core drush and then people could create their own install profiles.

Basically config import was not designed to work the way drush is using it. A potential solution would be for drush to install minimal, delete all config entities, swap the profile to the one from config, and then do the config import.

Contributor

alexpott commented Oct 9, 2017

Well ideally we'd have https://www.drupal.org/node/2788777 in core and we'd just move https://www.drupal.org/project/install_profile_generator into core drush and then people could create their own install profiles.

Basically config import was not designed to work the way drush is using it. A potential solution would be for drush to install minimal, delete all config entities, swap the profile to the one from config, and then do the config import.

@weitzman

This comment has been minimized.

Show comment
Hide comment
@weitzman

weitzman Oct 13, 2017

Member

Sounds good. PRs appreciated.

Member

weitzman commented Oct 13, 2017

Sounds good. PRs appreciated.

@weitzman

This comment has been minimized.

Show comment
Hide comment
@weitzman

weitzman Oct 20, 2017

Member

Anyone?

Member

weitzman commented Oct 20, 2017

Anyone?

@balsama

This comment has been minimized.

Show comment
Hide comment
@balsama

balsama Feb 2, 2018

Contributor

For those trying to solve the problem of installing a site from config, the Configuration installer profile works quite nicely. I've tested and documented our usage of it here: http://lightning.acquia.com/blog/using-configuration-installer-lightning

Ultimately, I think this is the parent issue https://www.drupal.org/project/drupal/issues/1613424

Contributor

balsama commented Feb 2, 2018

For those trying to solve the problem of installing a site from config, the Configuration installer profile works quite nicely. I've tested and documented our usage of it here: http://lightning.acquia.com/blog/using-configuration-installer-lightning

Ultimately, I think this is the parent issue https://www.drupal.org/project/drupal/issues/1613424

@bradjones1

This comment has been minimized.

Show comment
Hide comment
@bradjones1

bradjones1 Mar 5, 2018

Contributor

At the very least I think we should add a warning if a profile is specified along with --config-dir? It would save me from learning this lesson anew every 6 months ;-)

Contributor

bradjones1 commented Mar 5, 2018

At the very least I think we should add a warning if a profile is specified along with --config-dir? It would save me from learning this lesson anew every 6 months ;-)

@weitzman

This comment has been minimized.

Show comment
Hide comment
@weitzman

weitzman Sep 21, 2018

Member

try drupal 8.6 and drush si's new --existing-config option.

Member

weitzman commented Sep 21, 2018

try drupal 8.6 and drush si's new --existing-config option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment