In Quickstart 2.0-alpha1 (32 bit), drush command used to create empty directory, configure virtual host, create empty database is no longer working.
$ drush qc apache dns database --domain=example3.dev

The following error is produced:

06:51:15 ~/websites$ drush qc apache dns database --domain=qs2test.dev
The drush command 'qc apache dns database' could not be found.  Run  [error]
`drush cache-clear drush` to clear the commandfile cache if you have
installed new extensions.
A Drupal installation directory could not be found                   [error]

http://drupal.org/node/819398

Comments

TravisCarden’s picture

Title: QS2 - Drush command to create empty directory is broken » Handbook pages out-of-date
Component: Drush » Documentation

Thank you for the report, @C13L0. That documentation is out-of-date. For the latest commands and syntax, please run drush --filter=quickstart and drush [command-name] -h (e.g. drush quickstart-create -h). If you'd like to take a crack at updating the handbook page, that would be awesome! :)

C13L0’s picture

I will be happy to update the pages, once I figure out the new commands! Thanks for the info

Edit: I am totally in the dark and need more guidance. Drush is new to me. I have tried the new commands but they are also not working. So, I just tried the one you gave me and it produced this error

10:14:47 ~/websites$ drush quickstart-create -h apache dns database --domain=testsite.dev
Unknown option: --domain.  See `drush help help` for available       [error]
options. To suppress this error, add the option --strict=0.

I specifically need to create empty directory and configure virtual host because I am working mostly with D8 or cloning distros or sites.

Thanks!

C13L0’s picture

I have been working with ultimike in #drupal-florida. We took a look at /.drush/quickstart/quickstart.drush.inc. In qs2 there are not any drush commands to create an empty directory, configure virtual host, create empty database as with the old version. The new version forces use of .make file. In most cases, I do not want or need a make file. To get around this, I created an empty make file called empty.make. While it created a directory, vh, and db....it produced a ton of other errors (of course). I would correct the code if I knew how but since I dont, would truly appreciate if someone could look at it

Using empty .make creates empty dir, configures vh, and empty db but produces the errors below:

01:50:14 ~/websites$ drush qsc testsite5.dev --makefile=empty.make
Creating Drush site alias...                                         [status]
Creating DNS config...                                               [status]
Creating database and user...                                        [status]
Downloading code...                                                  [status]
Invalid or empty make file: empty.make                               [error]

Fatal error: Uncaught exception 'Exception' with message ' in /home/quickstart/quickstart/quickstart.inc on line 71

Exception: 
  chown: cannot access `/home/quickstart/websites/testsite5.dev': No such file or directory in /home/quickstart/quickstart/quickstart.inc on line 71

Call Stack:
    0.0021     371440   1. {main}() /home/quickstart/drush/drush.php:0
    0.0633    3184764   2. drush_main() /home/quickstart/drush/drush.php:16
    0.3328    7431032   3. _drush_bootstrap_and_dispatch() /home/quickstart/drush/drush.php:61
    0.4282    7436852   4. drush_dispatch() /home/quickstart/drush/drush.php:92
    0.5076    7442276   5. call_user_func_array() /home/quickstart/drush/includes/command.inc:165
    0.5076    7442528   6. drush_command() /home/quickstart/drush/includes/command.inc:0
    0.5080    7442836   7. _drush_invoke_hooks() /home/quickstart/drush/includes/command.inc:198
    0.5112    7478476   8. call_user_func_array() /home/quickstart/drush/includes/command.inc:324
    0.5112    7478736   9. drush_quickstart_fixperms() /home/quickstart/drush/includes/command.inc:0
    0.5114    7481640  10. quickstart_shell_exec() /home/quickstart/quickstart/quickstart.drush.inc:117

Drush command terminated abnormally due to an unrecoverable error.   [error]
Error: Uncaught exception 'Exception' with message '
  chown: cannot access `/home/quickstart/websites/testsite5.dev': No
