Incubator-superset: SQL Lab query result flashes as Offline

Created on 8 Jun 2019  路  5Comments  路  Source: apache/incubator-superset

In master branch SQL Lab is working strangely. It seems /queries/<last_updated_ms> is getting called with /queries/NaN for some reason, which causes a parsing error on https://github.com/apache/incubator-superset/blob/95291facff5c49ce4c63da25ff3efaf4bf101822/superset/views/core.py#L2813 . Putting a simple try-catch for ValueError seemed to do the trick, but it seems like something in the frontend has changed that's causing this error.

Stacktrace:

127.0.0.1 - - [08/Jun/2019 21:41:00] "GET /superset/queries/NaN HTTP/1.1" 500 -
2019-06-08 21:41:00,929:INFO:werkzeug:127.0.0.1 - - [08/Jun/2019 21:41:00] "GET /superset/queries/NaN HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/Users/ville/.local/share/virtualenvs/incubator-superset-Q6iPzijF/lib/python3.7/site-packages/flask/app.py", line 2309, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/ville/.local/share/virtualenvs/incubator-superset-Q6iPzijF/lib/python3.7/site-packages/flask/app.py", line 2295, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/ville/.local/share/virtualenvs/incubator-superset-Q6iPzijF/lib/python3.7/site-packages/flask/app.py", line 1741, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/ville/.local/share/virtualenvs/incubator-superset-Q6iPzijF/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/Users/ville/.local/share/virtualenvs/incubator-superset-Q6iPzijF/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/ville/.local/share/virtualenvs/incubator-superset-Q6iPzijF/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/ville/.local/share/virtualenvs/incubator-superset-Q6iPzijF/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/ville/.local/share/virtualenvs/incubator-superset-Q6iPzijF/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/Users/ville/.local/share/virtualenvs/incubator-superset-Q6iPzijF/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/ville/.local/share/virtualenvs/incubator-superset-Q6iPzijF/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/ville/.local/share/virtualenvs/incubator-superset-Q6iPzijF/lib/python3.7/site-packages/flask_appbuilder/security/decorators.py", line 145, in wraps
    return f(self, *args, **kwargs)
  File "/Users/ville/dev/incubator-superset/superset/views/core.py", line 2813, in queries
    last_updated_ms_int = int(float(last_updated_ms)) if last_updated_ms else 0
ValueError: cannot convert float NaN to integer

How to reproduce the bug

  1. Go to SQL Lab
  2. Shoot off SELECT 1 on your favourite db
  3. See red Offline text flash, later turning into table without results (see screenshot below)

image

  • superset version: master
  • python version: 3.7.3
  • node.js version: 12.1.0
  • npm version: 6.9.0

Checklist

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 there are 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.
#bug

Most helpful comment

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.97. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

All 5 comments

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.97. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

I tried to repro this in master, but didn't have any luck. Were you making a sync or an async query here?

The only way I can see us getting into this state on the frontend is if the changed_on field for a query was None. I'm not really sure if that's possible, if I can figure out how to repro this then I'll dig in further

Thanks for the help; fairly sure this was sync. I'll look closer at what's happening next time I have the chance and report back.

@villebro Maybe, you need "can queries on Superset" permission, as the API '/superset/queries/xxx' will be called when the query is running long time.

I cleared by browser cache which seemed to solve the problem.

Was this page helpful?
0 / 5 - 0 ratings