You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Api-server sqlalchemy.exc.ArgumentError caused by in-task code accessing context for runs without a logical_date #48503
This dag works fine in 2.10 and in 3.0 when the dag has a logical_date supplied on manual run:
from airflow.decorators import dag, task
from collections.abc import Mapping
def _print_dict(d, indent=0):
text_output = ""
for key, value in d.items():
text_output += " " * indent + f"{key}: "
if isinstance(value, Mapping):
text_output += "\n"
text_output += _print_dict(value, indent + 4)
else:
text_output += f"{value}\n"
return text_output
@dag(schedule=None, catchup=False)
def context_full_test_dag():
@task
def print_context(**context):
print("------ START PRINT CONTEXT ------")
dict_repr = _print_dict(context)
print("------ END PRINT CONTEXT ------")
print(dict_repr)
with open("/files/dags/a", "w") as f:
f.write(dict_repr)
keys = []
for key in context.keys():
keys.append(key)
print("------ START PRINT KEYS ------")
print(keys)
print("------ END PRINT KEYS ------")
import json
with open(
"/files/dags/a.json",
"w",
) as f:
json.dump(keys, f)
print_context()
context_full_test_dag()
When the dag is run manually without supplying a logical date, the API server throws a sqlalchemy error (sorry for the screenshot, tmux vscode keybinding mess)
The error leads to the scheduler loosing connection to the API server, and eventually the scheduler crashes. (The task gets stuck)
What you think should happen instead?
A task error, not an api-server error.
Not entirely sure what in the task is causing this.
How to reproduce
Run the above dag in 3.0 manually without supplying a logical date.
Activity
Fix Worker crash on API Server Error (apache#48517)
9 remaining items
Fix Worker crash on API Server Error (#48517)
Fix bug in `previous-successful-dagrun` Execution API endpoint (#48520)
Fix Worker crash on API Server Error (#48517)
Fix bug in `previous-successful-dagrun` Execution API endpoint (#48520)
Fix Worker crash on API Server Error (#48517)
Fix bug in `previous-successful-dagrun` Execution API endpoint (#48520)
Fix Worker crash on API Server Error (#48517)
Fix bug in `previous-successful-dagrun` Execution API endpoint (#48520)
Fix Worker crash on API Server Error (#48517)
Fix bug in `previous-successful-dagrun` Execution API endpoint (#48520)
Fix Worker crash on API Server Error (#48517)
Fix bug in `previous-successful-dagrun` Execution API endpoint (#48520)
Fix Worker crash on API Server Error (#48517)
Fix bug in `previous-successful-dagrun` Execution API endpoint (#48520)