You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ying-w (via GitHub)" <gi...@apache.org> on 2023/05/06 16:39:50 UTC
[GitHub] [airflow] ying-w opened a new issue, #31112: Errors in callback functions are hidden
ying-w opened a new issue, #31112:
URL: https://github.com/apache/airflow/issues/31112
### Apache Airflow version
Other Airflow 2 version (please specify below)
### What happened
The function I call for `on_success_callback` has an error (parameterized incorrectly). This error does not show up in airflow logs.
### What you think should happen instead
Errors in callbacks should propagate to airflow logs or there should be an alternative path for debugging [in documentation](https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/logging-monitoring/callbacks.html)
### How to reproduce
A dag that looks something like this
```py
def send_email(context, job_status):
# send email here parameterized by context
def dag_success(context):
send_email(context, success=True) # this should fail
def dag_fail(context):
send_email(context, success=False) # this should fail
@dag(
schedule=None,
start_date=pendulum.datetime(2023, 1, 1),
on_success_callback=dag_success,
on_failure_callback=dag_fail,
tags=["example"],
)
def foo():
BigQueryCheckOperator(
...
)
foo_run = foo()
```
I expect the following function to throw an error because of mismatch of arguments: `send_email()` expects `job_status=` while i'm passing in `success=`.
### Operating System
OS X 13.2.1
### Versions of Apache Airflow Providers
apache-airflow-providers-google==8.11.0
### Deployment
Astronomer
### Deployment details
Airflow 2.5.2
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ying-w commented on issue #31112: Errors in callback functions are hidden
Posted by "ying-w (via GitHub)" <gi...@apache.org>.
ying-w commented on issue #31112:
URL: https://github.com/apache/airflow/issues/31112#issuecomment-1538966129
resolved by https://github.com/apache/airflow/pull/31116
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on issue #31112: Errors in callback functions are hidden
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on issue #31112:
URL: https://github.com/apache/airflow/issues/31112#issuecomment-1538023820
Hi @ying-w , are you aware of this log file for dag level callbacks: https://github.com/apache/airflow/blob/75f5f53ed0aa8df516c9d861153cab4f73318317/airflow/models/dag.py#L1328-L1329
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ying-w commented on issue #31112: Errors in callback functions are hidden
Posted by "ying-w (via GitHub)" <gi...@apache.org>.
ying-w commented on issue #31112:
URL: https://github.com/apache/airflow/issues/31112#issuecomment-1537190560
Is there a way to see scheduler logs in UI?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on issue #31112: Errors in callback functions are hidden
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #31112:
URL: https://github.com/apache/airflow/issues/31112#issuecomment-1537194048
> Is there a way to see scheduler logs in UI?
NO. But you can configure logging via https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/logging-monitoring/logging-tasks.html#advanced-configuration and configure your logging as you want.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on issue #31112: Errors in callback functions are hidden
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #31112:
URL: https://github.com/apache/airflow/issues/31112#issuecomment-1538025940
Ah . TIL @ephraimbuddy ! I had no idea we have it !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on issue #31112: Errors in callback functions are hidden
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #31112:
URL: https://github.com/apache/airflow/issues/31112#issuecomment-1537194259
Note that airflow log is **not** to monitor airflow components - the logs there are to show task logs only, and callbacks are considered part of the "application" not part of the task.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ying-w closed issue #31112: Errors in callback functions are hidden
Posted by "ying-w (via GitHub)" <gi...@apache.org>.
ying-w closed issue #31112: Errors in callback functions are hidden
URL: https://github.com/apache/airflow/issues/31112
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on issue #31112: Errors in callback functions are hidden
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #31112:
URL: https://github.com/apache/airflow/issues/31112#issuecomment-1537189804
Due to the nature of the callbacks they are executed after the tasks are completed, so errors in the callbacks are showing up in the scheduler logs. not task logs.
> Errors in callbacks should propagate to airflow logs or there should be an alternative path for debugging [in documentation](https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/logging-monitoring/callbacks.html)
100% agree. I assigned you. It's easy to update the docs, just click "Suggest a change on this page" button at the bottom of the page and PR should be opened for you. Easy way to become a contributor.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org