This is a (25 sites) multisite setup running smoothly on Drupal 9.4 with Drush 10.x still.
Upgrading to Drupal 10.1.x and Drush 11 or 12 however makes Drush unusable.
Dir layout as installed by drupal/core-recommended:
/var/www/projectroot/
├── composer.json
├── composer.lock
├── config
│ └── mysite.com
├── vendor
│ ├── asm89
│ │ └── stack-cors
│ ├── behat
│ │ ├── mink
│ │ ├── mink-browserkit-driver
│ │ └── mink-goutte-driver
│ ├── bin
│ └── drush
│ ├── bjeavons
│ │ └── drupal-finder
│ ├── drush
│ │ └── drush
│ │ ├── appveyor.yml
: : :
│ │ ├── drush
│ │ └── drush.bat
: :
│ └── wikimedia
│ └── composer-merge-plugin
└── web
├── libraries
├── modules
│ ├── contrib
│ └── custom
├── profiles
├── robots.txt
├── sites
│ ├── default
│ └── mysite.com
│ ├── files
│ ├── services.yml
│ └── settings.php
├── sites.php
├── themes
│ └── mytheme
├── update.php
└── web.config
:
denotes items I think that are not relevant are left out.
The vendor directory is actually much bigger:
$ find vendor | wc -l
41837
composer.json:
{
"name": "myproject",
"description": "myproject",
"type": "project",
"require": {
"cweagans/composer-patches": "^1.7",
"drupal/admin_feedback": "^2.2",
"drupal/admin_toolbar": "*",
"drupal/allowed_formats": "^1.3",
"drupal/animated_gif": "^2.0",
"drupal/asset_injector": "^2.7",
"drupal/better_passwords": "2.x",
"drupal/block_content_machine_name": "dev-3286263-automated-drupal-10 as 3.0.2",
"drupal/bootstrap_barrio": "^5.1",
"drupal/ckeditorheight": "^1.8",
"drupal/config_split": "^2.0@RC",
"drupal/config_update": "*",
"drupal/cookies": "^1.0",
"drupal/core": "10.1.*",
"drupal/core-composer-scaffold": "10.1.*",
"drupal/core-project-message": "10.1.*",
"drupal/core-recommended": "10.1.*",
"drupal/csv_importer": "^1.15",
"drupal/draggableviews": "^1.2",
"drupal/easy_breadcrumb": "^2.0",
"drupal/editor_file": "*",
"drupal/facets": "^2.0",
"drupal/file_extractor": "^4",
"drupal/fixed_block_content": "dev-3357439-ui-updating-to",
"drupal/focal_point": "^2.0",
"drupal/fontyourface": "^3.5",
"drupal/glossify": "^2.0",
"drupal/imce": "*",
"drupal/libraries": "^4.0",
"drupal/matomo": "^1.12",
"drupal/menu_block": "*",
"drupal/menu_breadcrumb": "*",
"drupal/menu_item_role_access": "^2.0",
"drupal/menu_trail_by_path": "*",
"drupal/metatag": "^1.16",
"drupal/migrate_plus": "^6.0",
"drupal/migrate_process_url": "^2.0.x-dev",
"drupal/migrate_tools": "^6.0",
"drupal/override_node_options": "^2.6",
"drupal/paragraphs": "^1.12",
"drupal/paragraphs_edit": "^2.0",
"drupal/pathauto": "^1.3",
"drupal/permissions_by_term": "^3.1",
"drupal/restui": "^1.17",
"drupal/search_api": "^1.11",
"drupal/simple_sitemap": "^4.1",
"drupal/sitemap": "^2.0",
"drupal/smart_trim": "*",
"drupal/svg_image": "^1.14",
"drupal/term_csv_export_import": "^4.0",
"drupal/toc_js": "^2.1",
"drupal/tome": "1.8.*",
"drupal/unique_field_ajax": "^2.0",
"drupal/user_current_paths": "^2.0",
"drupal/user_redirect": "^1.0",
"drupal/video_embed_field": "^2.0",
"drupal/video_embed_wysiwyg": "^2.0",
"drupal/views_ajax_history": "^1.2",
"drupal/views_block_area": "^1.0",
"drupal/viewsreference": "^2.0",
"drupal/webform": "^6.0",
"drush/drush": "^11",
"http-interop/http-factory-guzzle": "^1.0",
"guzzlehttp/guzzle": "^7.4",
"phpmailer/phpmailer": "^6.0",
"toc/toc": "*",
"wikimedia/composer-merge-plugin": "^2.0"
},
"require-dev": {
"behat/mink": "*",
"behat/mink-goutte-driver": "*",
"drupal/devel": "*",
"mikey179/vfsstream": "~1.2",
"phpunit/phpunit": "^9",
"symfony/css-selector": "^4.4"
},
"authors": [
{
"name": "me",
"email": "[email protected]"
}
],
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8",
"exclude": [ "drupal/search_api_meilisearch", "drupal/better_passwords", "drupal/block_content_machine_name", "drupal/fixed_block_content" ]
},
{
"type": "package",
"package": {
"name": "toc/toc",
"version": "v0.3.2",
"type": "drupal-library",
"dist": {
"url": "https://raw.githubusercontent.com/jgallen23/toc/greenkeeper/update-all/dist/toc.min.js",
"type": "file"
}
}
},
{
"type": "git",
"url": "git@mygitserver:search_api_meilisearch"
},
{
"type": "git",
"url": "https://git.drupalcode.org/issue/better_passwords-3296626.git"
},
{
"type": "git",
"url": "https://git.drupalcode.org/issue/block_content_machine_name-3286263.git"
},
{
"type": "git",
"url": "https://git.drupalcode.org/issue/fixed_block_content-3357439.git"
}
],
"minimum-stability": "dev",
"extra": {
"patches": {
"drupal/core": {
"Field options 'Rewrite results' and 'Link to the Content' applied together is not working as expected": "https://www.drupal.org/files/issues/2018-11-12/views_link_trim-2600456-22.patch",
"Add file-mime formatter and make it output icons": "https://www.drupal.org/files/issues/2021-07-15/2907414-31.patch",
"Large decimal number do not validate as they should": "https://www.drupal.org/files/issues/2022-07-26/2230909-269.patch",
"Fix unnecessary multiple settings updates in AJAX calls": "https://www.drupal.org/files/issues/2021-05-12/2771361-42.patch",
"Add a 'machine_name' widget for string field types with a UniqueField constraint": "https://www.drupal.org/files/issues/2023-05-17/drupal-10-1x-machine-name-widget-2685749-116.patch"
},
"drupal/toc_js": {
"Disable showing the ToC as a default": "patches/toc_js_per_node_default_off.diff",
"Fix umlaut and trailing special char conversion in ToC": "patches/toc_js_umlaut_and_trailing_char_fix.patch"
},
"drupal/metatag": {
"Unset link rel: shortlink, edit-form, version-history and revision, and meta name: Generator, MobileOptimized, HandheldFriendly, viewport from <head> https://www.drupal.org/project/metatag/issues/2735195": "https://www.drupal.org/files/issues/2021-04-29/metatag-unset-2735195-59.patch"
},
"drupal/bootstrap_barrio": {
"Add missing jquery.once dependency for affix.js (https://www.drupal.org/project/bootstrap_barrio/issues/3278329 and ../3366908) #9505-10": "https://www.drupal.org/files/issues/2023-06-14/3366908-2.patch"
},
"drupal/webform": {
"Fix broken result export with drush": "https://www.drupal.org/files/issues/2023-01-26/3335851-4.patch"
},
"drupal/permissions_by_term": {
"Fix content is not editable with 3.1.22": "https://git.drupalcode.org/project/permissions_by_term/-/merge_requests/20.patch"
},
"drupal/facets": {
"Facets with AJAX not working": "https://www.drupal.org/files/issues/2023-02-07/facets-with-ajax-not-working-in-most-of-situations-3052574-174.patch"
}
},
"drupal-scaffold": {
"locations": {
"web-root": "./web"
}
},
"enable-patching": true,
"installer-paths": {
"web/core": [ "type:drupal-core" ],
"web/modules/contrib/{$name}": ["type:drupal-module"],
"web/libraries/{$name}": ["type:drupal-library"],
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
"web/themes/contrib/{$name}": ["type:drupal-theme"],
"web/drush/contrib/{$name}": ["type:drupal-drush"],
"web/themes/custom/{$name}": ["type:drupal-custom-theme"]
},
"merge-plugin": {
"include": [
"web/modules/contrib/webform/composer.libraries.json"
]
}
},
"prefer-stable": true,
"conflict": {
"drupal/drupal": "*"
},
"config": {
"sort-packages": true,
"optimize-autoloader": true,
"allow-plugins": {
"composer/installers": true,
"drupal/console-extend-plugin": true,
"cweagans/composer-patches": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true,
"wikimedia/composer-merge-plugin": true,
"php-http/discovery": true
}
}
}
As suggested in the comments, I reduced this to a minimum viable setup:
{
"name": "myproject",
"description": "myproject",
"type": "project",
"require": {
"drupal/core": "*",
"drupal/core-composer-scaffold": "*",
"drupal/core-project-message": "*",
"drupal/core-recommended": "*",
"drush/drush": "*"
},
"authors": [
{
"name": "me",
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"extra": {
"drupal-scaffold": {
"locations": {
"web-root": "./web"
}
},
"enable-patching": true,
"installer-paths": {
"web/core": [ "type:drupal-core" ],
"web/modules/contrib/{$name}": ["type:drupal-module"],
"web/libraries/{$name}": ["type:drupal-library"],
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
"web/themes/contrib/{$name}": ["type:drupal-theme"],
"web/drush/contrib/{$name}": ["type:drupal-drush"],
"web/themes/custom/{$name}": ["type:drupal-custom-theme"]
},
"merge-plugin": {
"include": [
"web/modules/contrib/webform/composer.libraries.json"
]
}
},
"prefer-stable": true,
"conflict": {
"drupal/drupal": "*"
},
"config": {
"sort-packages": true,
"optimize-autoloader": true,
"allow-plugins": {
"composer/installers": true,
"drupal/console-extend-plugin": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true,
"php-http/discovery": true
}
}
}
After this, I ran composer update
(as the recommended composer update "drupal/core-*" -W
would not update drupal/core as it was still locked to 9.4.x).
Still no joy.
On Drupal 9.4 and Drush 10.x, I was able to just use drush -l mysite.com
when in /var/www/projectroot (or somewhere below, as well).
Now, no matter the CWD, I cannot for the life of me get drush to output meaningful stuff.
user@webserver:/var/www/projectroot/web $ ../vendor/drush/drush/drush --root=sites/mysite.com
or
user@webserver:/var/www/projectroot $ vendor/bin/drush --root=web/sites/mysite.com
or any other parameter combination with -l
or --url
or using absolute paths does not yield anything meaningful.
With drush 11 I get
! [NOTE] Drupal root not found. Pass --root or a @siteAlias in order to see Drupal-specific commands.
With is really strange, as drush seems to find the root (last line):
user@webserver:/var/www/projectroot $ vendor/bin/drush st
PHP binary : /usr/bin/php8.1
PHP config : /etc/php/8.1/cli/php.ini
PHP OS : Linux
PHP version : 8.1.21
Drush script : /var/www/projectroot/vendor/bin/drush
Drush version : 11.6.0
Drush temp : /tmp
Drush configs : /var/www/projectroot/vendor/drush/drush/drush.yml
Drupal root : /var/www/projectroot/web
Drush is installed via composer, as per the docs.
Drush 12 only gives me:
The alias references a Drupal site that does not contain its own copy of Drush. Please add Drush to this site to use it.
(Note the double blank after alias; I consider this a bug, the error message should be different when a variable is undefined).
I can get similar output to Drush 11 if I use @none
as an alias.
I don't need aliases and only want to use drush locally on this dev-server. Deployment has its own automatic framework.
Do I need a copy of drush in every multisite's sites/<sitename>
dir?
I know global drush is not supported anymore, I switched from a system-wide installed drush to one in my project dir installed via composer (like it is still now) back at Drupal 8 and consider this locally installed, but I may be wrong?
If so, how?
Happy to provide more debug info if needed.
Thanks in advance for anyone taking a look at this!