cesar-vermeulen opened a new issue, #33586:
URL: https://github.com/apache/airflow/issues/33586
### Apache Airflow version
2.7.0
### What happened
When connecting to the Airflow UI, we get the following message:
```
> Python version: 3.11.4
> Airflow version: 2.7.0
> Node: redact
>
-------------------------------------------------------------------------------
> Error! Please contact server admin.
```
If we investigate further and we look at the Kubernetes pod logs, we see
that following error message is thrown:
> File
"/home/airflow/.local/lib/python3.11/site-packages/airflow/www/views.py", line
989, in index
> return self.render_template(
> ^^^^^^^^^^^^^^^^^^^^^
> File
"/home/airflow/.local/lib/python3.11/site-packages/airflow/www/views.py", line
694, in render_template
> return super().render_template(
> ^^^^^^^^^^^^^^^^^^^^^^^^
> File
"/home/airflow/.local/lib/python3.11/site-packages/flask_appbuilder/baseviews.py",
line 339, in render_template
> return render_template(
> ^^^^^^^^^^^^^^^^
> File
"/home/airflow/.local/lib/python3.11/site-packages/flask/templating.py", line
147, in render_template
> return _render(app, template, context)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File
"/home/airflow/.local/lib/python3.11/site-packages/flask/templating.py", line
130, in _render
> rv = template.render(context)
> ^^^^^^^^^^^^^^^^^^^^^^^^
> File
"/home/airflow/.local/lib/python3.11/site-packages/jinja2/environment.py", line
1301, in render
> self.environment.handle_exception()
> File
"/home/airflow/.local/lib/python3.11/site-packages/jinja2/environment.py", line
936, in handle_exception
> raise rewrite_traceback_stack(source=source)
> File
"/home/airflow/.local/lib/python3.11/site-packages/airflow/www/templates/airflow/dags.html",
line 44, in top-level template code
> {% elif curr_ordering_direction == 'asc' and
request.args.get('sorting_key') == attribute_name %}
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> File
"/home/airflow/.local/lib/python3.11/site-packages/airflow/www/templates/airflow/main.html",
line 21, in top-level template code
> {% from 'airflow/_messages.html' import show_message %}
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> File
"/home/airflow/.local/lib/python3.11/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html",
line 2, in top-level template code
> {% import 'appbuilder/baselib.html' as baselib %}
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> File
"/home/airflow/.local/lib/python3.11/site-packages/flask_appbuilder/templates/appbuilder/init.html",
line 42, in top-level template code
> {% block body %}
> File
"/home/airflow/.local/lib/python3.11/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html",
line 8, in block 'body'
> {% block navbar %}
> File
"/home/airflow/.local/lib/python3.11/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html",
line 10, in block 'navbar'
> {% include 'appbuilder/navbar.html' %}
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> File
"/home/airflow/.local/lib/python3.11/site-packages/airflow/www/templates/appbuilder/navbar.html",
line 53, in top-level template code
> {% include 'appbuilder/navbar_right.html' %}
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> File
"/home/airflow/.local/lib/python3.11/site-packages/airflow/www/templates/appbuilder/navbar_right.html",
line 71, in top-level template code
> <span>{% for name in user_names %}{{ name[0].upper() }}{% endfor
%}</span>
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> File
"/home/airflow/.local/lib/python3.11/site-packages/jinja2/environment.py", line
485, in getattr
> return getattr(obj, attribute)
> ^^^^^^^^^^^^^^^^^^^^^^^
> jinja2.exceptions.UndefinedError: str object has no element 0
>
### What you think should happen instead
Show the Airflow UI
### How to reproduce
The deployment is done using the official Airflow helm chart with Azure AD
authentication on the webserver.
As soon as we did the upgrade to Airflow 2.7, the webserver became
unreacheable when trying to access it with the error shown above.
### Operating System
Debian GNU/Linux 11 (bullseye)
### Versions of Apache Airflow Providers
apache-airflow-providers-cncf-kubernetes==7.4.2
apache-airflow-providers-docker==3.6.0
apache-airflow-providers-microsoft-azure==4.3.0
### Deployment
Official Apache Airflow Helm Chart
### Deployment details
Webserver config:
AUTH_TYPE = AUTH_OAUTH
AUTH_ROLE_ADMIN = 'Admin'
AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION_ROLE = "Admin"
OAUTH_PROVIDERS = [
{
"name": "azure",
"icon": "fa-microsoft",
"token_key": "access_token",
"remote_app": {
"client_id": "${airflow_client_id}",
"client_secret": "${airflow_client_secret}",
"api_base_url":
"https://login.microsoftonline.com/${airflow_tenant_id}/oauth2",
"client_kwargs": {
"scope": "User.read name preferred_username email profile",
"resource": "${airflow_client_id}",
},
"request_token_url": None,
"access_token_url":
"https://login.microsoftonline.com/${airflow_tenant_id}/oauth2/token",
"authorize_url":
"https://login.microsoftonline.com/${airflow_tenant_id}/oauth2/authorize",
},
},
]
### Anything else
_No response_
### 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]