such file or directory' in
/home/quickstart/quickstart/quickstart.inc:71
Stack trace:
#0 /home/quickstart/quickstart/quickstart.drush.inc(117):
quickstart_shell_exec('sudo chown -R q...')
#1 [internal function]: drush_quickstart_fixperms('testsite5.dev')
#2 /home/quickstart/drush/includes/command.inc(324):
call_user_func_array('drush_quickstar...', Array)
#3 /home/quickstart/drush/includes/command.inc(198):
_drush_invoke_hooks('quickstart-fixp...', Array, 'quickstart')
#4 [internal function]: drush_command('testsite5.dev')
#5 /home/quickstart/drush/includes/command.inc(165):
call_user_func_array('drush_command', Array)
#6 /home/quickstart/drush/drush.php(92): drush_dispatch(Array)
#7 /home/quickstart/drush/drush.php(61):
_drush_bootstrap_and_dispatch()
#8 /home/quickstart/drush/drush.php(16): drush_main()
#9 {main}
  thrown in /home/quickstart/quickstart/quickstart.inc, line 71
Creating Apache config.                                              [status]
Running installer...                                                 [status]
file_get_contents(/home/quickstart/websites/testsite5.dev/CHANGELOG.txt):[warning]
failed to open stream: No such file or directory quickstart.inc:329
Command site-install needs a higher bootstrap level to run - you will[error]
need to invoke drush from a more functional Drupal environment to run
this command.
The drush command 'site-install standard' could not be executed.     [error]
The directory /home/quickstart/websites/testsite5.dev does not       [error]
contain a valid Drupal installation
                                                                     [ok]
URL: http://testsite5.dev
Admin user: admin
Admin password: admin
Creating cron job...                                                 [status]
Finished. 

tl;dr Need to create empty directory, configure virtual host, create empty database. Using empty .make file works but produces other issues. This worked fine in quickstart1. refer to /.drush/quickstart/quickstart.drush.inc. to see diff

Thanks!

TravisCarden’s picture

You're right, @C13L0: those options were eliminated in the updates to the Drush commands. Can you give me an idea of what your use case is—what you're trying to accomplish that you need to create an empty directory, etc. but not a complete Drupal site using Drush?

C13L0’s picture

Hi Travis, I use the empty directory to clone the repo of existing sites. Also, distros need to be cloned into an empty directory, etc. Almost all sites I work on are cloned from a repo and very rarely do I start a new site from scratch. Thank you for working with me on this

edit: as of right now, the workaround is to create a new site using the make file, empty the folders, drop the db and recreate it, then clone the repo to the new folders.

mike stewart’s picture

@C13L0 -- I used a similar process in qs1 ... and for the last year in drupalpro

in #drupalpro IRC channel you suggested drush doesnt work with D8. I just tested in QS2beta --- and drupal8 install works (as expected. however, install profile not working with drush 5.x branch, but d8 installs fine) using the command:

drush qsc foobar.dev --makefile=d8.make
chmod g+w ~/websites/foobar.dev/sites/default/settings.php

Then navigate to URL: http://foobar.dev
Admin user: admin
Admin password: admin

and finish the install. edit: yes, I get similar errors -- but if you don't tl;dr or tested you'd probably realize that only thing failing was the automatic execution of the install profile. This does work manually. Also of note, the error message:

Drush 5.8 does not support Drupal . Use Drush 4 instead.

is outdated.

mike stewart’s picture

Note, I edited my previous comment for clarity and focus and moved the conversation tangent into a separate issue to live or die on its own: #1980756: Bring back QSC subcommands: dns and apache

:)

TravisCarden’s picture

Thank you, @mike stewart. @C13L0, you'll want to follow #1980756: Bring back QSC subcommands: dns and apache. :-) This issue can now focus on updating the handbook pages.

C13L0’s picture

I truly appreciate the syntax to install drupal 8. Were you able to complete the install on qs2? I must be doing something wrong or maybe there is an issue with the qs2 download I have....going to start over from scratch and try again.

I also changed the settings on drupalpro (switched to 2d) and no longer having lag issues. Going to give drupral 8 a try on that too =)

edit to stay on topic* sorry i will update the handbook as I get things working properly on my end. Just working out some issues

mike stewart’s picture

Yes, I did the test on QS2 beta (current download from the quickstart project page) -- so I'm sure it works on QS2.

Glad to hear 2D makes a difference on drupalpro. Its nearly identical to the current Quickstart beta. 3D is a common problem on older hardware; the result of Ubuntu using 3D by default as of version 12.04.

To setup Drupal8 on drupalpro, it works similarly -- although I think the default makefile is: d8git.make

The command on drupalpro is:
drush qc --domain=d8.foo --makefile=d8git.make

mike stewart’s picture

now back to our regularly scheduled handbook updates issue

mike stewart’s picture

Issue summary: View changes

cleaned up code