-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Getting ElasticsearchWarning on search request #1878
Comments
Hello! Thanks for opening this, it looks like you're running into a warning stemming from product verification. We implement product verification in 7.x via a pre-flight request to There are a couple ways to silence the warning for 7.x though, you can either:
import warnings
client = Elasticsearch(...)
with warnings.catch_warnings(record=True) as w:
client.info()
client.search(...)
# (Further usage of the client) Another solution is upgrading to Elasticsearch and Elasticsearch-py 8.0+ when they're available, but at the time of writing they're not released yet. Let me know if this answers your questions? |
Getting this same error
|
The warning is a good thing to have, because Python includes a standard mechanism to turn the display of these warnings off. In my case, I like to see them on the command-line, to remind me to nag DevOps about switching from HTTP BasicAuth to X-Pack. The following is how to disable the display of these warnings using the standard mechanisms provided by the warnings library package: import warnings
from elasticsearch.exceptions import ElasticsearchWarning
# do something with warnings off
warnings.simplefilter('ignore', ElasticsearchWarning)
# ... |
@sethmlarson
So I'd be waiting patiently for the version 8 where this call would be removed :) and since it is not really a bug or something, I believe the issue could be closed (unless there is more to it here) |
Sounds good, thanks for replying back @MikhailMS. So you know we've been releasing v8.0.0 pre-releases recently. If you're interested you can give them a try before the actual release. Going to close this for now since there's nothing more to do. |
Elasticsearch version (
bin/elasticsearch --version
):7.16.2
elasticsearch-py
version (elasticsearch.__versionstr__
):7.16.2
Description of the problem including expected versus actual behavior:
For some reason after Elasticsearch Async Client starts and I do first search request to Elasticsearch, I see that client also attempts a call to / path, ie
https://es_node:9200/
. I don't really understand why it needs to do so and how to disable such behavior.In our case, Elasticsearch server is secured and user used for search requests only has permissions to access data in the specific index and such calls to path like / would fail. For that specific call I can see an error
Steps to reproduce:
read
privilege)Need to note, that the search request would complete nonetheless and any subsequent call is fine, but still may confuse when one looks through logs and notes such entry
The text was updated successfully, but these errors were encountered: