taraslayshchuk / es2csv

Export from an Elasticsearch into a CSV file
Apache License 2.0
510 stars 191 forks source link

HTTP_EXCEPTIONS.get(status_code, TransportError) #28

Closed eeveeta closed 7 years ago

eeveeta commented 7 years ago

I'm trying to run es2csv, but I'm getting the following error:

Traceback (most recent call last):
  File "/usr/local/bin/es2csv", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/es2csv.py", line 283, in main
    es.search_query()
  File "/usr/local/lib/python2.7/site-packages/es2csv.py", line 40, in f_retry
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/es2csv.py", line 177, in search_query
    res = next_scroll(res['_scroll_id'])
  File "/usr/local/lib/python2.7/site-packages/es2csv.py", line 40, in f_retry
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/es2csv.py", line 93, in next_scroll
    return self.es_conn.scroll(scroll=self.scroll_time, scroll_id=scroll_id)
  File "/usr/local/lib/python2.7/site-packages/elasticsearch/client/utils.py", line 73, in _wrapped
    return func(*args, params=params, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/elasticsearch/client/__init__.py", line 955, in scroll
    params=params, body=body)
  File "/usr/local/lib/python2.7/site-packages/elasticsearch/transport.py", line 318, in perform_request
    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
  File "/usr/local/lib/python2.7/site-packages/elasticsearch/connection/http_urllib3.py", line 128, in perform_request
    self._raise_error(response.status, raw_data)
  File "/usr/local/lib/python2.7/site-packages/elasticsearch/connection/base.py", line 122, in _raise_error
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
elasticsearch.exceptions.RequestError

Any idea why?

jpfourny commented 7 years ago

I get the same problem. The query always works, but it dies when scrolling to the second page of results.

jpfourny commented 7 years ago

I think it is possible that the "Added ES 5 support" commit broke backwards compatibility with older ES servers. It is using an API feature that my ES server does not support.

taraslayshchuk commented 7 years ago

Hello, @eeveeta, @jpfourny. Which version of es2csv and Elasticsearch you are using? And please provide cmd with arguments, which you try to run.

jpfourny commented 7 years ago

My company's production ES servers are on 1.7.5. We have almost a hundred dashboards in Kibana 3, which was deprecated in ES 2.0 (based on what I read). Upgrading is going to be painful.

taraslayshchuk commented 7 years ago

You could try downgrade to 2.4.4 or earlier. Elasticsearch-py have changed their API few times and I am not going to support 1.x.