GitHub user elangovankrishna added a comment to the discussion: Airflow 3.1.3 – 
API Server returns 500 Internal Server Error on /login once per day (session 
invalidation / PendingRollbackError)

We recently upgraded to Airflow 3.1.5 and ran in the frequent 500 Internal 
Server Error from the API server, this was more prevalent on the PROD env 
because of more number of users, this is what i have implemented and it seems 
to be working 

We were specifically running into this issue 

issue 500 Internal Server Error with the message mismatching_state: CSRF 
Warning! State not equal in request and response. alongside the 
sqlalchemy.exc.PendingRollbackError in our Airflow Prod and Dev environments.

# Database Connection Pool Resilience to stop PendingRollbackErrors / CSRF state
    - name: AIRFLOW__DATABASE__SQL_ALCHEMY_POOL_PRE_PING
      value: "True"
    - name: AIRFLOW__DATABASE__SQL_ALCHEMY_POOL_RECYCLE
      value: "1800"

GitHub link: 
https://github.com/apache/airflow/discussions/59487#discussioncomment-16490887

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to