-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Closed
Closed
Copy link
Labels
Can't ReproduceThe problem cannot be reproducedThe problem cannot be reproducedaffected_version:2.7Issues Reported for 2.7Issues Reported for 2.7area:APIAirflow's REST/HTTP APIAirflow's REST/HTTP APIgood first issuekind:bugThis is a clearly a bugThis is a clearly a bugpending-response
Description
Apache Airflow version
2.7.3
What happened
After upgrade to 2.7.3 I noticed that webserver returns 500 for POST requests with a note field. After some investigation it seems that None in user_id converted to str causing it:
[SQL: INSERT INTO dag_run_note (user_id, dag_run_id, content, created_at, updated_at) VALUES (%(user_id)s, %(dag_run_id)s, %(content)s, %(created_at)s, %(updated_at)s)]
[parameters: {'user_id': 'None', 'dag_run_id': 2944, 'content': 'test', 'created_at': datetime.datetime(2023, 12, 7, 17, 42, 15, 390085, tzinfo=Timezone('UTC')), 'updated_at': datetime.datetime(2023, 12, 7, 17, 42, 15, 390096, tzinfo=Timezone('UTC'))}]
rundag [07/Dec/2023:17:42:15 +0000] "POST /api/v1/dags/*/dagRuns HTTP/1.1" 500 1539 "-" "python-requests/2.31.0"
That's probably not an issue of Airflow itself, but SQLAlchemy 1.4. it's probably fixed in 2.0.
What you think should happen instead
Dagrun should be successfully registered by airflow and note should be saved into dag_run_note table.
How to reproduce
- Disable Auth to allow unauthorized access to the API in
webserver_config.py
AUTH_ROLE_PUBLIC = "Admin"
- Try to schedule a run via
DAGRunAPI
import requests
dag_run_url="https://airflow/api/v1/dags/test/dagRuns"
r = requests.post(
url=dag_run_url, json={"dag_run_id": "test_me", "note":"note", "conf": {}}
)
assert r.status_code == 500
print(r.text)Operating System
Debian GNU/Linux 11 (bullseye)
Versions of Apache Airflow Providers
No response
Deployment
Other Docker-based deployment
Deployment details
Docker image: apache/airflow:2.7.3-python3.9
DB: Postgresql
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Can't ReproduceThe problem cannot be reproducedThe problem cannot be reproducedaffected_version:2.7Issues Reported for 2.7Issues Reported for 2.7area:APIAirflow's REST/HTTP APIAirflow's REST/HTTP APIgood first issuekind:bugThis is a clearly a bugThis is a clearly a bugpending-response