Skip to content

Airflow 3.1.1 oauth login broken #57485

Closed

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

Activity

  1. added
    priority:highHigh priority bug that should be patched quickly but does not require immediate new release
    on Oct 29, 2025
  2. vikramkoka commented on Oct 29, 2025

    @vikramkoka
    Contributor
  3. vincbeck commented on Oct 29, 2025

    @vincbeck
    Contributor

    Can we have the full stacktrace please? I can see the stacktrace is truncated

  4. anavrotski commented on Oct 29, 2025

    @anavrotski
    Author

    I've deployed 3.1.1 again, and the problem disappeared. At least right now, I can log in and out without errors.

    Looks like this issue can be closed - if the same problem appears again after several days, we can create a new one and add a link to this.

  5. vincbeck commented on Oct 29, 2025

    @vincbeck
    Contributor

    I am closing this one, feel free to reopen it if you experienced the issue again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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