Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

HDP-2.6.4.0 - Superset - internal error when select source - databases from menu

HDP-2.6.4.0 - Superset - internal error when select source - databases from menu

New Contributor

Using HDP-2.6.4.0 - Superset. Getting internal error when I select source - databases from menu bar. Error is as following.

File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_appbuilder/security/decorators.py", line 26, in wraps
    return f(self, *args, **kwargs)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_appbuilder/views.py", line 453, in list
    widgets=widgets)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_appbuilder/baseviews.py", line 158, in render_template
    return render_template(template, **dict(list(kwargs.items()) + list(self.extra_args.items())))
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask/templating.py", line 134, in render_template
    context, ctx.app)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask/templating.py", line 116, in _render
    rv = template.render(context)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_appbuilder/templates/appbuilder/general/model/list.html", line 2, in top-level template code
    {% import 'appbuilder/general/lib.html' as lib %}
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_appbuilder/templates/appbuilder/base.html", line 1, in top-level template code
    {% extends base_template %}
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/superset/templates/superset/base.html", line 1, in top-level template code
    {% extends "appbuilder/baselayout.html" %}
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/superset/templates/appbuilder/baselayout.html", line 2, in top-level template code
    {% import 'appbuilder/baselib.html' as baselib %}
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_appbuilder/templates/appbuilder/init.html", line 46, in top-level template code
    {% block body %}
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/superset/templates/appbuilder/baselayout.html", line 21, in block "body"
    {% block content %}
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_appbuilder/templates/appbuilder/general/model/list.html", line 13, in block "content"
    {% block list_list scoped %}
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_appbuilder/templates/appbuilder/general/model/list.html", line 15, in block "list_list"
    {{ widgets.get('list')()|safe }}
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_appbuilder/widgets.py", line 34, in __call__
    return template.render(args)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_appbuilder/templates/appbuilder/general/widgets/list.html", line 2, in top-level template code
    {% extends 'appbuilder/general/widgets/base_list.html' %}
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_appbuilder/templates/appbuilder/general/widgets/base_list.html", line 23, in top-level template code
    {% block begin_loop_values %}
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_appbuilder/templates/appbuilder/general/widgets/list.html", line 45, in block "begin_loop_values"
    {% for item in value_columns %}
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/jinja2/runtime.py", line 435, in __init__
    self._after = self._safe_next()
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/jinja2/runtime.py", line 455, in _safe_next
    return next(self._iterator)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_appbuilder/models/base.py", line 87, in get_values
    retdict[col] = self._get_attr_value(item, col)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_appbuilder/models/base.py", line 36, in _get_attr_value
    if not hasattr(item, col):
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/superset/models.py", line 712, in backend
    url = make_url(self.sqlalchemy_uri_decrypted)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/superset/models.py", line 859, in sqlalchemy_uri_decrypted
    return str(conn)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/sqlalchemy/engine/url.py", line 90, in __str__
    return self.__to_string__(hide_password=False)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/sqlalchemy/engine/url.py", line 72, in __to_string__
    else _rfc_1738_quote(self.password))
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/sqlalchemy/engine/url.py", line 247, in _rfc_1738_quote
    return re.sub(r'[:@/]', lambda m: "%%%X" % ord(m.group(0)), text)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/re.py", line 179, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: can't use a string pattern on a bytes-like object
1 REPLY 1

Re: HDP-2.6.4.0 - Superset - internal error when select source - databases from menu

New Contributor

Exception went away after changing the method sqlalchemy_uri_decrypted() in file /usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/superset/models.py as following. Not sure what side effects this will create, so far working okay.

    @property
    def sqlalchemy_uri_decrypted(self):
        conn = sqla.engine.url.make_url(self.sqlalchemy_uri)
        conn.password = self.password
        #return str(conn)
        return conn