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

[Druid] Superset not working with Druid when 'Druid Basic Security' is activated #4776

Closed
aleksi75 opened this issue Apr 6, 2018 · 3 comments · Fixed by #6795
Closed

[Druid] Superset not working with Druid when 'Druid Basic Security' is activated #4776

aleksi75 opened this issue Apr 6, 2018 · 3 comments · Fixed by #6795

Comments

@aleksi75
Copy link
Contributor

aleksi75 commented Apr 6, 2018

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.24.0

Expected results

Data is queried from Druid broker and shown in chart

Actual results

We are using Druid 0.12.0 and testing the new Druid Basic Security extension in our DEV zone.
The Feature is new but working well. In connection with Superset we are running into troubles,
because there is no (known) possibility to configure the data (user, pwd) for the auth header.
We also tested a more old school variation with prepending user and pwd to the url as
seen in example below (sry I am not able/allowed to post a screenshot):

Coordinator Host: admin:admin@host1337
Coordinator Port: 8081
Coordinator Endpoint: druid/coordinator/v1/metadata
Broker Host: admin:admin@host1337
Broker Port: 8082
Broker Endpoint: druid/v2

This seems to work with coordinator, we are able to scan datasources and refreshing metadata.
In case of the broker this approach did not work, after running a query a chart we get:

Traceback (most recent call last):
File "/opt/venv/lib/python2.7/site-packages/superset/viz.py", line 329, in get_df_payload
df = self.get_df(query_obj)
File "/opt/venv/lib/python2.7/site-packages/superset/viz.py", line 142, in get_df
self.results = self.datasource.query(query_obj)
File "/opt/venv/lib/python2.7/site-packages/superset/connectors/druid/models.py", line 1238, in query
client=client, query_obj=query_obj, phase=2)
File "/opt/venv/lib/python2.7/site-packages/superset/connectors/druid/models.py", line 959, in get_query_str
return self.run_query(client=client, phase=phase, **query_obj)
File "/opt/venv/lib/python2.7/site-packages/superset/connectors/druid/models.py", line 1126, in run_query
client.timeseries(**qry)
File "/opt/venv/lib/python2.7/site-packages/pydruid/client.py", line 167, in timeseries
return self._post(query)
File "/opt/venv/lib/python2.7/site-packages/pydruid/client.py", line 484, in _post
res = urllib.request.urlopen(req)
File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/lib64/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 1244, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib64/python2.7/urllib2.py", line 1214, in do_open
raise URLError(err)
URLError: <urlopen error [Errno -2] Name or service not known>

For us it seems that prepending user and pwd to the url is not possible with urllib2.py.

On the other hand, without them we get an auth error.

Traceback (most recent call last):
File "/opt/venv/lib/python2.7/site-packages/superset/viz.py", line 329, in get_df_payload
df = self.get_df(query_obj)
File "/opt/venv/lib/python2.7/site-packages/superset/viz.py", line 142, in get_df
self.results = self.datasource.query(query_obj)
File "/opt/venv/lib/python2.7/site-packages/superset/connectors/druid/models.py", line 1238, in query
client=client, query_obj=query_obj, phase=2)
File "/opt/venv/lib/python2.7/site-packages/superset/connectors/druid/models.py", line 959, in get_query_str
return self.run_query(client=client, phase=phase, **query_obj)
File "/opt/venv/lib/python2.7/site-packages/superset/connectors/druid/models.py", line 1126, in run_query
client.timeseries(**qry)
File "/opt/venv/lib/python2.7/site-packages/pydruid/client.py", line 167, in timeseries
return self._post(query)
File "/opt/venv/lib/python2.7/site-packages/pydruid/client.py", line 498, in _post
e, err, json.dumps(query.query_dict, indent=4)))
IOError: HTTP Error 401: Unauthorized

You may correct me, but at the moment Superset and Druid with auth enabled is
not working?

Steps to reproduce

@SpyderRivera
Copy link
Contributor

Any update on this?

@capistrant
Copy link

I am also curious about the status of Superset + Druid w/ basic security enabled

@donbowman
Copy link
Contributor

donbowman commented Jan 31, 2019

Seems like pydruid added this here in druid-io/pydruid#80

donbowman added a commit to donbowman/incubator-superset that referenced this issue Jan 31, 2019
This should resolve [Issue apache#4776](apache#4776)

Add HTTP Basic Auth to the Druid Broker.

Signed-off-by: Don Bowman <don@agilicus.com>
mistercrunch pushed a commit that referenced this issue Mar 25, 2019
* Add HTTP Basic Auth for Druid (Issue #4776)

This should resolve [Issue #4776](#4776)

Add HTTP Basic Auth to the Druid Broker.

Signed-off-by: Don Bowman <don@agilicus.com>

* Encrypt broker password in database

Signed-off-by: Don Bowman <don@agilicus.com>

* Merge from master, new migration needed

Signed-off-by: Don Bowman <don@agilicus.com>

* Do not expose hashed druid basic auth password

* docs: add description_columns for druid basic auth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants