Context:
Drupal 7.43, drush 7.2.0

Built the code with

drush make build-commerce-kickstart.make

And got a Drupal codebase with commerce_kickstart under profiles, in

/var/www/mapps2/public_html.20160316_1113

Then, setup a database called "mapps", and configured it in settings.php with user/password
(I can

drush sqlc

to it, no problem)

Then here comes the problem, by executing

drush site-install commerce_kickstart --site-name="mapps2" --site-mail=admin@mapps2.com --account-pass=mypass --verbose

it crashes as follows:

Executing: mysql --defaults-extra-file=/tmp/drush_vP1WT9 --database=mapps2 --host=localhost --silent  < /tmp/drush_Nb3lr6 > /dev/null
You are about to DROP all tables in your 'mapps2' database. Do you want to continue? (y/n): y
Sites directory /var/www/mapps2/public_html.20160316_1113/sites/default already exists - proceeding.             [notice]
Executing: mysql --defaults-extra-file=/tmp/drush_9BPUTx --database=mapps2 --host=localhost --silent  < /tmp/drush_hWkVTl > /dev/null
Executing: mysql --defaults-extra-file=/tmp/drush_nlcLVV --database=mapps2 --host=localhost --silent  < /tmp/drush_jTrPUJ
Starting Drupal installation. This takes a while. Consider using the --notify global option.                  [ok]
exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table              [error]
'mapps2.cache_form' doesn't exist' in
/var/www/mapps2/public_html.20160316_1113/includes/database/database.inc:2171
Stack trace:
#0 /var/www/mapps2/public_html.20160316_1113/includes/database/database.inc(2171):
PDOStatement->execute(Array)
#1 /var/www/mapps2/public_html.20160316_1113/includes/database/database.inc(683):
DatabaseStatementBase->execute(Array, Array)
#2 /var/www/mapps2/public_html.20160316_1113/includes/database/query.inc(858):
DatabaseConnection->query('DELETE FROM {ca...', Array, Array)
#3 /var/www/mapps2/public_html.20160316_1113/includes/cache.inc(542): DeleteQuery->execute()
#4 /var/www/mapps2/public_html.20160316_1113/includes/cache.inc(168):
DrupalDatabaseCache->clear('form_form-asF4t...', false)
#5 /var/www/mapps2/public_html.20160316_1113/includes/form.inc(909): cache_clear_all('form_form-asF4t...',
'cache_form')
#6 /var/www/mapps2/public_html.20160316_1113/includes/form.inc(746): drupal_process_form('install_welcome',
Array, Array)
#7 /var/www/mapps2/public_html.20160316_1113/includes/install.core.inc(412):
drupal_form_submit('install_welcome', Array)
#8 /var/www/mapps2/public_html.20160316_1113/includes/install.core.inc(339): install_run_task(Array, Array)
#9 /var/www/mapps2/public_html.20160316_1113/includes/install.core.inc(77): install_run_tasks(Array)
#10 /usr/share/composer/vendor/drush/drush/includes/drush.inc(723): install_drupal(Array)
#11 /usr/share/composer/vendor/drush/drush/includes/drush.inc(709):
drush_call_user_func_array('install_drupal', Array)
#12 /usr/share/composer/vendor/drush/drush/commands/core/drupal/site_install_7.inc(82):
drush_op('install_drupal', Array)
#13 /usr/share/composer/vendor/drush/drush/commands/core/site_install.drush.inc(291):
drush_core_site_install_version('commerce_kickst...', Array)
#14 [internal function]: drush_core_site_install('commerce_kickst...')
#15 /usr/share/composer/vendor/drush/drush/includes/command.inc(361):
call_user_func_array('drush_core_site...', Array)
#16 /usr/share/composer/vendor/drush/drush/includes/command.inc(212): _drush_invoke_hooks(Array, Array)
#17 [internal function]: drush_command('commerce_kickst...')
#18 /usr/share/composer/vendor/drush/drush/includes/command.inc(180): call_user_func_array('drush_command',
Array)
#19 /usr/share/composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(64): drush_dispatch(Array)
#20 /usr/share/composer/vendor/drush/drush/drush.php(70): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#21 /usr/share/composer/vendor/drush/drush/drush.php(11): drush_main()
#22 {main}
Command dispatch complete                                                                                        [notice]

This is part of my work in Drupsible. Drupsible is able to automatically install other distros successfully. I've been able to manually reproduce the error, and I'm working on this to identify what is it that's causing the error. Thanks in advance.

Comments

mariano.barcia created an issue. See original summary.

mariano.barcia’s picture

I've found the culprit inside the function
commerce_kickstart_install_tasks_alter()

In that function, there is a new task being created ("install_welcome"), which forces a cache clear which leads to the exception described above.

mariano.barcia’s picture

I've tried this patch with drush site-install and it's working.

mariano.barcia’s picture

Status: Active » Needs review
lsolesen’s picture

Could you please create it as a pull request on http://github.com/commerceguys/commerce_kickstart. That will give us automatic tests for this.

mariano.barcia’s picture

@lsolesen done. The build was failing, so my PR didn't pass, but all the tests previously OK are still OK after this patch.

lsolesen’s picture

Could you please rebase the pull request. I think I've fixed the randomly failing tests so we have a green light.

lsolesen’s picture

Status: Needs review » Needs work
mariano.barcia’s picture

Status: Needs work » Needs review

Done in PR 188, thank you. Still going through the tests.

lsolesen’s picture

Status: Needs review » Fixed

  • mariano.barcia committed 5b5e3e2 on 7.x-2.x
    Issue #2688331 by mariano.barcia: drush site-install crashes trying to...
  • lsolesen committed 670fb6a on 7.x-2.x
    Merge pull request #188 from mbarcia/mbarcia/fix-cli
    
    Issue #2688331 by...
drumm’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.