Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Setup
- Solr version: N/A
- Drupal Core version: 9.2 latest
- Search API version: 1.23.0
- Search API Solr version: 4.2.7
- Configured Solr Connector: N/A
Issue
Precisely from 4.1.11 to 4.2.7 due to this commit that changed the constructor signature of a service in a minor/patch version which breaks the service container in given circumstences. See #2918906.
(Also related Search API issue from 2 years ago: #3126367)
Calling any Drush command after composer install
leads to
TypeError: Argument 1 passed to Drupal\search_api_solr\Commands\SearchApiSolrCommands::__construct() must be an instance of Drupal\search_api_solr\Utility\SolrCommandHelper, instance of Drupal\Core\Entity\EntityTypeManager given, called in /mnt/files/local_mount/build/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 262 in Drupal\search_api_solr\Commands\SearchApiSolrCommands->__construct() (line 35 of /mnt/files/local_mount/build/web/modules/contrib/search_api_solr/src/Commands/SearchApiSolrCommands.php).
Issue fork search_api_solr-3273289
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mxr576Comment #4
mxr576Comment #5
mxr576Comment #6
mxr576Comment #7
mkalkbrennerA simple "drush cr" should fix it.
Comment #8
mkalkbrennerAnytime you update your dependencies using composer you must rebuild your container.
In general you just run "drush updb".
Comment #9
mxr576> A simple "drush cr" should fix it.
Unfortunately, it does not.
Although after a few days and another round of unexpected failures elsewhere it can be related to having cache.container stored in Redis which is not flushed by drush cr :S
Comment #10
mkalkbrennerOK, thanks for the feedback. So there's no broken upgrade path but an issue when storing the "wrong" cache bin in Redis.