In this article, we create an error in a workflow to guide you through the process of troubleshooting a workflow that you’ve submitted to Treasure Data.
If you haven’t already, start by going through the TD Workflows Introductory Tutorial.
You will download and use the workflow project in the tutorial.
Create an error to debug
Navigate to the `nasdaq_analysis` directory from the introductory tutorial.
Use the following syntax to create an error for us to debug:
Push the broken workflow to Treasure Data
Start the workflow, on Treasure Data’s side:
Check failure status:
You should see the following as your output
Determine what tasks failed
In above example, attempt_id = 100.
The command should return output similar to the following:
You can see under the last task listed, named +nasdaq_analysis+task2 that state: error, meaning this task is the one that failed.
Review logs of the failed task
The command to get the logs for a particular tasks is as follows:
Specifically, put the following:
Review the output to determine the cause of the errors.
You can also use the job id to review error logs in TD Console.
Fix the query
Fix the query and rerun the workflow.
Push the fix to Treasure Data
Retry the workflow session
Rerun the workflow.
td wf attempts to see the new session attempt running. Run it again, and you’ll likely see it succeeded successfully.
The most recent attempt has the same
session time as the previous attempt that failed. This is the benefit of using
retry in this instance, instead of
start. This is particularly important if you have a daily scheduled workflow, and you only want to retry the current day’s session using any time-related parameters embedded into the workflow.
Alternatively, you can use `--resume` to only rerun starting at the failed task and all subsequent tasks.