这是indexloc提供的服务,不要输入任何密码
Skip to content

Airflow 3.1.1 oauth login broken #57485

@anavrotski

Description

@anavrotski

Apache Airflow version

3.1.1

If "Other Airflow 2/3 version" selected, which one?

No response

What happened?

After pressing log out - log in is impossible if OAuth enabled.
After rolling back to Airflow 3.1.0 - everything works.
API server log:

api-server INFO: 172.25.117.209:55662 - "GET /auth/login/azure?next=https%3A//...our airflow host.../ HTTP/1.1" 302 Found
api-server 2025-10-29T11:50:29.527746Z [error [] Exception on /oauth-authorized/azure [GET[] [airflow.providers.fab.www.app] loc=app.py:1744
api-server Traceback (most recent call last):
api-server File "/home/airflow/.local/lib/python3.12/site-packages/flask/app.py", line 2529, in wsgi_app
api-server response = self.full_dispatch_request()
api-server ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-server File "/home/airflow/.local/lib/python3.12/site-packages/flask/app.py", line 1825, in full_dispatch_request
api-server rv = self.handle_user_exception(e)
api-server ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-server File "/home/airflow/.local/lib/python3.12/site-packages/flask/app.py", line 1823, in full_dispatch_request
api-server rv = self.dispatch_request()
api-server ^^^^^^^^^^^^^^^^^^^^^^^
api-server File "/home/airflow/.local/lib/python3.12/site-packages/flask/app.py", line 1799, in dispatch_request
api-server return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
api-server ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-server File "/home/airflow/.local/lib/python3.12/site-packages/flask_appbuilder/security/views.py", line 713, in oauth_authorized
api-server user = self.appbuilder.sm.auth_user_oauth(userinfo)
api-server ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-server File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/fab/auth_manager/security_manager/override.py", line 2031, in auth_user_oauth
api-server user = self.find_user(username=username)
api-server ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-server File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/fab/auth_manager/security_manager/override.py", line 1426, in find_user
api-server return self.session.scalars(
api-server ^^^^^^^^^^^^^^^^^^^^^
api-server File "/home/airflow/.local/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2459, in scalars
api-server return self._execute_internal(

What you think should happen instead?

No response

How to reproduce

We are using OAuth with Azure, nothing was chaged just Airflow docker image updated.

Operating System

linux

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

AWS EKS, official chart 1.18

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected_version:3.1Issues Reported for 3.1area:autharea:corekind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yetpriority:highHigh priority bug that should be patched quickly but does not require immediate new release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions