Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I am getting an error when trying to install this module on Drupal 8.7.7 project:
$ composer require 'drupal/search_api_solr:^3.5'
./composer.json has been updated
Gathering patches for root package.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for symfony/event-dispatcher (locked at v3.4.31) -> satisfiable by symfony/event-dispatcher[v3.4.31].
- drupal/search_api_solr 3.x-dev requires solarium/solarium ~5.1.3 -> satisfiable by solarium/solarium[5.1.3].
- drupal/search_api_solr 3.5.0 requires solarium/solarium ~5.1.3 -> satisfiable by solarium/solarium[5.1.3].
- Conclusion: don't install solarium/solarium 5.1.3
- Installation request for drupal/search_api_solr ^3.5 -> satisfiable by drupal/search_api_solr[3.x-dev, 3.5.0].
Because drupal/core requires: "symfony/event-dispatcher": "~3.4.0",
is this related or should I open a new issue?
EDIT:
Fixed my issue by installing an older version:
composer require 'drupal/search_api_solr:^3.4'
./composer.json has been updated
Gathering patches for root package.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 4 installs, 0 updates, 0 removals
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
- Installing solarium/solarium (5.0.3): Downloading (100%)
- Installing myclabs/php-enum (1.7.2): Downloading (100%)
- Installing maennchen/zipstream-php (1.2.0): Downloading (100%)
- Installing drupal/search_api_solr (3.4.0): Downloading (100%)
solarium/solarium suggests installing minimalcode/search (Query builder compatible with Solarium, allows simplified solr-query handling)
drupal/search_api_solr suggests installing drupal/facets (Provides facetted search.)
drupal/search_api_solr suggests installing drupal/search_api_autocomplete (Provides auto complete for search boxes.)
drupal/search_api_solr suggests installing drupal/search_api_location (Provides location searches.)
drupal/search_api_solr suggests installing drupal/search_api_spellcheck (Provides spell checking and 'Did You Mean?'.)
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
Stop the web server: sudo service apache2 stop
Remove Solrarium and Search Api Solr: composer remove solarium/solarium drupal/search_api_solr
Download Search Api Solr and Symfony 4 event dispatcher: composer require symfony/event-dispatcher:"4.3.4 as 3.4.99" drupal/search_api_solr
Restart the web server: sudo service apache2 start
Update the database: drush updb --yes
Clear the cache: drupal cr all
Once again thx @mkalkbrenner, hope this would help others facing the same problem with solarium.
HI Markus, I first want to thank you for all your efforts. I recognize the issue isn't an easy one to solve here.
The 'alias' fix proposed is problematic for those with any sort of build-test-deploy pipeline (or at least for us). As mentioned in #2876675: Allow symfony/event-dispatcher 4+ to be installed in Drupal 8, doing so breaks testbot for core, and for us, the Behat drupal-extension chokes unexpectedly during Behat tests, complaining about the dispatcher mismatch:
PHP Fatal error: Declaration of Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy::dispatch($event) must be compatible with Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch($eventName, ?Symfony\Component\EventDispatcher\Event $event = NULL) in /app/html/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php on line 25
As a result, our builds don't test green, so they don't deploy. We've gone down several roads attempting to resolve this : alias the version in the testing framework, aliasing to a real version, but they all lead to other issues. In the end, we simply decided to pin the module to 3.4.
It seems that #2876675: Allow symfony/event-dispatcher 4+ to be installed in Drupal 8 is unlikely to be committed soon (or at all) as well, which leaves you in a tough position. I don't have any solutions or suggestions, but I wanted to report that the version alias can have fallout and does not solve the issue for everyone.
Comments
Comment #2
mkalkbrennerComment #3
mkalkbrennerComment #5
mkalkbrennerComment #6
maticb commentedI am getting an error when trying to install this module on Drupal 8.7.7 project:
$ composer require 'drupal/search_api_solr:^3.5'
./composer.json has been updated
Gathering patches for root package.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for symfony/event-dispatcher (locked at v3.4.31) -> satisfiable by symfony/event-dispatcher[v3.4.31].
- drupal/search_api_solr 3.x-dev requires solarium/solarium ~5.1.3 -> satisfiable by solarium/solarium[5.1.3].
- drupal/search_api_solr 3.5.0 requires solarium/solarium ~5.1.3 -> satisfiable by solarium/solarium[5.1.3].
- Conclusion: don't install solarium/solarium 5.1.3
- Installation request for drupal/search_api_solr ^3.5 -> satisfiable by drupal/search_api_solr[3.x-dev, 3.5.0].
Because drupal/core requires: "symfony/event-dispatcher": "~3.4.0",
is this related or should I open a new issue?
EDIT:
Fixed my issue by installing an older version:
composer require 'drupal/search_api_solr:^3.4'
./composer.json has been updated
Gathering patches for root package.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 4 installs, 0 updates, 0 removals
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
- Installing solarium/solarium (5.0.3): Downloading (100%)
- Installing myclabs/php-enum (1.7.2): Downloading (100%)
- Installing maennchen/zipstream-php (1.2.0): Downloading (100%)
- Installing drupal/search_api_solr (3.4.0): Downloading (100%)
solarium/solarium suggests installing minimalcode/search (Query builder compatible with Solarium, allows simplified solr-query handling)
drupal/search_api_solr suggests installing drupal/facets (Provides facetted search.)
drupal/search_api_solr suggests installing drupal/search_api_autocomplete (Provides auto complete for search boxes.)
drupal/search_api_solr suggests installing drupal/search_api_location (Provides location searches.)
drupal/search_api_solr suggests installing drupal/search_api_spellcheck (Provides spell checking and 'Did You Mean?'.)
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
Comment #7
mkalkbrennerDidn't you read the release notes? Or Install.md or Readme.md?
Comment #8
maticb commentedNo, I did not, thank you for pointing it out :)
Comment #9
karimb commentedI had the same issue with solarium trying to update from search_api_solr 3.4 to 3.6 with composer.
This is what I did to resolve this problem with the help of @mkalkbrenner in https://drupalchat.me/channel/search
Stop the web server:
sudo service apache2 stopRemove Solrarium and Search Api Solr:
composer remove solarium/solarium drupal/search_api_solrDownload Search Api Solr and Symfony 4 event dispatcher:
composer require symfony/event-dispatcher:"4.3.4 as 3.4.99" drupal/search_api_solrRestart the web server:
sudo service apache2 startUpdate the database:
drush updb --yesClear the cache:
drupal cr allOnce again thx @mkalkbrenner, hope this would help others facing the same problem with solarium.
Comment #10
jacobsanfordHI Markus, I first want to thank you for all your efforts. I recognize the issue isn't an easy one to solve here.
The 'alias' fix proposed is problematic for those with any sort of build-test-deploy pipeline (or at least for us). As mentioned in #2876675: Allow symfony/event-dispatcher 4+ to be installed in Drupal 8, doing so breaks testbot for core, and for us, the Behat drupal-extension chokes unexpectedly during Behat tests, complaining about the dispatcher mismatch:
PHP Fatal error: Declaration of Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy::dispatch($event) must be compatible with Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch($eventName, ?Symfony\Component\EventDispatcher\Event $event = NULL) in /app/html/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php on line 25As a result, our builds don't test green, so they don't deploy. We've gone down several roads attempting to resolve this : alias the version in the testing framework, aliasing to a real version, but they all lead to other issues. In the end, we simply decided to pin the module to 3.4.
It seems that #2876675: Allow symfony/event-dispatcher 4+ to be installed in Drupal 8 is unlikely to be committed soon (or at all) as well, which leaves you in a tough position. I don't have any solutions or suggestions, but I wanted to report that the version alias can have fallout and does not solve the issue for everyone.
Thanks again.