Ahoy,

For #1836516: Port Masquerade to D8 and rewrite + simplify it into a new 2.x series, we're developing an integration between latest Masquerade module and Administration menu module, so I have

  1. A masquerade module feature branch (8.x-2.x-admin-menu)
  2. An additional admin_menu module to include (8.x-3.x)

...and so I tried this:

http://simplytest.me/project/masquerade/8.x-2.x-admin-menu?add[]=admin_menu

But the resulting demo only contained Masquerade, but not Administration menu for some reason. Is prepopulating additional projects via GET query string battle-tested already? :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

patrickd’s picture

hi!

Additional modules are downloaded by $drush dl, I guess the problem is that admin_menu has no stable release yet

the problem is that I can't add "--dev" to the drush command as that would cause it to download always the dev version instead of the stable one

But yes, that issue is a bit annoying, I would expect it to behave correctly, no matter what core version

suggestions?

sun’s picture

Hm. Technically, http://drupal.org/project/admin_menu shows a 8.x-3.x release though? It is selected as recommended release, so normally drush should download that.

In any case, could we replicate the version selector from the main project to each additional project and make it default to a "- Recommended -" option?

patrickd’s picture

hmmm, okay I've now tested it again and had a look at the logs afterwards:

Project admin_menu (8.x-3.x-dev) downloaded to                         [success]
/home/s3968e87637c0eeb/www/sites/default/admin_menu.
Project admin_menu contains 3 modules: admin_menu_toolbar, admin_devel, admin_menu.

So the actual problem is that drush downloads admin menu to
sites/default instead of sites/default/modules.

That's odd, it works perfectly local.

Maybe different drush version, or other environmental side effects. Have to look that up in detail later.

I'd rather not add any more complexity to the submission form. I'm looking at my logs daily and some people already have problems to understand it now. Adding a version selection to addition modules would IMHO mess that up completely.

patrickd’s picture

After some more debugging I found out that drush is not using the correct root directory while downloading the module in drupal 8.

So I added the --root= option

- timeout 120 drush dl --gitinfofile -y "${S_ADDITIONALS[$key]}"
+ timeout 120 drush dl --gitinfofile --root="/home/$S_ID/www" -y "${S_ADDITIONALS[$key]}"

Now another problem occurred:

Drush 5.8 does not support Drupal . Use Drush 4 instead.                 [error]
PHP Fatal error:  Call to undefined function conf_path() in /usr/share/php/drush/includes/bootstrap.inc on line 784
Drush command terminated abnormally due to an unrecoverable error.       [error]
Error: Call to undefined function conf_path() in
/usr/share/php/drush/includes/bootstrap.inc, line 784

Which is a known issue for drupal 8, see #1867348: Drush 5 broken on Drupal 8

And was already fixed and committed: http://drupalcode.org/project/drush.git/commit/791fca2bded23ee5dac0610d1...

But not tagged yet for 7.x-5.x

Tried out 7.x-6.x, does not work either because it expects drupal to be already installed before downloading any projects..

Manually replaced drush with current 7.x-5.x version..
Now getting..
Drush 5.0-dev does not support Drupal 8. Use Drush 6 instead. [error]

well, that sucks.. I'll give it another try tomorrow, not sure what to do here yet..
If theres no other way I've to move that drush command after the installation.. thats pretty shitty

sun’s picture

Thanks for looking into this!

I can't tell whether it's safe to use for simplytest.me, but I'm actively using Drush 8.x-6.x (from a git clone).

patrickd’s picture

Title: Additional module not downloaded/provided » Additional module not downloaded in D8
Priority: Normal » Critical
patrickd’s picture

Talked with moshe and it sounds like there's no we-just-change-how-drush-gets-called solution, seems like solving this problem requires changing the distributions code too.

Quickfix: Remove "themes" as option from additional modules, so we can let drush put all the stuff into the modules folder.
drush dl $shortname --destination="sites/all/modules"

Alternatively: Instead of just submitting a list of shortnames to the server, also tell him what kind of project it is so drush can put it into the right directory.
drush dl $shortname --destination="sites/all/$type"

I'm not really fond of any of these solutions :-/

sun’s picture

Tried out 7.x-6.x, does not work either because it expects drupal to be already installed before downloading any projects..

Does it expect Drupal core to be installed or just "to be there"? If the latter, couldn't you perform the downloads in a two-step process? I.e., first supply Drupal core, then the projects?

patrickd’s picture

