elasticsearch-reindex icon indicating copy to clipboard operation
elasticsearch-reindex copied to clipboard

Reindex fails - socket hang up on initial search

Open jimpaintertnf opened this issue 8 years ago • 4 comments

Node v5.7.1 Elasticsearch-reindex v1.1.14

Attempting to reindex from one index into another, using the following:

elasticsearch-reindex -f https://hostname.es.amazonaws.com/originalindex/log-type -t https://hostname.es.amazonaws.com/newindex/ index-script.js

Results in the following error:

Elasticsearch ERROR: 2016-08-11T15:37:35Z Error: Request error, retrying POST https://hostname.es.amazonaws.com/originalindex/NCSA-common-log-format/_search?search_type=scan&scroll=1m&size=100 => socket hang up at Log.error (/temp/.nvm/versions/node/v5.7.1/lib/node_modules/elasticsearch-reindex/node_modules/elasticsearch/src/lib/log.js:225:56) at checkRespForFailure (/temp/.nvm/versions/node/v5.7.1/lib/node_modules/elasticsearch-reindex/node_modules/elasticsearch/src/lib/transport.js:240:18) at HttpConnector. (/temp/.nvm/versions/node/v5.7.1/lib/node_modules/elasticsearch-reindex/node_modules/elasticsearch/src/lib/connectors/http.js:162:7) at ClientRequest.wrapper (/temp/.nvm/versions/node/v5.7.1/lib/node_modules/elasticsearch-reindex/node_modules/lodash/index.js:3095:19) at emitOne (events.js:90:13) at ClientRequest.emit (events.js:182:7) at TLSSocket.socketCloseListener (_http_client.js:271:9) at emitOne (events.js:95:20) at TLSSocket.emit (events.js:182:7) at TCP._onclose (net.js:475:12)

The same result if the last argument (the custom index script) is omitted.

Note the the URL being POSTed to in the log above is accessible via curl and returns

{ "_scroll_id": "somestuff==", "took": 17, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 176434, "max_score": 0, "hits": [] } }

jimpaintertnf avatar Aug 11 '16 15:08 jimpaintertnf

+1

vlaskinvlad avatar Sep 16 '16 15:09 vlaskinvlad

I have experienced the same and I think it may be an underlying elasticsearch.js issue. Possibly it's related to https://github.com/elastic/elasticsearch-js/issues/433. FWIW when I set --sniff_cluster false I don't see these request errors anymore, so you may want to give that a try.

danpaz avatar Oct 30 '16 21:10 danpaz

I'm experiencing the same, --sniff_cluster false as suggested above by @danpaz worked for me as well :+1:

OriHoch avatar Dec 01 '16 17:12 OriHoch

👍 I'm also experiencing the same problem and setting --sniff_cluster false worked for me too.

scotttam avatar Jan 31 '17 21:01 scotttam