You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "nikkylesssy-star (via GitHub)" <gi...@apache.org> on 2026/03/20 10:54:39 UTC

[I] [3.1.8] TypeError super(type, obj) on /users/list and /roles/list in Flask AppBuilder UI [airflow]

nikkylesssy-star opened a new issue, #63982:
URL: https://github.com/apache/airflow/issues/63982

   ### Apache Airflow version
   
   3.1.8
   
   ### If "Other Airflow 3 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   Apache Airflow 3.1.8: Pages /users/list/ and /roles/list/ crash with:
   
   TypeError: super(type, obj): obj must be an instance or subtype of type
   
   Traceback points to: flask_appbuilder/fieldwidgets.py in BS3TextFieldWidget.
   
   Occurs on Airflow Web UI when visiting Users and Roles screens.
   (flask_appbuilder version bundled with 3.1.8?)
   
   
   
   Database state:
   – ab_user and ab_role tables contain valid records.
   
   Expected behaviour:
   UI displays list of users / roles without exception.
   
   Relevant logs and traceback are attached below.
   
   Please advise if this is a known issue or required patch?
   
   Environment:
   Airflow 3.1.8 (from Bitnami Helm)
   Python 3.x
   Flask AppBuilder integration.
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   Steps to reproduce:
   1. Install Airflow 3.1.8 (Helm/Bitnami or other)
   2. Log in as Admin
   3. Navigate to /users/list/ or /roles/list/
   4. See 500 error with TypeError
   
   
   ### Operating System
   
   k8s
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   
   TypeError: super(type, obj): obj must be an instance or subtype of type
   INFO:     172.22.48.113:59932 - "GET /auth/users/list/ HTTP/1.1" 500 Internal Server Error
   INFO:     172.22.25.96:49750 - "GET /ui/dags?dag_runs_limit=14&limit=50&offset=0&exclude_stale=true&order_by=dag_display_name HTTP/1.1" 200 OK
   INFO:     172.22.25.96:49750 - "GET /api/v2/variables?limit=30&offset=0&order_by=key HTTP/1.1" 200 OK
   2026-03-20T10:31:22.490021Z [error    ] Exception on /roles/list/ [GET] [airflow.providers.fab.www.app] loc=app.py:1744
   Traceback (most recent call last):
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask/app.py", line 2529, in wsgi_app
       response = self.full_dispatch_request()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask/app.py", line 1825, in full_dispatch_request
       rv = self.handle_user_exception(e)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask/app.py", line 1823, in full_dispatch_request
       rv = self.dispatch_request()
            ^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask/app.py", line 1799, in dispatch_request
       return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask_appbuilder/security/decorators.py", line 151, in wraps
       return f(self, *args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask_appbuilder/views.py", line 205, in list
       return self.render_template(
              ^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask_appbuilder/baseviews.py", line 346, in render_template
       return render_template(
              ^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask/templating.py", line 147, in render_template
       return _render(app, template, context)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask/templating.py", line 130, in _render
       rv = template.render(context)
            ^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/jinja2/environment.py", line 1295, in render
       self.environment.handle_exception()
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/jinja2/environment.py", line 942, in handle_exception
       raise rewrite_traceback_stack(source=source)
     File "/opt/bitnami/airflow/venv/lib/python3.12/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 "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask_appbuilder/templates/appbuilder/base.html", line 1, in top-level template code
       {% extends base_template %}
       ^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/airflow/providers/fab/www/templates/airflow/main.html", line 21, in top-level template code
       {% from 'airflow/_messages.html' import show_message %}
       ^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html", line 2, in top-level template code
       {% import 'appbuilder/baselib.html' as baselib %}
       ^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask_appbuilder/templates/appbuilder/init.html", line 42, in top-level template code
       {% block body %}
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html", line 19, in block 'body'
       {% block content %}
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask_appbuilder/templates/appbuilder/general/model/list.html", line 7, in block 'content'
       {% block list_search scoped %}
       ^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask_appbuilder/templates/appbuilder/general/model/list.html", line 8, in block 'list_search'
       {% call lib.accordion_tag("accordion1",_("Search"), False) %}
       ^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/jinja2/runtime.py", line 784, in _invoke
       rv = self._func(*arguments)
            ^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask_appbuilder/templates/appbuilder/general/lib.html", line 304, in template
       {{ caller() }}
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/jinja2/runtime.py", line 784, in _invoke
       rv = self._func(*arguments)
            ^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask_appbuilder/templates/appbuilder/general/model/list.html", line 9, in template
       {{ widgets.get('search')()|safe }}
       ^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask_appbuilder/widgets.py", line 114, in __call__
       form_fields[col] = self.template_args["form"][col]()
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/wtforms/fields/core.py", line 164, in __call__
       return self.meta.render_field(self, kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/wtforms/meta.py", line 64, in render_field
       return field.widget(field, **render_kw)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/bitnami/airflow/venv/lib/python3.12/site-packages/flask_appbuilder/fieldwidgets.py", line 68, in __call__
       return super(BS3TextFieldWidget, self).__call__(field, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   TypeError: super(type, obj): obj must be an instance or subtype of type
   INFO:     172.22.48.113:59932 - "GET /auth/roles/list/ HTTP/1.1" 500 Internal Server Error
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [3.1.8] TypeError super(type, obj) on /users/list and /roles/list in Flask AppBuilder UI [airflow]

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal closed issue #63982: [3.1.8] TypeError super(type, obj) on /users/list and /roles/list in Flask AppBuilder UI
URL: https://github.com/apache/airflow/issues/63982


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [3.1.8] TypeError super(type, obj) on /users/list and /roles/list in Flask AppBuilder UI [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #63982:
URL: https://github.com/apache/airflow/issues/63982#issuecomment-4097220958

   Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [3.1.8] TypeError super(type, obj) on /users/list and /roles/list in Flask AppBuilder UI [airflow]

Posted by "BevisDev (via GitHub)" <gi...@apache.org>.
BevisDev commented on issue #63982:
URL: https://github.com/apache/airflow/issues/63982#issuecomment-4669342065

   Hi team,
   
   We're hitting the same `TypeError` on FAB admin pages in production (Airflow **3.2.2**, Helm chart, K8s).
   
   **Symptoms**
   - `GET /auth/roles/list/` → **500**
   - Traceback ends with:
   
   airflow@airflow3-api-server-579768c4f7-bwvng:/opt/airflow$ python -c "import airflow; print(\"version:\", airflow.__version__)"
   echo "---"
   CONN=$(python -c "import airflow.api_fastapi.core_api.services.ui.connections as m; print(m.__file__)")
   echo "file: $CONN"
   grep -n "MockAnyWidget\|mock.patch.*BS3TextFieldWidget" "$CONN" || echo "NO mock patch found (good)"
   '
   version: 3.2.2
   ---
   file: /home/airflow/.local/lib/python3.13/site-packages/airflow/api_fastapi/core_api/services/ui/connections.py
   119:    class MockAnyWidget:
   178:                mock.patch("flask_appbuilder.fieldwidgets.BS3TextFieldWidget", HookMetaService.MockAnyWidget),
   180:                    "flask_appbuilder.fieldwidgets.BS3TextAreaFieldWidget", HookMetaService.MockAnyWidget
   183:                    "flask_appbuilder.fieldwidgets.BS3PasswordFieldWidget", HookMetaService.MockAnyWidget
   > ^C
   airflow@airflow3-api-server-579768c4f7-bwvng:/opt/airflow$
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [3.1.8] TypeError super(type, obj) on /users/list and /roles/list in Flask AppBuilder UI [airflow]

Posted by "Subham-KRLX (via GitHub)" <gi...@apache.org>.
Subham-KRLX commented on issue #63982:
URL: https://github.com/apache/airflow/issues/63982#issuecomment-4097738310

   I have identified the root cause of this and opened a PR to fix it here: #63986.
   **For context**: The crash was happening because the API's Hook metadata extractor was temporarily mocking the global `BS3TextFieldWidget` class using `unittest.mock.patch`. If a user visited the FAB pages at the exact same time the API ran this extraction, `super()` inside FAB evaluated against the temporary mock instead of the real base class, causing the `TypeError`.
   The PR removes the non-thread-safe global mocking and natively extracts the UI metadata straight from the WTForms `UnboundField`, fully resolving the crash. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org