boa icon indicating copy to clipboard operation
boa copied to clipboard

drush 10 error - incompatible local packages

Open zanami opened this issue 3 years ago • 6 comments

Drush drush10-bin doesn't work on my D8 site if search_api_solr is enabled.

  1. Drupal 8 (~/static/platformname) implies search_api_solr 1.23
  2. search_api_solr depends on consolidation/annotated-command:2.12.2
  3. drush10-bin (/opt/tools/drush/10/drush/) depends on consolidation/annotated-command:4.40.0
  4. drush10-bin inside ~/static/platformname or with @platformname/@sitename alias throws this
[26-Jan-2023 11:38:45 UTC] PHP Fatal error:  Uncaught TypeError: call_user_func_array() expects parameter 1 to be a valid callback, class 'Consolidation\AnnotatedCommand\AnnotatedCommandFactory' does not have a method 'addIgnoredCommandsRegexp' in /opt/tools/drush/10/drush/vendor/league/container/src/Definition/Definition.php:273
Stack trace:
...

Is there a workaround for this? Installing/removing drush locally?

zanami avatar Jan 26 '23 13:01 zanami

Hello, I have been trying to understand how BOA uses different versions of drush. For a drupal 9 or drupal 10 site, are we suppossed to call drush9, drush10 or drush9-bin or drush10-bin instead of simply "drush" when on the command line as the octopus ftp user at the site in question?

For example to do a db update on a drupal 9.5.2 site using drush:

as user o1-ftp

cd static/d952/sites/example.com drush updb OR drush9-bin updb ? OR does it not even matter?

This post isn't off-topic, as I seriously need to undersand this - and have never seen any instructions that answer it - in order to confirm the problem on our BOA server.

Thank you anyone for a clear answer.

Best,

Ed

EdNett avatar Jan 27 '23 09:01 EdNett

In theory, up to D9 you are fine with drush updb

It’s gonna be drush 8 which is fine.

However, updb aside, most of the contrib modules do not provide drush 8 support in their recent versions.

I decided to downgrade migrate tools to v4 to be able to run migrations with drush 8. Or I could use drush10-bin with v5 for that specific task which isn’t great.

zanami avatar Jan 27 '23 10:01 zanami

Drush 10 is deprecated anyway, instead we recommend drush11-bin, although it's still debugged for standalone use without drushlr (Drush Launcher). If your site really needs older Drush 10, you should probably add site-local drush back again (Aegir normally removes it on platform verify because it still collides with Aegir tasks), then use drushlr (Drush Launcher) to allow the site to use its own Drush version.

omega8cc avatar Apr 27 '23 23:04 omega8cc

Also, it could be a symptom of known issues with the wider compatibility matrix between various Drush, Drupal and Symfony versions we are currently working on to make hosting Drupal 10 on Aegir possible.

omega8cc avatar May 08 '23 14:05 omega8cc

Ah, I probably misunderstood the original issue.. but reading it again, you can't use Drush 10 with this site, because only Drush 8 comes with the old consolidation/annotated-command:2.12.2

So again, the problem is expected because search_api_solr 1.23 depends on too old consolidation/annotated-command to be able to work with Drush 10 and there is nothing you can do about that -- you are locked with Drush 8 for this site.

Not sure however why you expected or needed Drush 10 to work with this site?

Drush 8 officially supports Drupal 8 after all: https://www.drush.org/11.x/install/

omega8cc avatar May 11 '23 00:05 omega8cc

@EdNett Please check the versions compatibility matrix at https://www.drush.org/11.x/install/

To make the situation more complex, here is our matrix:

Aegir Provision -- Symfony 3.4.0 (PHP 7.4 max) (Drupal 6-9)

Drush 8.4.12.4  -- Symfony 2.8.3 (PHP 8.2 max) (Drupal 6-9)
Drush 10.6.2    -- Symfony 4.4.0 (PHP 7.4 max) (Drupal 8-9)
Drush 11.5.1    -- Symfony 5.4   (PHP 7.4+)    (Drupal 9-10)
Drush 12.0.0    -- Symfony 6.1   (PHP 8.1+)    (Drupal 10+)

Drupal core 7   -- no Symfony  (PHP 8.2 since 7.94)
Drupal core 8   -- Symfony 3.4 (PHP 7.4 since 8.8.3)
Drupal core 9   -- Symfony 4.4 (PHP 8.1 since 9.3.0)
Drupal core 10  -- Symfony 6.1 (PHP 8.2 since 10.0.0)

omega8cc avatar May 11 '23 00:05 omega8cc