Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSRF Issue with airflow 1.10.4 python 36 #72

Open
vshabarish opened this issue Jul 14, 2020 · 1 comment · May be fixed by #74
Open

CSRF Issue with airflow 1.10.4 python 36 #72

vshabarish opened this issue Jul 14, 2020 · 1 comment · May be fixed by #74

Comments

@vshabarish
Copy link

vshabarish commented Jul 14, 2020

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 ?

@ashb ashb linked a pull request Jul 15, 2020 that will close this issue
@BigFatDog
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants