apache / superset

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

Stacktrace when trying to load /users/list #1040

Closed dugjason closed 6 years ago

dugjason commented 8 years ago

Receiving the following stacktrace rather than the list of users when trying to access http:///users/list

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1625, 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/flask_appbuilder/views.py", line 453, in list
    widgets=widgets)
  File "/usr/local/lib/python2.7/dist-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/local/lib/python2.7/dist-packages/flask/templating.py", line 134, in render_template
    context, ctx.app)
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 116, in _render
    rv = template.render(context)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-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/local/lib/python2.7/dist-packages/flask_appbuilder/templates/appbuilder/base.html", line 1, in top-level template code
    {% extends base_template %}
  File "/usr/local/lib/python2.7/dist-packages/caravel/templates/caravel/base.html", line 1, in top-level template code
    {% extends "appbuilder/baselayout.html" %}
  File "/usr/local/lib/python2.7/dist-packages/caravel/templates/appbuilder/baselayout.html", line 2, in top-level template code
    {% import 'appbuilder/baselib.html' as baselib %}
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/templates/appbuilder/init.html", line 46, in top-level template code
    {% block body %}
  File "/usr/local/lib/python2.7/dist-packages/caravel/templates/appbuilder/baselayout.html", line 21, in block "body"
    {% block content %}
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/templates/appbuilder/general/model/list.html", line 13, in block "content"
    {% block list_list scoped %}
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/templates/appbuilder/general/model/list.html", line 15, in block "list_list"
    {{ widgets.get('list')()|safe }}
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/widgets.py", line 34, in __call__
    return template.render(args)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/caravel/templates/appbuilder/general/widgets/list.html", line 2, in top-level template code
    {% extends 'appbuilder/general/widgets/base_list.html' %}
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/templates/appbuilder/general/widgets/base_list.html", line 4, in top-level template code
    {% set can_show = "can_show" | is_item_visible(modelview_name) %}
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/filters.py", line 122, in is_item_visible
    return self.security_manager.has_access(permission, item)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/security/manager.py", line 730, in has_access
    return self._has_view_access(g.user, permission_name, view_name)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/security/manager.py", line 721, in _has_view_access
    if (view_name == permission.view_menu.name) and (permission_name == permission.permission.name):
AttributeError: 'NoneType' object has no attribute 'name'
xrmx commented 8 years ago

which caravel version? what's the user role?

dugjason commented 8 years ago

Apologies. User is the admin created via fabmanager create-admin --app caravel Version is from airbnb_prod.0.10.0.1 branch. Latest commit https://github.com/airbnb/caravel/commit/ab43bbbc2115bbee6847e8f3a1eda0aaeb5db826

rrichardson commented 7 years ago

I have the same or similar error, I'm running 0.15.0 in python 3.5 .

I got this when I tried to perform a test of a database connection, (although I was able to add the database just fine)

Later, when editing a table that I added I got this :

Traceback (most recent call last): File "/usr/lib/python3.5/site-packages/superset/views.py", line 150, in wraps return f(self, *args, **kwargs) File "/usr/lib/python3.5/site-packages/flask_appbuilder/security/decorators.py", line 51, in wraps if self.appbuilder.sm.has_access(permission_str, self.__class__.__name__): File "/usr/lib/python3.5/site-packages/flask_appbuilder/security/manager.py", line 730, in has_access return self._has_view_access(g.user, permission_name, view_name) File "/usr/lib/python3.5/site-packages/flask_appbuilder/security/manager.py", line 721, in _has_view_access if (view_name == permission.view_menu.name) and (permission_name == permission.permission.name): AttributeError: 'NoneType' object has no attribute 'name'

Below is the screeny

screenshot from 2016-12-16 16-50-57

or

screenshot from 2016-12-16 16-49-49

rrichardson commented 7 years ago

I should note, There is only one user called admin, I'm using that user.

rrichardson commented 7 years ago

I also get this when I try to visit : superset/profile/admin/

rrichardson commented 7 years ago

Looking at some of the google-groups entries, it seems that (re)running superset init solved some problems. I tried running it and see some similar errors.. here's a chunk..

Note I am using Postgres

2016-12-21 16:14:09,442:INFO:flask_appbuilder.base:Registering class DruidMetricInlineView on menu 
2016-12-21 16:14:09,830:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2016-12-21 16:14:09,853:INFO:flask_appbuilder.base:Registering class DatabaseView on menu Databases
2016-12-21 16:14:10,228:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2016-12-21 16:14:10,248:INFO:flask_appbuilder.base:Registering class DatabaseAsync on menu 
2016-12-21 16:14:10,593:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2016-12-21 16:14:10,608:INFO:flask_appbuilder.base:Registering class DatabaseTablesAsync on menu 
2016-12-21 16:14:10,899:INFO:flask_appbuilder.base:Registering class TableModelView on menu Tables
2016-12-21 16:14:11,301:INFO:flask_appbuilder.base:Registering class AccessRequestsModelView on menu Access requests
2016-12-21 16:14:11,664:INFO:flask_appbuilder.base:Registering class DruidClusterModelView on menu Druid Clusters
2016-12-21 16:14:12,378:INFO:flask_appbuilder.base:Registering class SliceModelView on menu Slices
2016-12-21 16:14:12,776:INFO:flask_appbuilder.base:Registering class SliceAsync on menu 
2016-12-21 16:14:12,985:INFO:flask_appbuilder.base:Registering class SliceAddView on menu 
2016-12-21 16:14:13,235:INFO:flask_appbuilder.base:Registering class DashboardModelView on menu Dashboards
2016-12-21 16:14:13,331:ERROR:flask_appbuilder.base:Add Permission on View Error: 'NoneType' object has no attribute 'name'
2016-12-21 16:14:13,419:INFO:flask_appbuilder.base:Registering class DashboardModelViewAsync on menu 
2016-12-21 16:14:13,638:INFO:flask_appbuilder.base:Registering class LogModelView on menu Action Log
2016-12-21 16:14:14,147:INFO:flask_appbuilder.base:Registering class QueryView on menu Queries
2016-12-21 16:14:14,441:INFO:flask_appbuilder.base:Registering class DruidDatasourceModelView on menu Druid Datasources
2016-12-21 16:14:14,813:INFO:flask_appbuilder.base:Registering class R on menu 
2016-12-21 16:14:14,885:INFO:flask_appbuilder.base:Registering class Superset on menu 
2016-12-21 16:14:14,994:ERROR:flask_appbuilder.base:Add Permission on View Error: 'NoneType' object has no attribute 'name'
rrichardson commented 7 years ago

Looking around for configuration options in the source that might effect it, I commented out DRUID_IS_ACTIVE=True and DRUID_TZ=tz.tzutc() then deleted and re-created the superset db.

The effect this had was giving me the above Internal Server Error and stack trace immediately upon logging in.

mistercrunch commented 6 years ago

Notice: this issue has been closed because it has been inactive for 487 days. Feel free to comment and request for this issue to be reopened.