Skip to content
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

config_installer profile fails to install via Drush #1372

Closed
andrewholgate opened this issue May 9, 2015 · 17 comments
Closed

config_installer profile fails to install via Drush #1372

andrewholgate opened this issue May 9, 2015 · 17 comments

Comments

@andrewholgate
Copy link

The config_installer profile is a special (and important) profile used to install an project using its existing yml config files.

Installing this profile from the UI works correctly but when running it via drush the following error occurs:

You are about to DROP all tables in your 'drupal8ddd2015' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the [ok]
--notify global option.
exception 'Drupal\Core\Installer\Exception\InstallerException' with  [error]
message 'Username field is required.
Email address field is required.' in
/var/www/project/web/core/includes/install.core.inc:895
Stack trace:
#0 /var/www/project/web/core/includes/install.core.inc(566):
install_get_form('Drupal\config_i...', Array)
#1 /var/www/project/web/core/includes/install.core.inc(522):
install_run_task(Array, Array)
#2 /var/www/project/web/core/includes/install.core.inc(117):
install_run_tasks(Array)
#3 /home/ubuntu/.composer/vendor/drush/drush/includes/drush.inc(709):
install_drupal(Object(Composer\Autoload\ClassLoader), Array)
#4 /home/ubuntu/.composer/vendor/drush/drush/includes/drush.inc(694):
drush_call_user_func_array('install_drupal', Array)
#5
/home/ubuntu/.composer/vendor/drush/drush/commands/core/drupal/site_install.inc(78):
drush_op('install_drupal', Object(Composer\Autoload\ClassLoader),
Array)
#6
/home/ubuntu/.composer/vendor/drush/drush/commands/core/site_install.drush.inc(289):
drush_core_site_install_version('config_installe...', Array)
#7 [internal function]: drush_core_site_install('config_installe...')
#8
/home/ubuntu/.composer/vendor/drush/drush/includes/command.inc(368):
call_user_func_array('drush_core_site...', Array)
#9
/home/ubuntu/.composer/vendor/drush/drush/includes/command.inc(219):
_drush_invoke_hooks(Array, Array)
#10 [internal function]: drush_command('config_installe...')
#11
/home/ubuntu/.composer/vendor/drush/drush/includes/command.inc(187):
call_user_func_array('drush_command', Array)
#12
/home/ubuntu/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(62):
drush_dispatch(Array)
#13 /home/ubuntu/.composer/vendor/drush/drush/drush.php(70):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#14 /home/ubuntu/.composer/vendor/drush/drush/drush.php(11):
drush_main()
#15 {main}
Warning: Command failed: /bin/sh -c cd web/core && /usr/bin/env PHP_OPTIONS="-d sendmail_path=`which true`" drush site-install config_installer --account-name=admin --account-pass=admin --keep-config -y
Starting Drupal installation. This takes a while. Consider using the [ok]
--notify global option.
exception 'Drupal\Core\Installer\Exception\InstallerException' with  [error]
message 'Username field is required.
Email address field is required.' in
/var/www/project/web/core/includes/install.core.inc:895
Stack trace:
#0 /var/www/project/web/core/includes/install.core.inc(566):
install_get_form('Drupal\config_i...', Array)
#1 /var/www/project/web/core/includes/install.core.inc(522):
install_run_task(Array, Array)
#2 /var/www/project/web/core/includes/install.core.inc(117):
install_run_tasks(Array)
#3 /home/ubuntu/.composer/vendor/drush/drush/includes/drush.inc(709):
install_drupal(Object(Composer\Autoload\ClassLoader), Array)
#4 /home/ubuntu/.composer/vendor/drush/drush/includes/drush.inc(694):
drush_call_user_func_array('install_drupal', Array)
#5
/home/ubuntu/.composer/vendor/drush/drush/commands/core/drupal/site_install.inc(78):
drush_op('install_drupal', Object(Composer\Autoload\ClassLoader),
Array)
#6
/home/ubuntu/.composer/vendor/drush/drush/commands/core/site_install.drush.inc(289):
drush_core_site_install_version('config_installe...', Array)
#7 [internal function]: drush_core_site_install('config_installe...')
#8
/home/ubuntu/.composer/vendor/drush/drush/includes/command.inc(368):
call_user_func_array('drush_core_site...', Array)
#9
/home/ubuntu/.composer/vendor/drush/drush/includes/command.inc(219):
_drush_invoke_hooks(Array, Array)
#10 [internal function]: drush_command('config_installe...')
#11
/home/ubuntu/.composer/vendor/drush/drush/includes/command.inc(187):
call_user_func_array('drush_command', Array)
#12
/home/ubuntu/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(62):
drush_dispatch(Array)
#13 /home/ubuntu/.composer/vendor/drush/drush/drush.php(70):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#14 /home/ubuntu/.composer/vendor/drush/drush/drush.php(11):
drush_main()
#15 {main}
 Use --force to continue.

Aborted due to warnings.
@weitzman
Copy link
Member

I agree that this is needed. The Drush maintainers are not likely to debug this personally so hopefully someone will look into the issues.

@webflo
Copy link
Contributor

webflo commented May 20, 2015

The following command should work.

drush si config_installer --keep-config-dirs -y config_installer_staging_configure_form.staging_directory=../config/staging config_installer_site_configure_form.account.name=foobar config_installer_site_configure_form.account.pass=foobar config_installer_site_configure_form.account.mail=foobar@example.com

@frederickjh
Copy link
Contributor

Drush Version : 7.0.0-rc1

$ drush si config_installer --keep-config-dirs -y
Unknown option: --keep-config-dirs. See drush help site-install for available options. To suppress this error, add the option --strict=0. [error]

@webflo That command does not seem to work for me.

@frederickjh
Copy link
Contributor

Adding --strict=0 lets it run, but same result as drush si.

@webflo
Copy link
Contributor

webflo commented May 21, 2015

@frederickjh You are right, --keep-config-dirs has been renamed to --keep-config.

@andrewholgate
Copy link
Author

Up until Drupal core beta14, the following drush command worked when attempting to generate a Drupal 8 site using the config_installer profile:

drush si config_installer -y --keep-config \
config_installer_site_configure_form.account.name=admin \
config_installer_site_configure_form.account.pass=password \
config_installer_site_configure_form.account.mail=webmaster@example.com

In Drupal core beta15 however, the following lines of code was added to PasswordConfirm.php

Using the same drush command above, the error throw (due to a missing password field) is:

You are about to DROP all tables in your 'drupal8dev' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the --notify global option.                         [ok]
exception 'Drupal\Core\Installer\Exception\InstallerException' with message 'Password field is required.' in         [error]
/var/www/project/web/core/includes/install.core.inc:900
Stack trace:
#0 /var/www/project/web/core/includes/install.core.inc(571): install_get_form('Drupal\config_i...', Array)
#1 /var/www/project/web/core/includes/install.core.inc(527): install_run_task(Array, Array)
#2 /var/www/project/web/core/includes/install.core.inc(116): install_run_tasks(Array)
#3 /home/ubuntu/.composer/vendor/drush/drush/includes/drush.inc(720):
install_drupal(Object(Composer\Autoload\ClassLoader), Array)
#4 /home/ubuntu/.composer/vendor/drush/drush/includes/drush.inc(705): drush_call_user_func_array('install_drupal',
Array)
#5 /home/ubuntu/.composer/vendor/drush/drush/commands/core/drupal/site_install.inc(78): drush_op('install_drupal',
Object(Composer\Autoload\ClassLoader), Array)
#6 /home/ubuntu/.composer/vendor/drush/drush/commands/core/site_install.drush.inc(289):
drush_core_site_install_version('config_installe...', Array)
#7 [internal function]: drush_core_site_install('config_installe...', 'config_installe...', 'config_installe...',
'config_installe...')
#8 /home/ubuntu/.composer/vendor/drush/drush/includes/command.inc(359): call_user_func_array('drush_core_site...',
Array)
#9 /home/ubuntu/.composer/vendor/drush/drush/includes/command.inc(210): _drush_invoke_hooks(Array, Array)
#10 [internal function]: drush_command('config_installe...', 'config_installe...', 'config_installe...',
'config_installe...')
#11 /home/ubuntu/.composer/vendor/drush/drush/includes/command.inc(178): call_user_func_array('drush_command', Array)
#12 /home/ubuntu/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(62): drush_dispatch(Array)
#13 /home/ubuntu/.composer/vendor/drush/drush/drush.php(70): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#14 /home/ubuntu/.composer/vendor/drush/drush/drush.php(11): drush_main()
#15 {main}

