Skip to content
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

Plan to use ruflin/elastica version 8? #186

Open
jmariller opened this issue May 24, 2024 · 19 comments · May be fixed by #188
Open

Plan to use ruflin/elastica version 8? #186

jmariller opened this issue May 24, 2024 · 19 comments · May be fixed by #188

Comments

@jmariller
Copy link

Hi,

First of all thank you for this library :-)

I am wondering if it is planned to use version 8 of ruflin/elastica, and if so when more or less?

Many thanks

@damienalexandre
Copy link
Member

We would be happy to see Pull Request about this yes. Can you work on this?

Some difficulties could arise:

I would love for our project to be compatible with both 7 and 8.

@jmariller
Copy link
Author

Thank you @damienalexandre for your quick feedback! Sure I can invest some time to try & contribute 🙂

@jmariller
Copy link
Author

also I forgot to mention that I am not sure if we can make it work with both versions, as the namespace for different classes (e.g. Client) has changed between 7 and 8.

@VincentLanglet
Copy link
Contributor

The 8.0.0 version is now released https://github.com/ruflin/Elastica/releases/tag/8.0.0

@jmariller
Copy link
Author

Thanks @VincentLanglet for the update!

@damienalexandre so I started to work on it and now I get following error message for many of the PhpUnit tests:
Elastic\Transport\Exception\NoNodeAvailableException: Exceeded maximum number of retries (1)

I am missing anything, should I set some environment/configuration value?

@damienalexandre
Copy link
Member

The tests are running against a real Elasticsearch.

You can run this:

make start
make test
make stop

It will boot a ES node via Docker and expose port 9999 (we don't use the default 9200 port to avoid touching any real Elasticsearch node you may have on your computer).

@jmariller
Copy link
Author

I had actually tried to start the docker ES node as I saw the makefile, however I still get exactly the same error message 😞 any other idea?

@jmariller
Copy link
Author

hi @damienalexandre so I tried once again to make this work without success, would you have any other hint?

@damienalexandre
Copy link
Member

Could you show the console output?
Can you run docker ps?

@jmariller
Copy link
Author

sure, here it is:

console output (just an extract)
image

docker ps
image

@damienalexandre
Copy link
Member

Can you open http://127.0.0.1:9999/ in a browser?

What does curl http://127.0.0.1:9999/ get you?

@jmariller
Copy link
Author

This is what I get when opening this in a browser:
image

And with curl (essentially the same):
image

@damienalexandre
Copy link
Member

I don't know what's happening but:

  • you have a working php
  • you have a working elasticsearch

Is there something we don't know? Do you have a proxy?

Can you go to http://127.0.0.1:9999/_cluster/health?pretty and paste the result?

@jmariller
Copy link
Author

Thanks for taking the time to help 🙏

Here is the outcome of that URL:

{
"cluster_name": "docker-cluster",
"status": "green",
"timed_out": false,
"number_of_nodes": 1,
"number_of_data_nodes": 1,
"active_primary_shards": 0,
"active_shards": 0,
"relocating_shards": 0,
"initializing_shards": 0,
"unassigned_shards": 0,
"delayed_unassigned_shards": 0,
"number_of_pending_tasks": 0,
"number_of_in_flight_fetch": 0,
"task_max_waiting_in_queue_millis": 0,
"active_shards_percent_as_number": 100
}

@damienalexandre
Copy link
Member

Status green, it should work!

You test from "master" or with your updated dependencies? It looks like the Elastica client is not properly configured, that may be a regression from version 8.

@jmariller
Copy link
Author

aaah got it, it is indeed an issue from version 8! I reverted my changes and it works fine 🎉 alright then, I need to investigate further 😅 thanks again so much for your support 🙏

ps: if anyone sees this and wants to help too, please do 🙂

@jderusse
Copy link

jderusse commented Jul 4, 2024

FYI elastic/elasticsearch-php 8.0 is no more compatible with alternative servers like opensearch.

There is a mechanism that checks the headers elastic/elasticsearch-php#1229

@jmariller
Copy link
Author

thanks @jderusse I have actually also just noticed the same while trying to run the tests with elasticsearch without updating the docker image 👍

@damienalexandre I am making some progress, now some more tests are green 🎉

@jmariller
Copy link
Author

short update, now I have all tests green besides the one for the HttpClientTransport where I might need some help - I'll do as much as I can 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants