Hi,

I tried to download this module with composer by

composer require 'drupal/search_api_solr:^3.6'

I keep getting the following error message which seems quite confusing to me as it states solarium 5.1.3 is needed but I shall not install it:

Problem 1
    - Installation request for symfony/event-dispatcher (locked at v3.4.30) -> satisfiable by symfony/event-dispatcher[v3.4.30].
    - 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.6.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.6 -> satisfiable by drupal/search_api_solr[3.x-dev, 3.6.0].

Looking here https://packagist.org/packages/solarium/solarium it seems that solarium needs symfony/event-dispatcher: ^4.3 but when I run composer update I just get symfony/event-dispatcher 3.4.31 - might this be the issue? as to why the change was made.

Comments

tobiberlin created an issue. See original summary.

tobiberlin’s picture

Title: Composer not installing this module » Composer not installing this module - Symfony 4 needed for Solarium?
gwvoigt’s picture

I'm currently on 8.x-3.4 and getting the same error when trying to update to 8.x-3.5 or 8.x-3.6.

mkalkbrenner’s picture

gwvoigt’s picture

I could update the module doing:

drush pm-uninstall search_api_solr -y
composer remove drupal/search_api_solr
composer require symfony/event-dispatcher:"4.3.4 as 3.4.99"
composer require 'drupal/search_api_solr:^3.6'

But I already had 8.x-3.4 installed, not sure if that's your case. But you might try the following code, as it's suggested here: https://git.drupalcode.org/project/search_api_solr/blob/8.x-3.x/INSTALL.md

composer require symfony/event-dispatcher:"4.3.4 as 3.4.99" drupal/search_api_solr
mkalkbrenner’s picture

drush pm-uninstall search_api_solr -y
composer remove drupal/search_api_solr

This should not be required.

tobiberlin’s picture

This worked so far - thank you for your prompt support. I feel a little bit uncomfortable using a 4.x version of a Symfony component while the rest of the system remains on version 3.x. Are there no dependencies for the event dispatcher specific to Symfony 4?

mkalkbrenner’s picture

It's described in depth at #2876675: Allow symfony/event-dispatcher 4+ to be installed in Drupal 8.

It's a common misunderstanding. You don't switch to symfony 4 in any way.
It's just one package that is expicitly declared to be backward compatible to symfony 3.4 which is used by core.

But this one package provides the backward and forward compatibility layer for projects and libraries that use symfony's event dispatching.

In solarium we followed the guide to be compatible to symfony 3.4 - 5.x.

