Also there 2 more strategic questions: 1. How does...
# prefect-community
i
Also there 2 more strategic questions: 1. How doesn't Prefect understand that flow fails? I have a Flow with a single Task. Task calls some external module and that module throws an exception, but Task and Flow in Prefect completes successfully?
a
Usually, when your code throws an exception, this is how Prefect can find out that something failed in your task run. But it could be that if your task is triggered e.g. by a
ShellTask
, the return code indicates success despite the actual exception. Could you share your flow code? This would help to determine what is happening there
i
Unfortunately I cannot share the code, but you pointed me to some ideas. Also is there a common task return code indicating a failure inside a task?
a
I'm particularly interested in how dependencies between tasks are configured and which task is set as a reference task. If you set the failing task as a reference task, then the entire flow run will be considered as failed. https://docs.prefect.io/core/about_prefect/next-steps.html#reference-tasks
found the root cause via DM, the issue was using a custom logger inside a task @Ievgenii Martynenko as discussed try adding your extra logger as shown here https://discourse.prefect.io/t/how-to-set-up-a-custom-logger-to-stream-logs-to-prefect-cloud-backend-extra-loggers/213
i
I'm not completely agree, as customer logger is added properly. Anyway when I find a RC, I will share results here as usual. I suppose that is not connected with Prefect.
a
sure, keep us posted on that
but based on the screenshot you shared, the custom logger did not seem to be connected to Prefect which is why Prefect was not aware of the exception