1

I am trying use embedding models in elastic search following this tutorial

When I run this command

docker run -it --rm elastic/eland \
eland_import_hub_model \
--url https://username:password@localhost:9200/ \
--hub-model-id sentence-transformers/msmarco-MiniLM-L-12-v3 \
--task-type text_embedding \
--start

I get the below error.

Traceback (most recent call last):
  File "/usr/local/bin/eland_import_hub_model", line 190, in <module>
    es = get_es_client(args)
  File "/usr/local/bin/eland_import_hub_model", line 153, in get_es_client
    es_info = es_client.info()
  File "/usr/local/lib/python3.9/dist-packages/elasticsearch/_sync/client/utils.py", line 414, in wrapped
    return api(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/elasticsearch/_sync/client/__init__.py", line 2295, in info
    return self.perform_request(  # type: ignore[return-value]
  File "/usr/local/lib/python3.9/dist-packages/elasticsearch/_sync/client/_base.py", line 285, in perform_request
    meta, resp_body = self.transport.perform_request(
  File "/usr/local/lib/python3.9/dist-packages/elastic_transport/_transport.py", line 329, in perform_request
    meta, raw_data = node.perform_request(
  File "/usr/local/lib/python3.9/dist-packages/elastic_transport/_node/_http_urllib3.py", line 199, in perform_request
    raise err from None
elastic_transport.ConnectionError: Connection error caused by: ConnectionError(Connection error caused by: NewConnectionError(<urllib3.connection.HTTPSConnection object at 0xffff6c8e9fd0>: Failed to establish a new connection: [Errno 111] Connection refused))

I could connect to ES from kibana and postman and do the API requests. But I could not run the above command. Any ideas?

14
  • can you please provide which URL you are using for accessing from potsman ? is it wirh https or http? also, are you running this script on the same server where elasticsearch is running or it is diffrent server? Commented Mar 27, 2023 at 13:03
  • Yes, Postman is using also https Both are on the same server (which is my localhost) Commented Mar 27, 2023 at 13:19
  • But post man using the Authorization header with base64 encoding of user name and password. Commented Mar 27, 2023 at 13:21
  • I am not sure baout docker but when command is run using python it is working fine. Can you please check my blog where i have updated model for NER. Commented Mar 27, 2023 at 13:21
  • I could successfully hit from curl using plain username and password with this command curl -H "Content-Type: application/x-ndjson" -XPOST localhost:9200/a_index/bulkdata --data-binary "@bulk-data.json" -k -u username Commented Mar 27, 2023 at 13:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.