[BUG] Cannot connect to a Docker local development cluster using opensearch-py
See original GitHub issueWhat is the bug?
I cannot connect to a local development cluster using opensearch-py. If I use curl
it works correctly.
How can one reproduce the bug?
- Run Docker’s image for local development:
docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" opensearchproject/opensearch:2.2.0
- Run the following code in python:
host = 'localhost'
port = 9200
auth = ('admin', 'admin')
client = OpenSearch(
hosts = [{'host': host, 'port': port}],
http_auth = auth,
use_ssl = False,
verify_certs = False,
ssl_assert_hostname = False,
ssl_show_warn = False,
)
client.info()
What is the expected behavior?
I should get info about the cluster.
What is your host/environment?
Model Name: MacBook Air
Chip: Apple M1
Total Number of Cores: 8 (4 performance and 4 efficiency)
Memory: 16 GB
System Version: macOS 12.5.1 (21G83)
Kernel Version: Darwin 21.6.0
Do you have any screenshots?
It works well when I use curl
: https://imgur.com/a/0O15MaM
Do you have any additional context?
Here’s the error I get in the Jupyter Notebook:
ConnectionError: ConnectionError(('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))) caused by: ProtocolError(('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')))
Here’s the error I get in the terminal running the cluster:
[2022-08-30T13:56:34,254][ERROR][o.o.s.s.h.n.SecuritySSLNettyHttpServerTransport] [db120fd1fe80] Exception during establishing a SSL connection: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record:
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to Resolve the “cannot connect to the Docker daemon ...
In this tutorial, we will go over possible causes of the “cannot connect to the Docker daemon” error and the ways you can...
Read more >Docker - OpenSearch documentation
This file will create a cluster that contains three containers: two containers running the OpenSearch service and a single container running ...
Read more >Troubleshoot Docker Engine installation
If it's unset, the Docker client is set to connect to the Docker daemon running on the local host. If it's set in...
Read more >10 things to avoid in docker containers | Red Hat Developer
1) Don't store data in containers - A container can be stopped, ... your application can't run because a parent layer (FROM in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would either of you be up for creating an issue to change this default, and/or to drafting a PR?
Awesome! It’s a pretty common issue with the client. I actually wonder if we could raise a specific exception to alert people to try and change the verify setting