superset icon indicating copy to clipboard operation
superset copied to clipboard

Druid Datasource-IndexError: list index out of range

Open vinjadhav opened this issue 10 years ago • 11 comments

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"

vinjadhav avatar Apr 15 '16 08:04 vinjadhav

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 avatar Apr 15 '16 09:04 weand

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

  • the password is entered and displayed correctly in the Data Source configuration
  • and connection test on the data source is also working

    there seems to be a problem with password in the database

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

weand avatar Apr 15 '16 13:04 weand

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

mistercrunch avatar Apr 15 '16 15:04 mistercrunch

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

polomarcus avatar Apr 15 '16 16:04 polomarcus

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)

mistercrunch avatar Apr 16 '16 00:04 mistercrunch

@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"

vinjadhav avatar Apr 16 '16 07:04 vinjadhav

@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

polomarcus avatar Apr 18 '16 08:04 polomarcus

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.

mistercrunch avatar Apr 19 '16 03:04 mistercrunch

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

deyani27 avatar Apr 20 '16 00:04 deyani27

got the same problem

luchuan avatar Apr 22 '16 02:04 luchuan

Is this still an issue?

xrmx avatar Aug 09 '16 08:08 xrmx