teamclairvoyant/airflow-rest-api-plugin

CSRF Issue with airflow 1.10.4 python 36

vshabarish opened this issue · 1 comments

we are using this plugin with airflow 1.10.4 python36 , Resulting into scheduler unhealthy
The scheduler fails to start when using this plugin
This has been experienced when Airflow is configured to use a plugin executor. For CSRF this plugin imports airflow/www/app.py, which happens to also import airflow/jobs. When the scheduler starts, it will import airflow/jobs which will import the plugin executor. This creates a circular import, crashing the scheduler.

So we tried changing to this
from flask_wtf.csrf import CSRFProtect csrf = CSRFProtect()
Scheduler is stable and dags are running , But the plugin POST calls are failing with
<title>400 Bad Request</title> Bad Request The CSRF token is missing.

Plugin works with other airflow and python versions like 1.10.4-python27 and 1.10.6-python36

Any idea how to resolve this issue ?

Got the same issue here today.

My environment:

  • Airflow: 1.10.11
  • Deploy method: I deployed bitnami/airflow to kubernets
  • get rest api works well with JWT tokens

Error:
Got CSRF token missing when posting a DAG file to deploy_dag api

I have added both to my environment

CSRF_ENABLED=false
WTF_CSRF_ENABLED=false

But still get the CSRF token error