-
Notifications
You must be signed in to change notification settings - Fork 59
Search::ElasticSearch 8 breaks connect to Elastic 5.6 #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Same issue attempting to connect to Elasticsearch 6.8.23 using 6_0::Direct. |
@mariopaumann if you want to connect to Elasticsearch 5.6 you can use |
@Grinnz , @mariopaumann the versions of |
That's not really a solution. CPAN modules are expected to be maintained at the latest version. That's why 5_0::Direct and 6_0::Direct were split into separate distributions to begin with. |
If you want it to function this way, you will have to release Search::Elasticsearch 5.x and 6.x etc as separate modules with different names, and force users to change the module they are using. |
@Grinnz I'm not sure I'm following, we are mantaining the latest version in CPAN as here. For historical reason, $e = Search::Elasticsearch->new(
client => '7_0::Direct'
); In the meantime, you can also build another client object with |
I mean that CPAN modules are meant to be maintained at their latest available version by end users. So if someone is to install https://metacpan.org/pod/Search::Elasticsearch::Client::6_0::Direct it will install the latest version of Search::Elasticsearch which is unable to connect to Elasticsearch 6.x. And when the user upgrades their CPAN modules, perhaps even to connect to Elasticsearch 8.x with another project. they become unable to connect to Elasticsearch 6.x. |
Confirming I can no longer connect to ES version 6 using latest Client::6_0. |
I'm seeing the same issue even when I install older versions where I can't connect to Elasticsearch 6.x |
With 7,717 I still see the No Nodes available error using
When I run curl against my cluster, it outputs fine. |
Notes for anyone seeing my issue: I was testing on a clean machine, and it looks like LWP::Protocol::https is not declared as a dependency. Installing that fixed my issue. |
@Grinnz we are supporting the last major version (8) and the previous one (7). If you are working with 6 you need to use the previous version (7). If you update all the CPAN modules you can apply version constrain in requires 'Search::Elasticsearch', '>=6.0, <8.0'; Moreover, using cpanm you can specify the version that you want to install, as follows:
If I get your point, you are suggesting that we need to include in |
@srchulo do you want to send a PR for including |
As mentioned, this is unfortunately not sufficient to prevent all issues, as CPAN is not a package manager and cannot prevent Search::Elasticsearch from being upgraded to 8.0 by another process. Your suggestion only works in a constrained Carton/Carmel environment since those are able to pin versions for a particular project.
No, the current separation of distributions works fine, the user simply declares the Direct module they need as a dependency. The problem is that it doesn't work with the latest version of Search::Elasticsearch. |
@Grinnz ok, this means there's something wrong in the process. Can you provide me the steps to reproduce the issue starting from a clean installation? Thanks. |
The only step necessary is: cpanm Search::Elasticsearch::Client::6_0 This will install Search-Elasticsearch-Client-6_0 7.717 and Search-Elasticsearch 8.00, which is unable to connect to an Elasticsearch 6.x node until the user downgrades it. Even if constrained by a cpanfile in the initial install, another process may upgrade Search-Elasticsearch, and Search::Elasticsearch::Client::6_0 can't be installed at the same time as Search::Elasticsearch::Client::8_0 without causing this issue. The only end user solution to reliably keep older versions of modules is dependency tree pinning such as provided by Carton/Carmel, which is of course a good solution but not necessarily a widespread one. |
I am having a similar problem to others here. I have an ES cluster running 5.x, and I installed the latest Search::Elasticsearch from cpan. I have tried with and without "client => '5_0::Direct'" and either way I get the same vague NoNodes error when I try to connect (my code looks very much like srchulo's code above). I traced it down in the code to Search::Elasticsearch::Role::Cxn::process_response() line 366, and the fact that there is no "x-elastic-product" header returned. If I comment out that section, my queries work correctly (regardless of the "client" setting mentioned above). Also, the error message in the throw() on the next line gets lost, and only the vague "NoNodes" error is left. So what is the right way to make this work? |
@trentfisher, @Grinnz, @srchulo, @berick, @mariopaumann I'm working on a fix for this, the solution seems to be to remove the product check with |
I just sent PR #231 for fixing the product check issue. This should solve this issue, @trentfisher , @Grinnz , @srchulo , @berick , @mariopaumann can you confirm? Thanks! |
Another bit of info: A check for under 8x wouldn't work. Any ES under 7.14.0 would be broken as this header was introduced in that version https://www.elastic.co/guide/en/elasticsearch/reference/7.17/release-notes-7.14.0.html. So I suspect this may be breaking quite a few people. As an interim measure, can we just add a ENV variable to disable the check? With the usual HERE BE DRAGONS and You take your life (and by extension production) in your own hand warnings? I am working with my managed ES provider to see if they can add it as I am on 7.10.0, but a nicer solution would be best. Regards Stuart |
Fixed in version_8.12 |
After Upgrading Search::ElasticSearch to latest release 8 we're getting
we're still using elastic 5.6 but with 5_0::Direct. After downgrading to 7.717 it works.
The text was updated successfully, but these errors were encountered: