Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Users Error #34970

Closed
1 of 2 tasks
renato-rt opened this issue Oct 16, 2023 · 6 comments
Closed
1 of 2 tasks

Users Error #34970

renato-rt opened this issue Oct 16, 2023 · 6 comments
Labels
area:core kind:bug This is a clearly a bug

Comments

@renato-rt
Copy link

renato-rt commented Oct 16, 2023

Apache Airflow version

2.7.2

What happened

When clicking on 'List Users' I am getting an error called:

But I don't have anyone connected, according to the error.

What you think should happen instead

Show users

How to reproduce

Click on menu Secutiry, after click on 'List Users'

Operating System

WIndows 11

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else

image

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@renato-rt renato-rt added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Oct 16, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Oct 16, 2023

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.

@Taragolis
Copy link
Contributor

@renato-rt could you post full traceback as a text

@atessier6
Copy link

I've got the same issue, here's the traceback:

[2023-10-16T16:37:54.854-0400] {app.py:1744} ERROR - Exception on /users/list/ [GET]
Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/site-packages/flask/app.py", line 2529, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/conda/lib/python3.8/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/conda/lib/python3.8/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/conda/lib/python3.8/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py", line 137, in wraps
    return f(self, *args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/views.py", line 555, in list
    return self.render_template(
  File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/baseviews.py", line 343, in render_template
    return render_template(
  File "/opt/conda/lib/python3.8/site-packages/flask/templating.py", line 147, in render_template
    return _render(app, template, context)
  File "/opt/conda/lib/python3.8/site-packages/flask/templating.py", line 130, in _render
    rv = template.render(context)
  File "/opt/conda/lib/python3.8/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/opt/conda/lib/python3.8/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/opt/conda/lib/python3.8/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/conda/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/base.html", line 1, in top-level template code
    {% extends base_template %}
  File "/opt/conda/lib/python3.8/site-packages/airflow/www/templates/airflow/main.html", line 21, in top-level template code
    {% from 'airflow/_messages.html' import show_message %}
  File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html", line 2, in top-level template code
    {% import 'appbuilder/baselib.html' as baselib %}
  File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/init.html", line 42, in top-level template code
    {% block body %}
  File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html", line 19, in block 'body'
    {% block content %}
  File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/general/model/list.html", line 7, in block 'content'
    {% block list_search scoped %}
  File "/opt/conda/lib/python3.8/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/conda/lib/python3.8/site-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
  File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/general/lib.html", line 304, in template
    {{ caller() }}
  File "/opt/conda/lib/python3.8/site-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
  File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/general/model/list.html", line 9, in template
    {{ widgets.get('search')()|safe }}
  File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/widgets.py", line 115, in __call__
    form_fields[col] = self.template_args["form"][col]()
  File "/opt/conda/lib/python3.8/site-packages/wtforms/fields/core.py", line 176, in __call__
    return self.meta.render_field(self, kwargs)
  File "/opt/conda/lib/python3.8/site-packages/wtforms/meta.py", line 64, in render_field
    return field.widget(field, **render_kw)
  File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/fieldwidgets.py", line 181, in __call__
    return super(Select2ManyWidget, self).__call__(field, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/wtforms/widgets/core.py", line 365, in __call__
    for val, label, selected, render_kw in field.iter_choices():
ValueError: not enough values to unpack (expected 4, got 3)

@Taragolis
Copy link
Contributor

Taragolis commented Oct 16, 2023

Seems like you installed WTForms greater or equal than 3.1.0 see related issues:

You need to install less then 3.1.0 (pip install "WTForms<3.1.0") or use constraints file, see: Installation from PyPI

@Taragolis Taragolis removed pending-response needs-triage label for new issues that we didn't triage yet labels Oct 16, 2023
@renato-rt
Copy link
Author

Wow, that worked! You are amazing guys, thank you so much @Taragolis!

@Rafnel
Copy link
Contributor

Rafnel commented Nov 20, 2023

Wanted to add another datapoint, we are on Airflow 2.6.3 and our users/roles page has been broken for a long time, same error as above. Downgrading to WTForms 3.0.1 fixed the issue. Thanks all!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area:core kind:bug This is a clearly a bug
Projects
None yet
Development

No branches or pull requests

4 participants