apache / superset

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

Druid Datasource-IndexError: list index out of range #358

Closed vinjadhav closed 8 years ago

vinjadhav commented 8 years ago

I have installed caravel version 9.0 and have configured it for druid cluster. I have ingested sample wikiticker and metrics data in druid and able to see these data sources after clicking refresh metadata in caravel. But when i click on any of these data sources i get the error. "IndexError: list index out of range"

weand commented 8 years ago

Same with caravel 0.8.7 + mysql and sample data imported.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/security/decorators.py", line 26, in wraps
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/caravel/models.py", line 1162, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/caravel/views.py", line 493, in explore
    slice_=slc)
  File "/usr/local/lib/python2.7/dist-packages/caravel/viz.py", line 59, in __init__
    ff = FormFactory(self)
  File "/usr/local/lib/python2.7/dist-packages/caravel/forms.py", line 115, in __init__
    default_metric = datasource.metrics_combo[0][0]
IndexError: list index out of range
weand commented 8 years ago

ok, error traced to the cause, that

1) there were no columns created for all imported tables. 2) when clicking the SQL link on one of the table following exception error is shown

OperationalError: (_mysql_exceptions.OperationalError) (1045, "Access denied for user 'root'@'127.0.0.1' (using password: NO)")

Our DB Connection uses authentication, something like mysql://user:password@localhost:3306/caravel

As

Not sure if relevant: The 'password' column in the 'dbs' table is NULL.

mistercrunch commented 8 years ago

@weand your error is related to not having any metrics defined for that table, maybe the examples didn't get loaded properly?

polomarcus commented 8 years ago

I have the same error when clicking on recently added Druid's datasources for Druid: 0.9 and the lastest caravel version

http://localhost:8088/caravel/explore/druid/2/ gives me :

IndexError
IndexError: list index out of range
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/pyrthon2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/security/decorators.py", line 26, in wraps
return f(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/caravel/models.py", line 1164, in wrapper
return f(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/caravel/views.py", line 496, in explore
slice_=slc)
File "/usr/local/lib/python2.7/dist-packages/caravel/viz.py", line 59, in __init__
ff = FormFactory(self)
File "/usr/local/lib/python2.7/dist-packages/caravel/forms.py", line 115, in __init__
default_metric = datasource.metrics_combo[0][0]
IndexError: list index out of range

EDIT: I refresh my Druid's 0.9 datasources this morning, and everything was OK :+1: I guess something was initializing on the Druid side

mistercrunch commented 8 years ago

We're still on 0.8.* here, not sure how to test or reproduce, I'll ask around as we may have a test cluster for 0.9.

FYI for realtime, we use the same configuration files that defines the spark-streaming configuration to generate dynamically into Caravel's datasource definition. (I just want to highlight that it's possible to push the conf into Caravel, at least until 0.9's api settles or gets implemented on the Caravel side)

vinjadhav commented 8 years ago

@mistercrunch i had tried earlier on 0.8.3 but i could get the same error. so i moved to 0.9.0 but facing same error... I there any configuration i need to carry out on druid or caravel side to get metrics and dimensions of druid datasource in caravel. I used druid quickstart examples of "wikiticker" and "metrics"

polomarcus commented 8 years ago

@mistercrunch I refresh my Druid's 0.9 datasources this morning, and everything was OK :+1: I guess something was initializing on the Druid side.

For information, Druid was launched and dealing with 10K events per seconds for several hours before I installed Caravel

mistercrunch commented 8 years ago

I think there may be a bug on the first pass of the script that gets ironed out by subsequent passes. We need to write unit tests for Druid but for them to work on travis we need to mock the PyDruid client. I'm hoping we can work on this sometime soon.

deyani27 commented 8 years ago

Using Caravel-0.8.8 to connect with a DRUID cluster. Once I click on any of the table , getting the below error. I tried refreshing the database several times, but still the error is present.

http://localhost:8088/caravel/explore/druid/2/

IndexError: list index out of range
Traceback (most recent call last)

    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__

    return self.wsgi_app(environ, start_response)

    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app

    response = self.make_response(self.handle_exception(e))

    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception

    reraise(exc_type, exc_value, tb)

    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app

    response = self.full_dispatch_request()

    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request

    rv = self.handle_user_exception(e)

    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception

    reraise(exc_type, exc_value, tb)

    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request

    rv = self.dispatch_request()

    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request

    return self.view_functions[rule.endpoint](**req.view_args)

    File "/usr/local/lib/python2.7/site-packages/flask_appbuilder/security/decorators.py", line 26, in wraps

    return f(self, *args, **kwargs)

    File "/Users/anindit/Downloads/caravel-master/caravel/models.py", line 1156, in wrapper

    return f(*args, **kwargs)

    File "/Users/anindit/Downloads/caravel-master/caravel/views.py", line 481, in explore

    slice_=slc)

    File "/Users/anindit/Downloads/caravel-master/caravel/viz.py", line 59, in __init__

    ff = FormFactory(self)

    File "/Users/anindit/Downloads/caravel-master/caravel/forms.py", line 115, in __init__

    default_metric = datasource.metrics_combo[0][0]

    IndexError: list index out of range
luchuan commented 8 years ago

got the same problem

xrmx commented 8 years ago

Is this still an issue?