From a1c85bd24d555f675fa1bd0321199f9a11fc76d2 Mon Sep 17 00:00:00 2001 From: sankari gopalakrishnan Date: Thu, 14 Nov 2024 13:13:09 +0100 Subject: [PATCH] [Wf-Diagnostics] add troubleshooting guide for activity failures in a workflow (#199) --- src/.vuepress/config.js | 1 + .../02-activity-failures.md | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/docs/08-workflow-troubleshooting/02-activity-failures.md diff --git a/src/.vuepress/config.js b/src/.vuepress/config.js index e15b9b82e..ce8ed8fc3 100644 --- a/src/.vuepress/config.js +++ b/src/.vuepress/config.js @@ -177,6 +177,7 @@ module.exports = { children: [ '08-workflow-troubleshooting/', '08-workflow-troubleshooting/01-timeouts', + '08-workflow-troubleshooting/02-activity-failures', ], }, { diff --git a/src/docs/08-workflow-troubleshooting/02-activity-failures.md b/src/docs/08-workflow-troubleshooting/02-activity-failures.md new file mode 100644 index 000000000..31e044830 --- /dev/null +++ b/src/docs/08-workflow-troubleshooting/02-activity-failures.md @@ -0,0 +1,27 @@ +--- +layout: default +title: Activity Failures +permalink: /docs/workflow-troubleshooting/activity-failures +--- +# Activity failures +An activity fails when it encounters an error during its execution. This results in ActivityTaskFailed event in the workflow execution with some details of the error. The different kinds of errors that can be seen in activity failures are listed here. + +## Panic errors +Description: There is a issue in the activity code that is causing a panic. + +Mitigation: Panics are usually caused by nil pointer dereferences or out-of-range array access and should never be expected in a workflow. Check the stack trace provided in the error details to find where in the activity code, the panic is seen. Fix the rootcause of the panic. + +## Custom errors +Description: This is a customised error returned by the activity. + +Mitigation: This is a way of facilitating error handling done within the activity code. Check your activity code to find where it returns a NewCustomError with some information. This is ideally an expected error scenario and should be handled within the workflow that executed the activity. + +Read more about [error handling](https://cadenceworkflow.io/docs/go-client/error-handling/) + +## Generic errors +Description: This is an error returned by the activity. + +Mitigation: This error is caused by something unexpected within the activity code, typically due to a downstream service that your activity communicates with. Cadence does not know anything about it and just puts all unknown errors in this category. Check your activity code to find the potential error cases. This is ideally an unexpected error scenario and should be debugged further to fix the rootcause. + +Read more about [error handling](https://cadenceworkflow.io/docs/go-client/error-handling/) +