Interestingly, using beta14, the password was never being set and a random one was being generated instead - so it seems that there might have been an issue with using drush's site-install with this config_installer profile for a while.

Note: I am cross-posting this issue to drush as @alexpott mentioned this is perhaps an issue with drush's site-install and not the config_installer profile. Drupal.org issue reference

@greg-1-anderson
Copy link
Member

No time to test this right now, but did anyone try:

drush si config_installer -y --keep-config \
config_installer_site_configure_form.account.name=admin \
config_installer_site_configure_form.account.pass1=password\
config_installer_site_configure_form.account.pass2=password \
config_installer_site_configure_form.account.mail=webmaster@example.com

@marco-loche
Copy link

I tried and it seems to not solve the form error

#drush si config_installer -y --keep-config config_installer_site_configure_form.account.name=admin config_installer_site_configure_form.account.pass1=password config_installer_site_configure_form.account.pass2=password config_installer_site_configure_form.account.mail=webmaster@example.com
You are about to DROP all tables in your 'drupal8_dev' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the --notify global option.                                                                                                        [ok]
exception 'Drupal\Core\Installer\Exception\InstallerException' with message 'Password field is required.' in /var/www/project/web/core/includes/install.core.inc:900                                [error]
Stack trace:
#0 /var/www/project/web/core/includes/install.core.inc(571): install_get_form('Drupal\config_i...', Array)
#1 /var/www/project/web/core/includes/install.core.inc(527): install_run_task(Array, Array)
#2 /var/www/project/web/core/includes/install.core.inc(116): install_run_tasks(Array)
#3 /var/www/project/vendor/drush/drush/includes/drush.inc(720): install_drupal(Object(Composer\Autoload\ClassLoader), Array)
#4 /var/www/project/vendor/drush/drush/includes/drush.inc(705): drush_call_user_func_array('install_drupal', Array)
...

@greg-1-anderson
Copy link
Member

I suspect this will work fine once the form submit field names are corrected. Needs more fiddling.

@webflo
Copy link
Contributor

webflo commented Oct 9, 2015

The PasswordConfirm form element contains two nested fields. The following command should work.

drush si config_installer -y --keep-config \
config_installer_site_configure_form.account.name=admin \
config_installer_site_configure_form.account.pass.pass1=password \
config_installer_site_configure_form.account.pass.pass2=password \
config_installer_site_configure_form.account.mail=webmaster@example.com

@cweagans
Copy link

IMO, drush should support installing from existing config without config_installer. I documented how my team is doing this in #1635 (comment)

@jcnventura
Copy link

This has been fixed in the latest config_installer.

@greg-1-anderson
Copy link
Member

@jcnventura: What has been fixed?

@yched
Copy link

yched commented Jan 20, 2016

@greg-1-anderson :

What has been fixed?

Late answer, but https://www.drupal.org/node/2495935 fixed config_installer so that the regular --account-* options now work :

drush site-install config_installer --account-name=... --account-pass=... --account-mail=... 

Previously it didn't because config_installer changes the underliying form field names.

@jcnventura
Copy link

Ditto.

@woprrr
Copy link

woprrr commented Feb 19, 2018

With Drush 9

drush site-install config_installer --account-name=... --account-pass=... --account-mail=...

not works without config_installer_site_configure_form.account.* params

@weitzman
Copy link
Member

please see config installer issue queue

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

No branches or pull requests

10 participants