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
File "/opt/pyenv/versions/3.11.7/lib/python3.11/site-packages/airflow/sentry.py", line 127, in add_tagging
task = task_instance.task
^^^^^^^^^^^^^^^^^^
AttributeError: type object 'TaskInstance' has no attribute 'task'
What you think should happen instead?
No response
How to reproduce
Have sentry_on = True and schedule_after_task_execution = True. Run a DAG that has tasks depending on other tasks. Scheduling of any downstream task will hit this bug.
Operating System
Linux (Ubuntu 22.04)
Versions of Apache Airflow Providers
No response
Deployment
Docker-Compose
Deployment details
No response
Anything else?
I was able to attach a debugger and root cause this:
A recent refactoring of this code broke this assumption. There are two paths forward to resolve as I see it:
Update enrich_errors to look for ti in kwargs
Remove @Sentry.enrich_errors from _schedule_downstream_tasks. I don't have the full context here, but I imagine the semantics of enriching errors for scheduling (as opposed to running tasks) doesn't make sense.
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
Apache Airflow version
2.8.1
If "Other Airflow 2 version" selected, which one?
2.8.0
What happened?
Seeing exceptions in code at:
What you think should happen instead?
No response
How to reproduce
Have
sentry_on = True
andschedule_after_task_execution = True
. Run a DAG that has tasks depending on other tasks. Scheduling of any downstream task will hit this bug.Operating System
Linux (Ubuntu 22.04)
Versions of Apache Airflow Providers
No response
Deployment
Docker-Compose
Deployment details
No response
Anything else?
I was able to attach a debugger and root cause this:
_schedule_downstream_tasks uses @Sentry.enrich_errors which is expecting to be decorating a function that either has
self
as aTaskInstance
or forself
to have an attribute calledtask_instance
.A recent refactoring of this code broke this assumption. There are two paths forward to resolve as I see it:
enrich_errors
to look forti
inkwargs
@Sentry.enrich_errors
from_schedule_downstream_tasks
. I don't have the full context here, but I imagine the semantics of enriching errors for scheduling (as opposed to running tasks) doesn't make sense.Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: