Mark stage as failed
Mark a stage as failed during pipeline execution to abort running steps and trigger failure strategies.
You can manually mark a specific stage as failed during pipeline execution. When you mark a stage as failed, Harness aborts any currently-running delegate tasks and triggers configured failure strategies.
What you will learn from this topic
How to configure a failure strategy for manually marked stage failures.
How to mark a stage as failed during pipeline execution.
Before you begin
Pipeline permissions: You must have Execute permissions on pipelines to mark a stage as failed. For more information, refer to Manage roles.
Account setting enabled: You must enable Allow users to mark a running Step as failure in your Harness account's default settings.
Configure failure strategy
Failure strategies define the actions to take when a stage fails. You can configure failure strategies for different failure conditions.
If a stage marked as failed has no specified failure strategy, Harness uses the default failure strategy.
Perform the following steps to configure a failure strategy for manual stage failure:
In your pipeline, select the stage where you want to configure a failure strategy.
Click the Advanced tab.
Under Failure Strategy, click Add.
For On failure of type, select User Marked Failure.
For Perform Action, select the desired action to take when the stage is marked as failed, such as Rollback or Retry.
Click Save.

Mark a stage as failed
Perform the following steps to mark a stage as failed during pipeline execution:
Go to the execution details for a currently-running pipeline.
Select the stage you want to mark as failed, and click Mark Stage As Failed.

In the execution history, the stage's Error Summary reports User Initiated Failure, and the stage's failure type is USER_MARKED_FAILURE.
Next steps
Define a failure strategy on stages and steps: Configure automated failure handling strategies for different error conditions.
Mark pipeline as failed: Mark an entire pipeline as failed instead of a single stage.
Last updated
Was this helpful?