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

Bot never responds, ends up crashing #4

Open
geeknik opened this issue Nov 12, 2015 · 5 comments
Open

Bot never responds, ends up crashing #4

geeknik opened this issue Nov 12, 2015 · 5 comments

Comments

@geeknik
Copy link

geeknik commented Nov 12, 2015

I followed all of your instructions after spinning up a new VM just for this. When I say hi to the bot after it joins the IRC channel, this is what I see in the console:

(.venv) geeknik@frank:~/zebel$ python main.py
INFO:MSG geeknik > mfm: hi!
INFO:Starting new HTTP connection (1): localhost
INFO:GET http://localhost:9200/zebel_quotes/_search [status:200 request:0.102s]
INFO:curl -XGET 'http://localhost:9200/zebel_quotes/_search?pretty' -d '{
  "filter": {
    "type": {
      "value": "general"
    }
  },
  "min_score": "0.2",
  "query": {
    "query_string": {
      "default_field": "text",
      "query": "text:(hi) OR support:(hi)"
    }
  }
}'
WARNING:GET /zebel_quotes/_search [status:400 request:0.021s]
Traceback (most recent call last):
  File "main.py", line 48, in <module>
    zebel.connect().start()
  File "/home/geeknik/.venv/lib/python3.4/site-packages/irc/client.py", line 1274, in start
    self.reactor.process_forever()
  File "/home/geeknik/.venv/lib/python3.4/site-packages/irc/client.py", line 276, in process_forever
    self.process_once(timeout)
  File "/home/geeknik/.venv/lib/python3.4/site-packages/irc/client.py", line 257, in process_once
    self.process_data(i)
  File "/home/geeknik/.venv/lib/python3.4/site-packages/irc/client.py", line 214, in process_data
    c.process_data()
  File "/home/geeknik/.venv/lib/python3.4/site-packages/irc/client.py", line 583, in process_data
    self._process_line(line)
  File "/home/geeknik/.venv/lib/python3.4/site-packages/irc/client.py", line 654, in _process_line
    self._handle_event(event)
  File "/home/geeknik/.venv/lib/python3.4/site-packages/irc/client.py", line 677, in _handle_event
    self.reactor._handle_event(self, event)
  File "/home/geeknik/.venv/lib/python3.4/site-packages/irc/client.py", line 396, in _handle_event
    result = handler.callback(connection, event)
  File "/home/geeknik/.venv/lib/python3.4/site-packages/irc/client.py", line 1237, in _dispatcher
    method(connection, event)
  File "/home/geeknik/zebel/bot.py", line 67, in on_pubmsg
    conn.privmsg(self.target, text.reply(sender, msg))
  File "/home/geeknik/zebel/text.py", line 264, in reply
    _MIN_SCORE)
  File "/home/geeknik/zebel/db.py", line 86, in fuzzy_fetch_general_quotes
    results = self.client.search(index='zebel_quotes', body=qs)
  File "/home/geeknik/.venv/lib/python3.4/site-packages/elasticsearch/client/utils.py", line 68, in _wrapped
    return func(*args, params=params, **kwargs)
  File "/home/geeknik/.venv/lib/python3.4/site-packages/elasticsearch/client/__init__.py", line 498, in sear                                                                                                ch
    params=params, body=body)
  File "/home/geeknik/.venv/lib/python3.4/site-packages/elasticsearch/transport.py", line 301, in perform_re                                                                                                quest
    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=tim                                                                                                eout)
  File "/home/geeknik/.venv/lib/python3.4/site-packages/elasticsearch/connection/http_urllib3.py", line 82,                                                                                                 in perform_request
    self._raise_error(response.status, raw_data)
  File "/home/geeknik/.venv/lib/python3.4/site-packages/elasticsearch/connection/base.py", line 102, in _rai                                                                                                se_error
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
elasticsearch.exceptions.RequestError: TransportError(400, {'phase': 'query', 'type': 'search_phase_executio                                                                                                n_exception', 'grouped': True, 'root_cause': [{'line': 1, 'index': 'zebel_quotes', 'type': 'query_parsing_ex                                                                                                ception', 'reason': 'No query registered for [fuzzy_like_this]', 'col': 32}], 'failed_shards': [{'shard': 0,                                                                                                 'index': 'zebel_quotes', 'reason': {'line': 1, 'index': 'zebel_quotes', 'type': 'query_parsing_exception',                                                                                                 'reason': 'No query registered for [fuzzy_like_this]', 'col': 32}, 'node': 'ctfhCRYdSE2i-00FZEKhQg'}], 'reas                                                                                                on': 'all shards failed'})
@bahmanm
Copy link
Owner

bahmanm commented Nov 12, 2015

What version of ElasticSearch are you using?

@geeknik
Copy link
Author

geeknik commented Nov 12, 2015

2.0.0

@bahmanm
Copy link
Owner

bahmanm commented Nov 13, 2015

Can you try with 1.x series as well and let me know?
I've had similar problems with my other applications which use ElasticSearch when using 2.x as a drop-in replacement for 1.x.

@geeknik
Copy link
Author

geeknik commented Nov 13, 2015

Seems to work with 1.7.

@geeknik geeknik closed this as completed Nov 13, 2015
@bahmanm
Copy link
Owner

bahmanm commented Nov 14, 2015

Should update the README.md to address the ElasticSearch version.

@bahmanm bahmanm reopened this Nov 14, 2015
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