Skip to content
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

TransportError when running search_index --create #145

Open
Jiydam opened this issue Jan 25, 2016 · 2 comments
Open

TransportError when running search_index --create #145

Jiydam opened this issue Jan 25, 2016 · 2 comments

Comments

@Jiydam
Copy link

Jiydam commented Jan 25, 2016

I followed documentation to install bungiesearch but when I run search_index --create, I get this error:

INFO:root:Creating index main_index with 1 doctypes.
INFO:urllib3.connectionpool:Starting new HTTP connection (1): localhost
INFO:elasticsearch:PUT http://localhost:9200/main_index [status:200 request:0.119s]
No handlers could be found for logger "elasticsearch.trace"
WARNING:elasticsearch:GET /_cluster/health/main_index?wait_for_status=green&timeout=30 [status:400 request:0.018s]
Traceback (most recent call last):
  File "/Applications/PyCharm.app/Contents/helpers/pycharm/django_manage.py", line 41, in <module>
    run_module(manage_file, None, '__main__', True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 176, in run_module
    fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/administrator/Documents/Myapp/app/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 441, in execute
    output = self.handle(*args, **options)
  File "/Library/Python/2.7/site-packages/bungiesearch/management/commands/search_index.py", line 140, in handle
    es.cluster.health(index=','.join(indices), wait_for_status='green', timeout=30)
  File "/Library/Python/2.7/site-packages/elasticsearch/client/utils.py", line 69, in _wrapped
    return func(*args, params=params, **kwargs)
  File "/Library/Python/2.7/site-packages/elasticsearch/client/cluster.py", line 23, in health
    params=params)
  File "/Library/Python/2.7/site-packages/elasticsearch/transport.py", line 307, in perform_request
    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
  File "/Library/Python/2.7/site-packages/elasticsearch/connection/http_urllib3.py", line 89, in perform_request
    self._raise_error(response.status, raw_data)
  File "/Library/Python/2.7/site-packages/elasticsearch/connection/base.py", line 105, in _raise_error
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
elasticsearch.exceptions.RequestError: TransportError(400, u'parse_exception')

Process finished with exit code 1

ElasticSearch version

{
"name": "Vance Astro",
"cluster_name": "elasticsearch_administrator",
"version": {
"number": "2.1.0",
"build_hash": "72cd1f1a3eee09505e036106146dc1949dc5dc87",
"build_timestamp": "2015-11-18T22:40:03Z",
"build_snapshot": false,
"lucene_version": "5.3.1"
},
"tagline": "You Know, for Search"
}

I ran this url

http://localhost:9200/_cluster/health/?wait_for_status=green&timeout=30

and I get

{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "Failed to parse setting [timeout] with value [30] as a time value: unit is missing or unrecognized"
}
],
"type": "parse_exception",
"reason": "Failed to parse setting [timeout] with value [30] as a time value: unit is missing or unrecognized"
},
"status": 400
}

but this worked:

http://localhost:9200/_cluster/health/main_index?wait_for_status=green&timeout=30ms
@ChristopherRabotin
Copy link
Owner

What version of elasticsearch-dsl do you have installed? In the bungiesearch code base, timeouts are provided to that library directly, so it seems like the version of the ES client you're running isn't compatible with ES 2.1.0.

@Jiydam
Copy link
Author

Jiydam commented Jan 26, 2016

pip show elasticsearch-dsl

Metadata-Version: 2.0
Name: elasticsearch-dsl
Version: 0.0.10
Summary: Python client for Elasticsearch
Home-page: https://github.com/elasticsearch/elasticsearch-dsl-py
Author: Honza Král
Author-email: [email protected]
License: Apache License, Version 2.0
Location: /Library/Python/2.7/site-packages
Requires: elasticsearch, six, python-dateutil

This is the version I have for elasticsearch-dsl, and I believe it is the latest. I fixed the error by just adding the unit to the timeout "30s" instead of 30.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants