apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
61.9k stars 13.56k forks source link

Error connecting to Elasticsearch #28098

Open ChanKaki opened 5 months ago

ChanKaki commented 5 months ago

Screenshot

image

version es : 7.13.4 superset:3.0

run by docker-compose

  superset:
    image: apache/superset:3.0.0
    container_name: superset
    command: >
      /bin/sh -c "
      pip install authlib &&
      superset db upgrade &&
      pip install elasticsearch-dbapi==0.2.9 &&
      set FLASK_APP=superset &&
      superset init &&
      superset run -h 0.0.0.0 -p 8088 --with-threads --reload --debugger"
    restart: unless-stopped
    ports:
      - "13030:8088"
    environment:
      - superset_create
      - SUPERSET_LOAD_EXAMPLES=yes
    volumes:
      - ${SUPERSER_VOLUME}:/home/superset
      - ${CONFIG_PY}:/app/pythonpath/superset_config.py
      - ${CUSTOM_SSO_PY}:/app/pythonpath/custom_sso_security_manager.py

    depends_on:
      - postgres

Description

es was work,but i connected a new databse in superset,it showed error connected failed and got the error log

2024-04-17 05:06:53,776:WARNING:superset.views.base:SupersetErrorsException
Traceback (most recent call last):
  File "/app/superset/databases/commands/test_connection.py", line 163, in run
    raise DBAPIError(ex_str or None, None, None)
sqlalchemy.exc.DBAPIError: (builtins.NoneType) None
[SQL: Error connecting to Elasticsearch]
(Background on this error at: https://sqlalche.me/e/14/dbapi)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/usr/local/lib/python3.9/site-packages/flask_appbuilder/security/decorators.py", line 95, in wraps
    return f(self, *args, **kwargs)
  File "/app/superset/views/base_api.py", line 127, in wraps
    raise ex
  File "/app/superset/views/base_api.py", line 121, in wraps
    duration, response = time_function(f, self, *args, **kwargs)
  File "/app/superset/utils/core.py", line 1526, in time_function
    response = func(*args, **kwargs)
  File "/app/superset/utils/log.py", line 255, in wrapper
    value = f(*args, **kwargs)
  File "/app/superset/views/base_api.py", line 93, in wraps
    return f(self, *args, **kwargs)
  File "/app/superset/databases/api.py", line 908, in test_connection
    TestConnectionDatabaseCommand(item).run()
  File "/app/superset/databases/commands/test_connection.py", line 192, in run
    raise SupersetErrorsException(errors) from ex
superset.exceptions.SupersetErrorsException: [SupersetError(message='(builtins.NoneType) None\n[SQL: Error connecting to Elasticsearch]\n(Background on this error at: https://sqlalche.me/e/14/dbapi)', error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'ElasticSearch (SQL API)', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]
despot84 commented 2 months ago

Same problem

Hrishiranade commented 2 months ago

@rusackas I am also Facing the Same Issue. Any update on this...

rusackas commented 2 months ago

@rusackas I am also Facing the Same Issue. Any update on this...

I'm not working on it, and don't know anyone who is. This thread is all the news I have. I also don't have access to Elasticsearch, so if you do, please feel free to diagnose and open a PR if you have the means :)

leezj-cbm commented 1 month ago

EDIT - found the problem to my issue . For my problem :

WORKING URI : elasticsearch+https://{user}:{password}@{host}:9200/?verify_certs=False

PROBLEM URI : elasticsearch+https://{user}:{password}@{host}:9200/

with the verify_certs=False, it finally works for me. Hope this is helpful to others.


I am having same issue here. Any advicec/help will be greatly appreciated

image

superset.exceptions.SupersetErrorsException: [SupersetError(message='(builtins.NoneType) None\n[SQL: Error connecting to Elasticsearch]\n(Background on this error at: https://sqlalche.me/e/14/dbapi)', error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'ElasticSearch (SQL API)', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]
2024-08-01 10:37:49,997:INFO:werkzeug:127.0.0.1 - - [01/Aug/2024 10:37:49] "POST /api/v1/database/test_connection/ HTTP/1.1" 500 -