Version 7.0.1: Getting ConnectionError(a float is required) when passing request_timeout in the client calls
See original GitHub issueI am using the version 7.0.1 and getting this error when passing the request_timeout in client calls:
es.indices.delete_template(
name=template_name,
master_timeout=“60s”,
request_timeout= 90
)
Traceback (most recent call last): \n File "<ipython-input-13-d6617379fbe8>", line 4, in <module> \n request_timeout=template_timeouts.get(\'request_timeout_secs\', 90) \n File "build/bdist.linux-x86_64/egg/elasticsearch/client/utils.py", line 84, in _wrapped \n return func(*args, params=params, **kwargs) \n File "build/bdist.linux-x86_64/egg/elasticsearch/client/indices.py", line 607, in delete_template \n "DELETE", _make_path("_template", name), params=params \n File "build/bdist.linux-x86_64/egg/elasticsearch/transport.py", line 353, in perform_request \n timeout=timeout, \n File "build/bdist.linux-x86_64/egg/elasticsearch/connection/http_urllib3.py", line 232, in perform_request \n raise ConnectionError("N/A", str(e), e) \nConnectionError: ConnectionError(a float is required) caused by: TypeError(a float is required) \n
I am making a delete_template call here. I am suspecting it started coming after this change: https://github.com/elastic/elasticsearch-py/pull/937, as it was working in version 7.0.0. With this change request_timeout will go as normal query_params and _escape will be called on this value which will convert it to a string. While urllib library is expecting this parameter as a float value. Please let me know if any extra information required around the issue.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top GitHub Comments
Fix has just been released as
7.1.0
, hope this helps!@tj8000rpm I don’t know if you noticed this or not, but while we execute
put_template
anddelete_template
withrequest_timeout
It actually does the operation but response is a failure.Basically, If I execute
es.indices.put_template(name=name, body=body, master_timeout="120s", request_timeout=120)
it throws exception ofConnectionError
but If I check the templates in es. template are getting added/updated. This is weird.@Winterflower for reference.