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

elasticsearch connect to superset failed #9559

Closed
pake2070 opened this issue Apr 16, 2020 · 5 comments
Closed

elasticsearch connect to superset failed #9559

pake2070 opened this issue Apr 16, 2020 · 5 comments
Labels
!deprecated-label:bug Deprecated label - Use #bug instead inactive Inactive for >= 30 days

Comments

@pake2070
Copy link

pake2070 commented Apr 16, 2020

Hi all, I had an issue
TransportError(500, 'unresolved_exception', 'Invalid call to attribute on an unresolved object database.ID)
After using SQL lab to query data, we exported to the draw chart but got this error.

When we query table from elasticsearch's dataset

everything is ok if I load it directly:

image_2020_04_16T15_28_44_987Z

if I load via SQLlab then it failed

image_2020_04_16T15_16_25_352Z
image_2020_04_16T15_19_49_272Z
image_2020_04_16T15_24_16_004Z

log file:
2020-04-16 22:20:52,211:INFO:root:Database.get_sqla_engine(). Masked URL: elasticsearch+http://elastic:XXXXXXXXXX@localhost:9200/
2020-04-16 22:20:52,213:INFO:root:SELECT "sessionLength" AS "sessionLength", max AS max, sum("sessionLength") AS "SUM(sessionLength)"
FROM (SELECT max,
min,
sessionLength
FROM "default"."session-aggregation"
LIMIT 100) AS expr_qry
WHERE "sessionLength" IS NULL GROUP BY "sessionLength", max ORDER BY "SUM(sessionLength)" DESC
LIMIT 1000
2020-04-16 22:20:52,227:INFO:root:Database.get_sqla_engine(). Masked URL: elasticsearch+http://elastic:XXXXXXXXXX@localhost:9200/
2020-04-16 22:20:52,229:DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): localhost
2020-04-16 22:20:52,242:DEBUG:urllib3.connectionpool:http://localhost:9200 "POST /_sql/ HTTP/1.1" 500 297
2020-04-16 22:20:52,242:WARNING:elasticsearch:POST http://localhost:9200/_sql/ [status:500 request:0.014s]
2020-04-16 22:20:52,243:DEBUG:elasticsearch:> {"query":"SELECT "sessionLength" AS "sessionLength",\n max AS max,\n sum("sessionLength") AS "SUM(sessionLength)"\nFROM\n (SELECT max,\n min,\n sessionLength\n FROM "session-aggregation"\n LIMIT 100) AS expr_qry\nWHERE "sessionLength" IS NULL\nGROUP BY "sessionLength",\n max\nORDER BY "SUM(sessionLength)" DESC\nLIMIT 1000"}
2020-04-16 22:20:52,243:DEBUG:elasticsearch:< {"error":{"root_cause":[{"type":"unresolved_exception","reason":"Invalid call to attribute on an unresolved object session-aggregation.max{f}#9077 AS ?"}],"type":"unresolved_exception","reason":"Invalid call to attribute on an unresolved object session-aggregation.max{f}#9077 AS ?"},"status":500}
2020-04-16 22:20:52,243:ERROR:root:Query SELECT "sessionLength" AS "sessionLength",
max AS max,
sum("sessionLength") AS "SUM(sessionLength)"
FROM
(SELECT max,
min,
sessionLength
FROM "default"."session-aggregation"
LIMIT 100) AS expr_qry
WHERE "sessionLength" IS NULL
GROUP BY "sessionLength",
max
ORDER BY "SUM(sessionLength)" DESC
LIMIT 1000 on schema default failed
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/superset/connectors/sqla/models.py", line 947, in query
df = self.database.get_df(sql, self.schema, mutator)
File "/usr/local/lib/python3.6/dist-packages/superset/models/core.py", line 963, in get_df
self.db_engine_spec.execute(cursor, sqls[-1])
File "/usr/local/lib/python3.6/dist-packages/superset/db_engine_specs/base.py", line 754, in execute
cursor.execute(query)
File "/usr/local/lib/python3.6/dist-packages/es/baseapi.py", line 25, in g
return f(self, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/es/elastic/api.py", line 139, in execute
results = self.elastic_query(query)
File "/usr/local/lib/python3.6/dist-packages/es/baseapi.py", line 217, in elastic_query
resp = self.es.transport.perform_request("POST", path, body=payload)
File "/usr/local/lib/python3.6/dist-packages/elasticsearch/transport.py", line 362, in perform_request
timeout=timeout,
File "/usr/local/lib/python3.6/dist-packages/elasticsearch/connection/http_urllib3.py", line 248, in perform_request
self._raise_error(response.status, raw_data)
File "/usr/local/lib/python3.6/dist-packages/elasticsearch/connection/base.py", line 244, in _raise_error
status_code, error_message, additional_info
elasticsearch.exceptions.TransportError: TransportError(500, 'unresolved_exception', 'Invalid call to attribute on an unresolved object session-aggregation.max{f}#9077 AS ?')
2020-04-16 22:20:52,263:INFO:werkzeug:127.0.0.1 - - [16/Apr/2020 22:20:52] "POST /superset/explore_json/ HTTP/1.1" 400 -
2020-04-16 22:20:52,638:DEBUG:root:[stats_logger] (incr) queries

@pake2070 pake2070 added the !deprecated-label:bug Deprecated label - Use #bug instead label Apr 16, 2020
@hungphamvn
Copy link

Our team also got this issue too, any help?

@stale
Copy link

stale bot commented Jun 21, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Jun 21, 2020
@willbarrett
Copy link
Member

@dpgaspar you're the expert here. Any thoughts?

@stale stale bot removed the inactive Inactive for >= 30 days label Jun 24, 2020
@stale
Copy link

stale bot commented Aug 23, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Aug 23, 2020
@stale stale bot closed this as completed Aug 31, 2020
@rizvanhaider
Copy link

I am facing the same issue .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!deprecated-label:bug Deprecated label - Use #bug instead inactive Inactive for >= 30 days
Projects
None yet
Development

No branches or pull requests

4 participants