Skip to content

Airflow Web Interface Crashes with 500 Error (FAB Auth, MySQL Timeout) #57859

Closed

Description

@FazalUrrehmanKhan

Apache Airflow version

3.1.1

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

No response

What happened?

Issue Summary

I'm facing an issue with the Airflow web interface authentication since upgrading Airflow from v3.0.6 to v3.1.0. The problem still persists on v3.1.1.

I’m using the FAB (Flask AppBuilder) auth manager for authentication, and I suspect the issue is related to it.

Problem Description

After the upgrade, the Airflow web interface intermittently becomes inaccessible. The issue typically appears:

  • After a day of normal operation, or
  • When a second user logs in to Airflow from another device.

When the issue occurs, attempting to access the Airflow web UI results in a 500 Internal Server Error.
Restarting the Airflow webserver temporarily resolves the issue, but it reappears after a few hours.

Troubleshooting Performed

  • Tried switching database libraries from pymysql to mysqldb.
  • Verified the database connection and Airflow configuration.
  • Observed that the issue correlates with database connection or session handling errors (example log below).

Recent Log Snippet

sqlalchemy.exc.OperationalError: (MySQLdb.OperationalError) (4031, 'The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.') [SQL: SELECT ab_user.id AS ab_user_id, ab_user.first_name AS ab_user_first_name, ab_user.last_name AS ab_user_last_name, ab_user.username AS ab_user_username, ab_user.password AS ab_user_password, ab_user.active AS ab_user_active, ab_user.email AS ab_user_email, ab_user.last_login AS ab_user_last_login, ab_user.login_count AS ab_user_login_count, ab_user.fail_login_count AS ab_user_fail_login_count, ab_user.created_on AS ab_user_created_on, ab_user.changed_on AS ab_user_changed_on, ab_user.created_by_fk AS ab_user_created_by_fk, ab_user.changed_by_fk AS ab_user_changed_by_fk FROM ab_user WHERE ab_user.id = %s] [parameters: (1,)]

After the above error, I get the following error for any attempts in login to airflow web interface.

sqlalchemy.exc.PendingRollbackError: Can't reconnect until invalid transaction is rolled back. (Background on this error at: https://sqlalche.me/e/14/8s2b)

What you think should happen instead?

Airflow web interface should remain accessible and handle multiple user logins without requiring frequent webserver restarts.

How to reproduce

It usually comes after a day or if a second user logins from the another device. After that, I am unable to access airflow web interface.

Operating System

Red Hat Enterprise Linux 9.6

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

Web interface returns 500 Internal Server Error after some time or when multiple users log in.
Only restarting the webserver restores functionality temporarily.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. boring-cyborg commented on Nov 5, 2025

    @boring-cyborg

    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.

  2. changed the title [-]MYSQL Rollback Error with the web interface[/-] [+]Airflow Web Interface Crashes with 500 Error (FAB Auth, MySQL Timeout)[/+] on Nov 5, 2025
  3. ido177 commented on Nov 8, 2025

    @ido177
    Contributor

    I guess it's similar with #57065

  4. FazalUrrehmanKhan commented on Nov 10, 2025

    @FazalUrrehmanKhan
    Author

    Yeap, it is similar to #57065. What is the status of the fix ? Is it deployed in the new airflow release of 3.1.2 ?

  5. ido177 commented on Nov 10, 2025

    @ido177
    Contributor

    You should wait for the release of a new version of fab provider, it's not a core issue

  6. FazalUrrehmanKhan commented on Nov 10, 2025

    @FazalUrrehmanKhan
    Author

    OK. Thank you.

  7. Thyrum commented on Nov 25, 2025

    @Thyrum

    I think this is a duplicate of #57470 right?

  8. potiuk commented on Nov 25, 2025

    @potiuk
    Member

    Could be if @FazalUrrehmanKhan or others could check if latest airflow + latest fab fix the problem, we could close the issue.

  9. FazalUrrehmanKhan commented on Nov 26, 2025

    @FazalUrrehmanKhan
    Author

    Yes, It works fine with the new version of fab-auth-manager. Thank you everyone for support.

  10. potiuk commented on Nov 27, 2025

    @potiuk
    Member

    Closing then!. Thanks for confirming @FazalUrrehmanKhan

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

    area:autharea:webserverWebserver related Issueskind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yet

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions