question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FAB generates empty permissions

See original GitHub issue

Make sure these boxes are checked before submitting your issue - thank you!

  • [/] I have checked the superset logs for python stacktraces and included it here as text if any
  • [/] I have reproduced the issue with at least the latest released version of superset
  • [] I have checked the issue tracker for the same issue and I haven’t found one similar

Superset version

0.20.1

Expected results

Upgrade should be done without any errors

Actual results

superset db upgrade failed with the following messages:

Loaded your LOCAL configuration at [/home/superset/superset_config.py]
2017-11-02 11:29:23,393:ERROR:flask_appbuilder.base:'NoneType' object has no attribute 'name'
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/flask_appbuilder/base.py", line 462, in _add_permission
    self.sm.add_permissions_view(baseview.base_permissions, baseview.__class__.__name__)
  File "/usr/local/lib/python3.5/site-packages/flask_appbuilder/security/manager.py", line 804, in add_permissions_view
    if perm_view.permission.name not in base_permissions:
AttributeError: 'NoneType' object has no attribute 'name'
2017-11-02 11:29:23,394:ERROR:flask_appbuilder.base:Add Permission on View Error: 'NoneType' object has no attribute 'name'
2017-11-02 11:29:24,042:ERROR:flask_appbuilder.base:'NoneType' object has no attribute 'name'
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/flask_appbuilder/base.py", line 462, in _add_permission
    self.sm.add_permissions_view(baseview.base_permissions, baseview.__class__.__name__)
  File "/usr/local/lib/python3.5/site-packages/flask_appbuilder/security/manager.py", line 804, in add_permissions_view
    if perm_view.permission.name not in base_permissions:
AttributeError: 'NoneType' object has no attribute 'name'
2017-11-02 11:29:24,042:ERROR:flask_appbuilder.base:Add Permission on View Error: 'NoneType' object has no attribute 'name'
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade ca69c70ec99b -> ddd6ebdd853b, annotations
INFO  [alembic.runtime.migration] Running upgrade a9c47e2c1547, ddd6ebdd853b -> d39b1e37131d, empty message
INFO  [alembic.runtime.migration] Running upgrade ca69c70ec99b -> 19a814813610, Adding metric warning_text
INFO  [alembic.runtime.migration] Running upgrade 19a814813610, a9c47e2c1547 -> 472d2f73dfd4, empty message
INFO  [alembic.runtime.migration] Running upgrade 472d2f73dfd4, d39b1e37131d -> f959a6652acd, empty message

After superset db upgrade being failed, I found weird records from the table ab_permission_view:

_mysql_5_5_5-10_1_19-mariadb__dev-superset_superset_ab_permission_view_and_slack_-_dailyhotel

Steps to reproduce

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
mistercrunchcommented, Nov 22, 2017

Yes superset init needs to run as some point to create new perms around new views or models and associating them to our roles.

Actually at the moment starting up FAB does some of that work (creating new views and models perms), but that’s an issue as when we start many gunicorn workers at once it creates race conditions that ultimately leads to this bad state. That’s my guess anyways as I don’t have hard evidence.

Based on that intuition I added this feature to FAB to make perm management optional on startup https://github.com/dpgaspar/Flask-AppBuilder/pull/625

We should switch this option to be the default in Superset and get superset init to trigger that instead.

So short answer is superset init should be executed once per deploy, probably right after superset db upgrade.

3reactions
oripwkcommented, Oct 4, 2018

I’m having exactly the same issue but I don’t have any NULLs in ab_permission_view. What should I do?

Read more comments on GitHub >

github_iconTop Results From Across the Web

FAB generates empty permissions #3758 - apache/superset
There's an issue where somehow FAB gets in a bad state with perms which explains the stack trace, though it looks like the...
Read more >
Security - Flask AppBuilder - Read the Docs
Now FAB will only generate one permission pair: can access on api. If you want to revert back your permission names override, or...
Read more >
[Fab-user] First Fabric connected but got 'Permission denied ...
I used my account credentials in the fabric file. Using the credentials, I can log on and do almost all the operations (wget,...
Read more >
Access Control — Airflow Documentation
Admin can create a set of roles which are only allowed to view a certain set of dags. This is called DAG level...
Read more >
Amazon SageMaker API Permissions - AWS Documentation
Provides a complete list of the required API permissions you can use to control access to your Amazon SageMaker resources.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found