Debugging Cancelled Workflows in CircleCI

Overview

When working with CircleCI, you may encounter situations where workflows are unexpectedly cancelled. Understanding the reasons behind these cancellations is crucial for maintaining a smooth CI/CD process. This article outlines common causes of cancelled workflows and provides steps to debug and resolve these issues.

 

Common Reasons for Cancelled Workflows

1. Manual Cancellation:
Workflows can be manually cancelled by users through the CircleCI dashboard. Ensure that no team members are inadvertently cancelling workflows.

You can identify the user who cancelled the workflow by using the`/workflow` endpoint of the CircleCI v2 API : https://circleci.com/docs/api/v2/index.html#tag/Workflow

2. Job Dependencies:
If a job that a workflow depends on fails or is cancelled, subsequent jobs in that workflow may also be cancelled.

3. Timeouts:
Workflows or jobs may be cancelled if they exceed the configured timeout settings. This can happen if a job takes too long to complete. You can read more about this in our documentation here.

4. Version Control Events:
- Workflows triggered by version control events (e.g., pushes, pull requests) may be cancelled if a new commit is pushed to the same branch before the workflow completes. This is particularly true if you are using the Auto-cancel Redundant Workflows feature. In this case you can check if the feature is enabled by navigating to your project settings > advanced > Auto-cancel Redundant Workflows. 

You may also investigate your audit logs for a workflow or job cancel event with actor_type: automation

5. API calls: You may have an API call that is triggering a new workflow or cancelling a job, workflow or pipelines within your configuration file. We recommend reviewing your configuration file carefully to identity any unintentional API calls.

 

Additional Resources: 

Was this article helpful?
0 out of 2 found this helpful

Comments

0 comments

Article is closed for comments.