Drupal 8 core is already there and drush is called like
drush dl admin_menu --root="/where/drupal/is"
and it just downloads it into the drupal root directory

Strangely that works without problems for D7 distributions - which are also not installed when drush dl is called

patrickd’s picture

Okay, seems like projects get downloaded into an other directory than the drupal root if sites/all exists:

patrickd@patrickd-tp:~/www/drupal$ drush dl admin_menu
Project admin_menu (8.x-3.x-dev) downloaded to                       [success]
/home/patrickd/www/drupal/admin_menu.
Project admin_menu contains 3 modules: admin_menu_toolbar, admin_devel, admin_menu.

patrickd@patrickd-tp:~/www/drupal$ mkdir sites/all

patrickd@patrickd-tp:~/www/drupal$ drush dl admin_menu
Project admin_menu (8.x-3.x-dev) downloaded to                       [success]
/home/patrickd/www/drupal/sites/all/modules/admin_menu.
Project admin_menu contains 3 modules: admin_menu_toolbar, admin_devel, admin_menu.

This seems funny to me...

sun’s picture

Hm. Yes, D8 has a new top-level ./modules directory. Perhaps Drush attempts to download modules into that directory?

patrickd’s picture

don't know what it tries, but when there's no /sites/all it just puts it into the root

creating the sites/all directory resolves the issue locally..

unfortunately I get

drush dl admin_menu
Drush command terminated abnormally due to an unrecoverable error.                                                           [error]

on the server

drush dl admin_menu --debug
Bootstrap to phase 0. [0 sec, 4.01 MB]                               [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.01 sec, 4.24 MB] [bootstrap]
Loading drushrc "/usr/share/php/drush/drushrc.php" into "drush" scope. [0.01 sec, 4.24 MB]                                   [bootstrap]
Cache HIT cid: 6.0-dev-commandfiles-0-dba05af384e8dcd5232d7a91b3d6450a [0.01 sec, 4.26 MB]                                       [debug]
Bootstrap to phase 0. [0.05 sec, 10.18 MB]                                                                                   [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.07 sec, 10.19 MB]                                                  [bootstrap]
Initialized Drupal 8.0-dev root directory at /home/s335e61b61f9ad26/www [0.08 sec, 12.09 MB]                                    [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.08 sec, 12.09 MB]                                                  [bootstrap]
Initialized Drupal site default at sites/default [0.08 sec, 12.1 MB]                                                            [notice]
Cache HIT cid: 6.0-dev-commandfiles-2-699657487b88e8b0c2ede2984aa12913 [0.08 sec, 12.1 MB]                                       [debug]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.09 sec, 12.2 MB]                                          [bootstrap]
Drush command terminated abnormally due to an unrecoverable error. [0.09 sec, 12.64 MB]                                      [error]

Tried with different commits in the 8.x-6.x branch of drush, but it just keeps failing

drush version
 Drush Version   :  6.0-dev 
patrickd’s picture

okay.. I think I figured it out now, seems like preparing an empty settings.php without having drupal installed confuses drush..

patrickd’s picture

Status: Active » Fixed

committed pushed deployed works

wow this one was annoying

moshe weitzman’s picture

Status: Fixed » Active

It is not clear what drush needs to do here if anything.

patrickd’s picture

okay, that's kind of an unspecific question..

this issue is about the advanced option called "add an additional project" on simplytest.me.
all projects added will be downloaded using drush, so it can take care of downloading the correct and current stable version.
problem was that I was using drush 5.7 and it didn't work with d8
I upgraded to 6.x and it still did not work because drush kept putting the files into the root directory of drupal, creating an "all" directory resolved that issue.
another problem was that a default.settings.php was copied to settings.php, drush 6 kept failing as long as there was this "empty" settings file

so now drush works just as expected and just downloads a list of contrib projects...

sun’s picture

If I understand it correctly, then the two issues seem to be:

  1. If default.settings.php is copied into settings.php before Drupal is installed, then Drush denies to download modules.
  2. If there is no /sites/all directory and Drupal is not installed yet, then Drush downloads modules into the top-level directory.
patrickd’s picture

Status: Active » Fixed

Right, just in addition to point 1: It does not only deny download, drush completely errors with
Drush command terminated abnormally due to an unrecoverable error.

I still consider *this* issue as fixed, I will create two followup's for drush:
#1937050: Drush 6: if no sites/all exists it downloads to root
#1937052: Drush 6: Fatal error with empty settings.php

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.