Bug description

I updated the superset_config.py so as to show a diffrent page via the follwoing code (Only a small snippet has implemented other things like RLS, OAuth etc too in the config file - BUT THE ERROR SHOWS THAT THE Superset config file doesnt contain the Attribute "SupersetDashboardIndexView", its clearly defined in the file.)

THE EXACT SAME COD EUSED TO WORK ON 4.1.1 version but during migration to 5.0.0 the issue occured....

from flask_appbuilder import expose, IndexView from superset.superset_typing import FlaskResponse

class SupersetDashboardIndexView(IndexView): @expose("/") def index(self) -> FlaskResponse: session.pop('_flashes', None) return redirect("/dashboard/list/")

FAB_INDEX_VIEW = f"{SupersetDashboardIndexView.module}.{SupersetDashboardIndexView.name}"

ERROR But it shos the below error::: 2025-08-02 05:28:39,794:ERROR:flask_appbuilder.base:module 'superset_config' has no attribute 'SupersetDashboardIndexView' Traceback (most recent call last): File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/base.py", line 52, in dynamic_class_import return reduce(getattr, tmp[1:], package) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,795:ERROR:flask_appbuilder.base:An error occurred when importing declared addon superset_config.SupersetDashboardIndexView: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,794:ERROR:flask_appbuilder.base:module 'superset_config' has no attribute 'SupersetDashboardIndexView' Traceback (most recent call last): File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/base.py", line 52, in dynamic_class_import return reduce(getattr, tmp[1:], package) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,794:ERROR:flask_appbuilder.base:module 'superset_config' has no attribute 'SupersetDashboardIndexView' Traceback (most recent call last): File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/base.py", line 52, in dynamic_class_import return reduce(getattr, tmp[1:], package) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,795:ERROR:flask_appbuilder.base:An error occurred when importing declared addon superset_config.SupersetDashboardIndexView: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,795:ERROR:flask_appbuilder.base:An error occurred when importing declared addon superset_config.SupersetDashboardIndexView: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,795:ERROR:flask_appbuilder.base:module 'superset_config' has no attribute 'SupersetDashboardIndexView' Traceback (most recent call last): File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/base.py", line 52, in dynamic_class_import return reduce(getattr, tmp[1:], package) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,795:ERROR:flask_appbuilder.base:module 'superset_config' has no attribute 'SupersetDashboardIndexView' Traceback (most recent call last): File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/base.py", line 52, in dynamic_class_import return reduce(getattr, tmp[1:], package) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,795:ERROR:flask_appbuilder.base:An error occurred when importing declared addon superset_config.SupersetDashboardIndexView: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,795:ERROR:flask_appbuilder.base:module 'superset_config' has no attribute 'SupersetDashboardIndexView' Traceback (most recent call last): File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/base.py", line 52, in dynamic_class_import return reduce(getattr, tmp[1:], package) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,795:ERROR:flask_appbuilder.base:An error occurred when importing declared addon superset_config.SupersetDashboardIndexView: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,795:ERROR:flask_appbuilder.base:module 'superset_config' has no attribute 'SupersetDashboardIndexView' Traceback (most recent call last): File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/base.py", line 52, in dynamic_class_import return reduce(getattr, tmp[1:], package) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,795:ERROR:flask_appbuilder.base:An error occurred when importing declared addon superset_config.SupersetDashboardIndexView: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,795:ERROR:flask_appbuilder.base:An error occurred when importing declared addon superset_config.SupersetDashboardIndexView: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,795:ERROR:flask_appbuilder.base:module 'superset_config' has no attribute 'SupersetDashboardIndexView' Traceback (most recent call last): File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/base.py", line 52, in dynamic_class_import return reduce(getattr, tmp[1:], package) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,795:ERROR:flask_appbuilder.base:An error occurred when importing declared addon superset_config.SupersetDashboardIndexView: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,795:ERROR:flask_appbuilder.base:module 'superset_config' has no attribute 'SupersetDashboardIndexView' Traceback (most recent call last): File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/base.py", line 52, in dynamic_class_import return reduce(getattr, tmp[1:], package) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,796:ERROR:flask_appbuilder.base:An error occurred when importing declared addon superset_config.SupersetDashboardIndexView: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,797:INFO:superset.initialization:Setting database isolation level to READ COMMITTED 2025-08-02 05:28:39,799:ERROR:flask_appbuilder.base:module 'superset_config' has no attribute 'SupersetDashboardIndexView' Traceback (most recent call last): File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/base.py", line 52, in dynamic_class_import return reduce(getattr, tmp[1:], package) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:39,800:ERROR:flask_appbuilder.base:An error occurred when importing declared addon superset_config.SupersetDashboardIndexView: module 'superset_config' has no attribute 'SupersetDashboardIndexView' 2025-08-02 05:28:40,051:INFO:superset.utils.screenshots:No PIL installation found

WHATS THIS RELATED TO ???

Screenshots/recordings

No response

Superset version

5.0.0

Python version

3.11

Node version

18 or greater

Browser

Chrome

Additional context

No response

Checklist

  • [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: dosubot[bot]

This is a breaking change in Superset 5.0.0: customizing the main IndexView using FAB_INDEX_VIEW in superset_config.py is no longer supported. Superset now ignores this setting, which is why you see the "attribute not found" error—even if your class is defined correctly. The new, supported way is to use FLASK_APP_MUTATOR to programmatically set appbuilder.indexview before views are registered.

To migrate, define your custom IndexView class as before, then add a mutate_app function and assign it to FLASK_APP_MUTATOR:

from flask_appbuilder import expose, IndexView
from superset.typing import FlaskResponse

class SupersetDashboardIndexView(IndexView):
    @expose("/")
    def index(self) -> FlaskResponse:
        session.pop('_flashes', None)
        return redirect("/dashboard/list/")

def mutate_app(app):
    from superset.extensions import appbuilder
    appbuilder.indexview = SupersetDashboardIndexView

FLASK_APP_MUTATOR = mutate_app

Remove any FAB_INDEX_VIEW setting from your config. Make sure your config file is loaded (check logs for "Loaded your LOCAL configuration at [...]") and that your mutate_app function runs at startup. If you're using Docker, ensure your config file is in the correct location (e.g., ./docker/pythonpath_dev/superset_config_docker.py) and restart your containers. More details and troubleshooting tips are available in this discussion and this thread.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

Comment From: user1500177

@dosuI tried to implement this logic also but it's not working ,doesn't redirect me instead moves to superset welcome page itself

Comment From: paulsonkevgit

@dosu It doesn't redirect me to dashboard page instead , i move to superset welcome page

Comment From: dosubot[bot]

This usually means Superset isn't loading your config file or isn't running your mutate_app function, so your custom IndexView isn't being registered and Superset falls back to the default welcome page (details, discussion).

To troubleshoot: 1. Confirm your deployment method (Docker, Docker Compose, or bare metal) and the exact location/name of your config file. 2. Add raise Exception("test") at the very top of your config file, restart Superset, and check the logs—if you don't see this error, your config isn't being loaded. 3. Add a print or log statement inside your mutate_app function to confirm it runs at startup. 4. Make sure you have FLASK_APP_MUTATOR = mutate_app at the bottom of your config, and remove any FAB_INDEX_VIEW setting. 5. If using Docker Compose, your config should be at ./docker/pythonpath_dev/superset_config_docker.py on the host, and you must restart all containers after changes.

Once you've confirmed the config is loaded and mutate_app runs, visit the root URL (/) and you should see your redirect. If not, please share your config snippet (with sensitive info removed) and any relevant log output from these steps.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X