question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

reindex method in class Elasticsearch timeout

See original GitHub issue

When I’m using this method with body=‘{“source”:{“index”: …}, “dest”:{“index”: …}}’, the same with REST api, I get a timeout error from urllib3 as follows:

File "/usr/lib/python2.7/site-packages/elasticsearch/client/utils.py", line 69, in _wrapped
    return func(*args, params=params, **kwargs)
File "/usr/lib/python2.7/site-packages/elasticsearch/client/__init__.py", line 1278, in reindex
    params=params, body=body)
  File "/usr/lib/python2.7/site-packages/elasticsearch/transport.py", line 327, in perform_request
    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
  File "/usr/lib/python2.7/site-packages/elasticsearch/connection/http_urllib3.py", line 102, in perform_request
    raise ConnectionTimeout('TIMEOUT', str(e), e)
ConnectionTimeout: ConnectionTimeout caused by - ReadTimeoutError(HTTPConnectionPool(host=..., port=...): Read timed out. (read timeout=10))

However the reindex request did get passed to elasticsearch host and processed. It seems that the arguments of this method don’t work as it’s documented in either readthedocs or method description.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
honzakralcommented, Sep 5, 2016

This error means that you didn’t get a response from elasticsearch in the allotted time (10 seconds by default). Which makes sense since the reindexing is a big operation.

To avoid this you need to set your timeout higher - either for the whole client (by passing timeout=N when creating the client) or for this individual request using the request_timeout=N parameter to the reindex call.

Hope this helps

0reactions
kuzhaocommented, Oct 12, 2016

Well noted and I appreciate your effort on this issue @HonzaKral Have a nice day~

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reindex API | Elasticsearch Guide [8.5] | Elastic
Reindex supports Sliced scroll to parallelize the reindexing process. ... This guarantees Elasticsearch waits for at least the timeout before failing.
Read more >
Avoid timeout in Elasticsearch re-indexing in Java
I don't think its a better choice to wait indefinitely to complete the re-indexing process and give very high value for timeout as...
Read more >
AbstractBulkByScrollRequest.setTimeout - Java - Tabnine
public Self timeout(TimeValue timeout) { request.setTimeout(timeout) ... setTimeout. method. in. org.elasticsearch.index.reindex.AbstractBulkByScrollRequest ...
Read more >
Helpers — Elasticsearch 7.16.0 documentation
All bulk helpers accept an instance of Elasticsearch class and an iterable ... The items in the action iterable should be the documents...
Read more >
ReindexRequestBuilder (server 7.9.3 API) - javadoc.io
Setup reindexing from a remote cluster. Methods inherited from class org.elasticsearch.index.reindex.AbstractBulkIndexByScrollRequestBuilder · script. Methods ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found