After update drush quits with error "Trait not found"

Created on 25 November 2024, 27 days ago

Problem/Motivation

After running composer update including an update of Search API to 8.x-1.36, Drush stops working and gives the error message:

PHP Fatal error: Trait "Drush\Commands\AutowireTrait" not found in /var/www/web/modules/contrib/search_api/src/Drush/Commands/SearchApiDrushCommands.php on line 23
[warning] Drush command terminated abnormally.

This is due to running a Drush version < 12.5 on my instance (having Drush 12.4.3). Same issue was already reported to the Drush development team for the Devel-module, see https://github.com/drush-ops/drush/issues/5941

Proposed resolution

The resolution is described in the same issue in this comments: https://github.com/drush-ops/drush/issues/5941#issuecomment-2025263217 https://github.com/drush-ops/drush/issues/5941#issuecomment-2025352930 - the Devel resolution is to set `"drush/drush": "<12.5.1"` as conflict in composer.json. Could this also be a solution for search_api?

🐛 Bug report
Status

Active

Version

1.36

Component

Drush / Rules

Created by

🇦🇹Austria kil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024