> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-delivery/troubleshooting-and-resources/armory/general/cancel-a-stuck-pipeline.md).

# Cancel a Stuck Pipeline

### Introduction <a href="#introduction" id="introduction"></a>

When a pipeline is stuck and cannot be cancelled via the UI, the following are some steps that can be used to cancel a pipeline.

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

#### Locate the Pipeline ID and Pipeline Execution ID <a href="#locate-the-pipeline-id-and-pipeline-execution-id" id="locate-the-pipeline-id-and-pipeline-execution-id"></a>

**Via Source**

Both pieces of information can be found in the execution details. Navigate to the pipeline, and go to **Execution Details** -> **Source** The pipeline id will be labeled `id` and will be one of the first lines. The execution id will be `execution_id` and will be towards the end.

**Via the URL of Resources in the Console**

The URL for the pipeline when editing the pipeline from the console also contains the `Pipeline ID``````/#/applications//executions/configure/****` The URL for the permalink (next to the source location above) will contain the information about the `Pipeline Execution ID``````/#/applications//executions/details/****?stage=0&step=0&details=`

**Via Orca Logs**

The `Pipeline Execution ID` can also be found within the logs of the Orca instance, by running `kubectl logs -n deploy/spin-orca -f` Sometimes, locating the execution ID can be difficult unless it can be identified from any other executions that are running at the time

### Instructions <a href="#instructions" id="instructions"></a>

#### Via Swagger UI <a href="#via-swagger-ui" id="via-swagger-ui"></a>

* Navigate to `/swagger-ui.html`(You can find your gate endpoint, as an example, by running `kubectl get svc` if you are using Spinnaker on kubernetes or kubernetes cloud environments. For more information about exposing endpoints, please look here: <https://docs.armory.io/docs/spinnaker/exposing-spinnaker/>)\* From there you can navigate to the pipeline controller and `/pipelines/{id}/cancel`\* Once there, add the `pipeline execution ID` from the source of the pipeline and execute the cancel\* A `200 response` means the pipeline was successfully cancelled\* Check back in your Deck UI to confirm the cancellation

#### If Using Redis and Need to Remove Pipeline from Execution <a href="#if-using-redis-and-need-to-remove-pipeline-from-execution" id="if-using-redis-and-need-to-remove-pipeline-from-execution"></a>

The following are commands that can be run in **redis-cli** that can be used to manage and remove pipeline executions. The commands should be run in order, once the `Pipeline ID` and `Pipeline Execution ID` has been located **Command\*\*\*\*Function** `zrange pipeline:executions:pipeline_id 0 -1` *this displays all executions from this pipeline for each execution that you want to remove* `zrem pipeline:executions:pipeline_id execution_id` \*unlink the execution from pipeline\_config\_id \*del pipeline:execution\_id \*delete the execution pipeline \*del orchestration:execution\_id \*delete the execution orchestration The following KB article advises about how to put all the commands together to complete the deletion:<https://kb.armory.io/s/article/Delete-Pipeline-Executions-in-Redis>

#### If Using MySQL and Need to Remove Pipeline from Execution <a href="#if-using-mysql-and-need-to-remove-pipeline-from-execution" id="if-using-mysql-and-need-to-remove-pipeline-from-execution"></a>

The following KB article advises about how to remove a stuck pipeline from MySQL: <https://kb.armory.io/s/article/Stuck-Pipeline-Orca-with-MySQL-Editing-the-Database>

#### ORCA Zombie <a href="#orca-zombie" id="orca-zombie"></a>

Please read the following about resolving ORCA zombie executions. The documentation outlines how to determine if it is an ORCA zombie or not, and what to do to remediate the issue<https://spinnaker.io/guides/runbooks/orca-zombie-executions/>
