Redash: ElasticSearch query fails on ES 6

Created on 18 Jan 2018  路  6Comments  路  Source: getredash/redash

Issue Summary

Using the public docker images which seem to be based on Redash 4 (beta?) trying to setup a query for an ES 6 backend results in

Error running query: Failed to execute query. Return Code: 500 Reason: {"error":{"root_cause":[{"type":"illegal_state_exception","reason":"source and source_content_type parameters are required"}],"type":"illegal_state_exception","reason":"source and source_content_type parameters are required"},"status":500}

Steps to Reproduce

  1. Deploy redash using the redash docker compose file
  2. Deploy ES 6 backend
  3. Setup ElasticSearch datasource in Redash
  4. Try a simple query

Technical details:

  • Redash Version: 4.0.0 (not sure about the exact built number - can't determine it from the docker image)
  • Browser/OS: Redash in docker on Ubuntu 17.10
  • How did you install Redash: redash docker compose file from github pulling in redash:latest from docker hub

Looks like redash uses the source query parameter but as per https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html this also requires to provide a source_content_type parameter.

Bug

Most helpful comment

@RichardLitt Is this really a support issue?

If I go to the relevant line and add the appropriate content type for my query, i.e. change it to;

params = {"source": json.dumps(query_dict), "source_content_type": "application/json"}

then my queries execute as expected.

@chriswue Did you get around this?

All 6 comments

Thanks @chriswue. This sounds like a support issue; have you opened a thread on the forum?

@RichardLitt No, I assumed this was a bug in redash. I will open a support thread

@RichardLitt Is this really a support issue?

If I go to the relevant line and add the appropriate content type for my query, i.e. change it to;

params = {"source": json.dumps(query_dict), "source_content_type": "application/json"}

then my queries execute as expected.

@chriswue Did you get around this?

@alexdrans Good point. No, I guess it is not. Thanks for the work, there. I'll flag this as a bug.

@alexdrans I haven't found a work-around, needs fixing in Redash. Would have submitted a PR but got side tracked by something else.

Was this page helpful?
0 / 5 - 0 ratings