question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Cannot connect to a Docker local development cluster using opensearch-py

See original GitHub issue

What 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?

  1. 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
  2. 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:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
wbecklercommented, Aug 31, 2022

Would either of you be up for creating an issue to change this default, and/or to drafting a PR?

1reaction
dtaivppcommented, Aug 30, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found