It would ease the discussion if this particular package would not have been named "symfony/...".
Unfortunately some people make the same mistake in their argumentation in the corresponding core issue :-(

BTW the same fix has been committed to drush already!

Maybe it would help if some people could comment on the core issue that upgrading the symfony/event-dispatcher to 4.3.x ONLY works without any issues.

spokje’s picture

> Maybe it would help if some people could comment on the core issue that upgrading the symfony/event-dispatcher to 4.3.x ONLY works without any issues.

https://www.drupal.org/project/drupal/issues/2876675#comment-13272878

For those who don't want to click a TLDR: Our agency has been using search_api_solr 8.x-3.5 with symfony/event-dispatcher 4.3.x without any issues on 4 sites since the release of this version of search_api_solr.
We will be using it on our other 7 Solr-using sites shortly.

tobiberlin’s picture

Thank you for this clarification

karimb’s picture

I had the same issue 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 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.

trevorbradley’s picture

How this is this not a critical bug in 3.6?

Dependencies are there for a reason. Fudging the version numbers of symfony/event-dispatcher seems a really bad way to go here. What if there's an urgent security update?

Wouldn't holding any required features until #2876675: Allow symfony/event-dispatcher 4+ to be installed in Drupal 8 is passed and 8.8 is released, or bumping search_api_solr to version to a 4.x-dev have made more sense?

EDIT: OK, my questions are answered over in #3081993: Upgrade dependencies for 3.5 release. It's in the release notes. See https://www.drupal.org/project/search_api_solr/releases/8.x-3.6 :

The symfony/event-dispatcher issue!

Since solarium 5.1 contains important bug fixes that solve issues for Drupal user's as well, we decided to require solarium 5.1 for search_api_solr 8.x-3.5. But until #2876675: Allow symfony/event-dispatcher 4+ to be installed in Drupal 8 gets committed to core and released, you need to run an adjusted composer command for installation:
composer require symfony/event-dispatcher:"4.3.4 as 3.4.99" drupal/search_api_solr:^3.5
For an upgrade of search_api_solr you have to run this line before composer update:
composer require symfony/event-dispatcher:"4.3.4 as 3.4.99"

mkalkbrenner’s picture

My opinion is different. We had a critical issue in search_api_solr leading to a fatal error. This was fixed by upgrading solarium.

From my point of view the core issue needs to be committed AND backported to drupal 8.7 to not block urgent security updates of third party libraries for no reason.
The version requirement we talk about here is for an interface that even hasn’t changed between 3.4 and 4.3! Nothing else!

BTW solarium has more users outside of drupal. There’s no reason to block those by not adjusting the event dispatcher. It’s the drupal project that has to react and to apply the backward compatible change!

But there’re two more workarounds possible until the core issue gets committed:

  1. Apply the core patch
  2. composer require solarium/solarium:”5.0.3 as 5.1.3 if you’re not affected the fatal error
mkalkbrenner’s picture

And again, someone ran into the rerank issue of solarium 5.0: #3085024: Keywords with apostrophe return no results

Don’t think that I don’t care about the search api users. I care that much that I didn’t hesitate to create patches for core and drush. While the patch for drush is already committed, it already took my days of my free time to discuss the core issue.

And if I would have created 4.x People would stay with 3.x and filing bug reports.

That’s why I choose the hard way to create awareness even with taking the risk of a s...storm ;-)

mkalkbrenner’s picture

Category: Support request » Bug report
Priority: Normal » Major
Status: Active » Needs review
StatusFileSize
new4.63 KB

OK, I think I created enough awareness about how core blocks contrib ;-)

Let's turn the module in an installable state and add a message to the status report instead.

trevorbradley’s picture

Issue summary: View changes

Hey @mkalkbrenner - my apologies for going into instant response mode over the dependencies. The next time I see some weird conflict, I'm going to check with the release notes before reacting.

If there's critical bug fixes that need to be deployed, and core is lagging behind, then definitely search_api_solr should find a workaround!

That being said, the release notes for 3.5 explain the what of the update, without explaining the why:

Since solarium 5.1 contains important bug fixes that solve issues for Drupal user's as well, we decided to require solarium 5.1 for search_api_solr 8.x-3.5.

I see that #3081993: Upgrade dependencies for 3.5 release exists, but there's absolutely no context there as to why these changes were made. Without that context, these changes seem really strange.

If there are issues that required the change, maybe they should be linked from #3081993: Upgrade dependencies for 3.5 release?

zenimagine’s picture

@mkalkbrenner I do not understand, everything is up to date and works perfectly. But since the update Composer is in error.

mkalkbrenner’s picture

@TravorBradly
Since nobody pays as a full-time Drupal Contrib or Open Source Developer, a lot of things aren't document as good as possible ;-)

I meanwhile created #3085196: How to upgrade to solarium 5.1.x, 5.2.x or 6.0.x. This issue will be linked from the drupal status report of your installation.
I'll release 3.7 soon. This one will allow the installation with solarium 5.0 since this would work for a lot of people.

But to be honest, I'm rather frustrated by the current state of #2876675: Allow symfony/event-dispatcher 4+ to be installed in Drupal 8. I'm still of the opinion that core could unblock us here without any risk.

trevorbradley’s picture

Thanks @mkalkbrenner! Sorry for being such a thorn on this one.

The hard work of open source devs is vastly underappreciated. I hope this firestorm dies down soon.

Added my voice over at #2876675: Allow symfony/event-dispatcher 4+ to be installed in Drupal 8 - a backport to 8.7.x would make this issue entirely vanish.

  • mkalkbrenner committed 6d27691 on 8.x-3.x
    Issue #3083601 by mkalkbrenner: Composer not installing this module -...
mkalkbrenner’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.