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

[Bug]: elasticsearch database query error #9104

Open
rty813 opened this issue Apr 22, 2024 · 1 comment · May be fixed by #9105
Open

[Bug]: elasticsearch database query error #9104

rty813 opened this issue Apr 22, 2024 · 1 comment · May be fixed by #9105
Labels
bug Something isn't working

Comments

@rty813
Copy link

rty813 commented Apr 22, 2024

Short description of current behavior

Elasticsearch database query error.

Video or screenshots

image

Expected behavior

query successful

How to reproduce the error

  1. add elasticsearch database by sql.
  2. click "es" from sidebar.

Anything else?

I checked the source code and found two issues.

  1. If it starts with 7... then you should use http_auth=("username", "password") instead of basic_auth=.... The basic_auth=... parameter was only added in v8.0.0.

The version of the Elasticsearch Python library installed in the container is 7.13.4, but in this version, "basic_auth" should be changed to "http_auth". Ref

basic_auth=(self.connection_data['username'], self.connection_data['password'])

  1. The connect() function returns a StatusResponse instead of an Elasticsearch client.

    connection = self.connect()
    try:
    response = connection.sql.query(body={'query': query})
@rty813 rty813 added the bug Something isn't working label Apr 22, 2024
@rty813 rty813 linked a pull request Apr 22, 2024 that will close this issue
11 tasks
@ZoranPandovski
Copy link
Member

@rty813 Thanks for reporting. Let's migrate to the latest Elastic client version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants