superset icon indicating copy to clipboard operation
superset copied to clipboard

Getting error when querying a marginally longer running query

Open masterlittle opened this issue 9 years ago • 4 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [x] I have checked the superset logs for python stacktraces and included it here as text if any
  • [x] I have reproduced the issue with at least the latest released version of superset
  • [x] I have checked the issue tracker for the same issue and I haven't found one similar

Superset Version - 0.17.2

When I am submitting a query to get data from redshift in Sql Lab :-

select "table",diststyle,sortkey1,empty,unsorted,sortkey1_enc,skew_sortkey1,skew_rows from svv_table_info;

I'm getting this error ::

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/superset/views/core.py", line 2046, in sql_json
    data = sql_lab.get_sql_results(query_id, return_results=True)
  File "/usr/local/lib/python2.7/dist-packages/celery/local.py", line 188, in __call__
    return self._get_current_object()(*a, **kw)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/task.py", line 420, in __call__
    return self.run(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/superset/sql_lab.py", line 134, in get_sql_results
    handle_error(db_engine_spec.extract_error_message(e))
  File "/usr/local/lib/python2.7/dist-packages/superset/sql_lab.py", line 68, in handle_error
    raise Exception(query.error_message)
Exception: 'utf8' codec can't decode byte 0xff in position 11: invalid start byte

whereas the same query works if I apply a LIMIT of 100. The total rows in the table is 485.

masterlittle avatar Apr 03 '17 12:04 masterlittle

any solution yet. I am also experiencing the same problem...

vishalg1994 avatar Feb 02 '18 09:02 vishalg1994

I think the stack trace here isn't the stack trace we need to debug this. Maybe the stack trace is on the worker's logs?

mistercrunch avatar Feb 02 '18 20:02 mistercrunch

Our DBA Solved this issue. The problem was in json Encoding. To fix you need to open JSON.py and change json.dumps(data, default=utils.json_iso_dttm_ser,encoding="latin-1")

vishalg1994 avatar Mar 29 '18 10:03 vishalg1994

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[bot] avatar Apr 11 '19 01:04 stale[bot]