Skip to content

providers-fab: Airflow 3.1.3 sqlalchemy.exc.PendingRollbackError: Can't reconnect until invalid transaction is rolled back #59349

@berglh

Description

@berglh

Apache Airflow Provider(s)

fab

Versions of Apache Airflow Providers

apache-airflow-providers-amazon==9.16.0
apache-airflow-providers-apache-spark==5.4.0
apache-airflow-providers-celery==3.13.0
apache-airflow-providers-cncf-kubernetes==10.11.0
apache-airflow-providers-common-compat==1.10.0
apache-airflow-providers-common-io==1.6.4
apache-airflow-providers-common-messaging==2.0.0
apache-airflow-providers-common-sql==1.28.2
apache-airflow-providers-docker==4.4.4
apache-airflow-providers-elasticsearch==6.3.4
apache-airflow-providers-fab==3.0.3
apache-airflow-providers-ftp==3.13.2
apache-airflow-providers-git==0.0.9
apache-airflow-providers-google==18.1.0
apache-airflow-providers-grpc==3.8.2
apache-airflow-providers-hashicorp==4.3.3
apache-airflow-providers-http==5.4.0
apache-airflow-providers-microsoft-azure==12.8.0
apache-airflow-providers-mysql==6.3.4
apache-airflow-providers-odbc==4.10.2
apache-airflow-providers-openlineage==2.7.3
apache-airflow-providers-postgres==6.4.0
apache-airflow-providers-redis==4.3.2
apache-airflow-providers-sendgrid==4.1.4
apache-airflow-providers-sftp==5.4.1
apache-airflow-providers-slack==9.4.0
apache-airflow-providers-smtp==2.3.1
apache-airflow-providers-snowflake==6.6.0
apache-airflow-providers-ssh==4.1.5
apache-airflow-providers-standard==1.10.0

Apache Airflow version

3.1.3

Operating System

Amazon Linux 2023

Deployment

Official Apache Airflow Helm Chart

Deployment details

EKS v1.33
Airflow Chart 1.18.0
Aurora Postgres 16.9
Replicas 2 of every component
Have three roles and users (admin, group1, group 2)

What happened

I'm receiving the same errors mentioned in the following issues, despite running version 3.0.3 of the FAB provider. The login works for several days before failing with the error:

2025-12-11T23:56:28.992968Z [error    ] Exception on /login/ [GET]     [airflow.providers.fab.www.app] loc=app.py:1744
Traceback (most recent call last)
...
 raise exc.PendingRollbackError(
sqlalchemy.exc.PendingRollbackError: Can't reconnect until invalid transaction is rolled back. (Background on this error at: https://sqlalche.me/e/14/8s2b)

Stacktrace

airflow-api-error.log

What you think should happen instead

Ideally, the sqlAlchemy error shouldn't occur.

How to reproduce

Run FAB with in-built user authentication for several days and wait for the error to appear.

Anything else

I'm wondering if the issue may be resulted to running API replicas and hitting some irrecoverable lock state of some kind.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions