rhsimplex / image-match

🎇 Quickly search over billions of images
2.94k stars 405 forks source link

TransportError when adding images to Elastic DB #111

Open Clickbaitcake opened 5 years ago

Clickbaitcake commented 5 years ago

When I try to run: ses.add_image('https://c2.staticflickr.com/8/7158/6814444991_08d82de57e_z.jpg')

I get an error that seems like the Python files are missing? Am I correct?

>>> ses.add_image('https://c2.staticflickr.com/8/7158/6814444991_08d82de57e_z.jpg') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/user/.local/lib/python2.7/site-packages/image_match/signature_database_base.py", line 203, in add_image self.insert_single_record(rec, refresh_after=refresh_after) File "/home/user/.local/lib/python2.7/site-packages/image_match/elasticsearch_driver.py", line 88, in insert_single_record self.es.index(index=self.index, doc_type=self.doc_type, body=rec, refresh=refresh_after) File "/home/user/.local/lib/python2.7/site-packages/elasticsearch/client/utils.py", line 69, in _wrapped return func(*args, params=params, **kwargs) File "/home/user/.local/lib/python2.7/site-packages/elasticsearch/client/__init__.py", line 279, in index _make_path(index, doc_type, id), params=params, body=body) File "/home/user/.local/lib/python2.7/site-packages/elasticsearch/transport.py", line 329, in perform_request status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout) File "/home/user/.local/lib/python2.7/site-packages/elasticsearch/connection/http_urllib3.py", line 109, in perform_request self._raise_error(response.status, raw_data) File "/home/user/.local/lib/python2.7/site-packages/elasticsearch/connection/base.py", line 108, in _raise_error raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info) elasticsearch.exceptions.TransportError: <exception str() failed>

taylorjdawson commented 5 years ago

Looks like a connection a connection error? Does it output the http status code anywhere?

olirice commented 5 years ago

The latest version of image_match on pypi uses an old version of elasticsearch with iffy error messages. Try installing image_match from source to get a newish version of elasticsearch and it might give you a more helpful error

I ran into this error after accidentally changing the doc type from "images" to "image" on the index.